Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using set_fields 'All unnamed arguments must be length 1' #60

Open
mollyic opened this issue Jan 25, 2023 · 4 comments
Open
Labels
failed to replicate Failed to replicate the issue. Might need additional details to isolate the problem

Comments

@mollyic
Copy link

mollyic commented Jan 25, 2023

hi there, I have been trying to run the staplr code on Ubuntu 20.04.5 and keep getting an error (All unnamed arguments must be length 1) when trying to use the set_fields function.

The get_fields function seems to work fine, I am using it in R and able to see that the field variable is updated with the new information. The issue is only when the set_fields function is applied.

I installed java using the code provided and installed rJava (install.packages("rJava")):

sudo apt update -y
sudo apt install -y openjdk-8-jdk openjdk-8-jre
sudo R CMD javareconf

I first installed the package using: install.packages('staplr', dependencies = TRUE)

Uninstalled this version after is produced this error and tried: devtools::install_github("pridiltal/staplr")

However the same issue keeps arising.

As part of my troubleshooting I tried to install pdftools using: sudo apt-get install libpoppler-cpp-dev

I'm at a loss as to what to try next so any insight would be appreciated. Thanks!

@oganm
Copy link
Collaborator

oganm commented Jan 25, 2023

Could you show a reproducible example, ideally with the pdf file included? You can also use the example pdf included if you don't want to share the pdf file. It can be accessed by doing system.file('simpleForm.pdf',package = 'staplr')

@mollyic
Copy link
Author

mollyic commented Jan 25, 2023

So I've been trying to get the example working at this stage, which uses the system.file('simpleForm.pdf',package = 'staplr'). So taken from what's available in the README section:

library(staplr) 

pdfFile = system.file('testForm.pdf',package = 'staplr')
fields = get_fields(pdfFile)
fields$TextField1$value = 'this is text'
set_fields(pdfFile, 'newFile.pdf', fields)

@mollyic
Copy link
Author

mollyic commented Jan 25, 2023

Just saw you were using 'simpleForm.pdf', tried it and still getting the same error.

@mollyic
Copy link
Author

mollyic commented Jan 25, 2023

For clarity:

library(staplr)

pdfFile = system.file('simpleForm.pdf',package = 'staplr')
fields = get_fields(pdfFile)
fields$TextField$value = 'this is text'
set_fields(pdfFile, 'newFile.pdf', fields)

@oganm oganm added the failed to replicate Failed to replicate the issue. Might need additional details to isolate the problem label Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed to replicate Failed to replicate the issue. Might need additional details to isolate the problem
Projects
None yet
Development

No branches or pull requests

2 participants