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

Add, to metadata of any PDF, name of the R file that creates the figure #64

Open
jbullock35 opened this issue Sep 1, 2021 · 0 comments

Comments

@jbullock35
Copy link
Owner

jbullock35 commented Sep 1, 2021

This new feature would be written into latexTablePDF.R. Something like "Created by XXX.R" would appear in the PDF metadata.

This improvement would require two steps:

  1. Find the R filename. Probably possible only if using Rscript or Rstudio. See https://stackoverflow.com/questions/1815606/determine-path-of-the-executing-script and https://stackoverflow.com/questions/18264683/how-to-get-the-file-name-of-the-r-script-currently-being-executed-for-easy-auto.
    • Or I can just explicitly store the filename as a string. This is a second-best option but still better than nothing.

  1. Add the filename to the metadata. pdfcrop doesn't seem to have this ability, so I would need to use some other tool. https://rdrr.io/github/skgrange/threadr/man/pdf_write_metadata.html is promising. It relies on exiftool; see https://stackoverflow.com/questions/18647777/. If that doesn't work, consider pdftk.
    • The pdftools package won't help. It reads PDF files but doesn't write to them.
@jbullock35 jbullock35 changed the title Add name of R file that creates a figure to the PDF metadata of any figure Add, to metadata of any PDF, name of the R file that creates the figure Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant