File tree 3 files changed +38
-0
lines changed 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,18 @@ directory before trying to install the package. This can be changed from
119
119
write permission by choosing "Run as administrator" when launching R (again,
120
120
from the right-click context menu).
121
121
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
+
122
134
## Meta
123
135
124
136
* Please [ report any issues or bugs] ( https://github.com/ropensci/tabulapdf/issues ) .
Original file line number Diff line number Diff line change
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 )
You can’t perform that action at this time.
0 commit comments