Skip to content

Commit 040295a

Browse files
committed
add xbar example
1 parent 1ed0728 commit 040295a

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

README.Rmd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,18 @@ directory before trying to install the package. This can be changed from
119119
write permission by choosing "Run as administrator" when launching R (again,
120120
from the right-click context menu).
121121

122+
## Debugging
123+
124+
Load the package like this:
125+
126+
```r
127+
devtools::load_all()
128+
libname = "/home/pacha/R/x86_64-pc-linux-gnu-library/4.4"
129+
pkgname = "tabulapdf"
130+
rJava::.jpackage(pkgname, jars = "*", lib.loc = libname)
131+
rJava::J("java.lang.System")$setProperty("java.awt.headless", "true")
132+
```
133+
122134
## Meta
123135

124136
* Please [report any issues or bugs](https://github.com/ropensci/tabulapdf/issues).

dev/test-special_characters.R

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
devtools::load_all()
2+
libname <- "/home/pacha/R/x86_64-pc-linux-gnu-library/4.4"
3+
pkgname <- "tabulapdf"
4+
rJava::.jpackage(pkgname, jars = "*", lib.loc = libname)
5+
rJava::J("java.lang.System")$setProperty("java.awt.headless", "true")
6+
7+
file <- "inst/examples/xbar.pdf"
8+
pages <- NULL
9+
area <- NULL
10+
password <- NULL
11+
encoding <- NULL
12+
copy <- FALSE
13+
14+
pdfDocument <- load_doc(file, password = password, copy = copy)
15+
on.exit(pdfDocument$close())
16+
17+
stripper <- new(J("org.apache.pdfbox.text.PDFTextStripper"))
18+
19+
if (is.null(stripper)) {
20+
stop("Failed to initialize PDFTextStripper.")
21+
}
22+
23+
stripper$setSortByPosition(TRUE)
24+
stripper$setAddMoreFormatting(TRUE)
25+
26+
out <- stripper$getText(pdfDocument)

inst/examples/xbar.pdf

40.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)