Closed kevpfowler closed 4 years ago
I installed pdftk-java separately on my system, and then the staplr::get_fields() command did not generate that error.
However, neither did it work correctly, returning and empty named list (list of length 0)
The readme is accurate for the development version. The CRAN version still requires pdftk installation. Could you try to install it from github and see if it works?
The other thing I tried was to remove pdftk-java, and then installed pdftk itself, which also installed pdftk-java. I re-ran javareconf, and restart R/RStudio. I still got the same result (zero-length list reading fields from testForm.pdf)
I will try the development version and report back
Ok I used the development version and it seems to work correctly. If I had paid full attention to the version qualifier in the README I could have skipped reporting this, since I was using 2.9.0 from CRAN and the README section specifically said it was for 2.11.0. Though I don't understand why 2.9.0 was not working with the externally installed pdftk.
Just an FYI: To install the development version successfully with R3.6.3, I had to first install XML specifying the repo.
install.packages("XML", repos = "http://www.omegahat.net/R")
@pridiltal did you have time to push the updated version to CRAN? the current dev version has been stable and easier to install and debug.
@kevpfowler any idea why you had to specify the repo when installing XML? For me devtools::install_github
does the trick with or without XML installed and there doesn't seem to be any issues with CRAN servers, not right now at least
This is a great update of the package. Thank you @oganm . Just submitted to CRAN. I'll update you soon.
@oganm I do not know why I had to specify the repo. I'm running on Ubuntu 20.04. Providing more details below.
This is the error I get when installing staplr with devtools::install_github
:
> devtools::install_github("pridiltal/staplr")
Downloading GitHub repo pridiltal/staplr@master
Skipping 1 packages not available: XML
✓ checking for file ‘/tmp/RtmpcJMIRT/remotes405f95d4ed366/pridiltal-staplr-b5b9505/DESCRIPTION’ ...
─ preparing ‘staplr’:
✓ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘staplr_3.0.0.tar.gz’
Installing package into ‘/home/kfowler/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
ERROR: dependency ‘XML’ is not available for package ‘staplr’
* removing ‘/home/kfowler/R/x86_64-pc-linux-gnu-library/3.6/staplr’
Error: Failed to install 'staplr' from GitHub:
(converted from warning) installation of package ‘/tmp/RtmpcJMIRT/file405f9442e4176/staplr_3.0.0.tar.gz’ had non-zero exit status
This is the error I get when trying to install XML package the normal way:
> install.packages("XML")
Installing package into ‘/home/kfowler/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘XML’ is not available (for R version 3.6.3)
This is my repos options setting:
> getOption("repos")
CRAN
"https://cloud.r-project.org"
This is the successful result specifying the omegahat repo:
> install.packages("XML", repos = "http://www.omegahat.net/R")
Installing package into ‘/home/kfowler/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'http://www.omegahat.net/R/src/contrib/XML_3.99-0.tar.gz'
Content type 'application/x-gzip' length 1547930 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
...
...
After which, the staplr devtools::install_github() works fine.
oh sorry i see the reason now. Current CRAN version of XML requires R>4.0.0 which prevents it's installation from install.packages for you. If you're able to update your R the problem should go away.
My understanding from the README is that if I have JAVA installed (JDK and JRE), then staplr contains pdftk-java and I do not need to separately install pdftk.
But, when I run the README example, I get "sh: 1: pdftk: not found":
I am using staplr_2.9.0, with R 3.6.3, on a ubuntu 20.04 system. I ran javareconf, and restarted R before attempting the example above.