This function creates bibliographic information by reading the Metadata and
text of PDFs stored in a user specified directory using Poppler
(https://poppler.freedesktop.org/). IF requested, the function
first searches for DOIs and downloads BibTeX
entries from
ReadCrossRef
if DOIs are found. If this is not requested or
a DOI is not found for an entry, an attempt is made to build a BibTeX
entry from the metadata and text.
ReadPDFs(
path,
.enc = "UTF-8",
recursive = TRUE,
use.crossref = TRUE,
use.metadata = TRUE,
progress = FALSE
)
An object of class BibEntry.
character; path to directory containing pdfs or filename of
one pdf. normalizePath
is used on the specified path
character; text encoding to use for reading pdf and creating
BibEntry object. Available encodings for Poppler can be found using
system("pdfinfo -listenc")
. The encoding must also be listed
in iconvlist()
.
logical; same as list.files
. Should pdfs
in subdirectories of path be used?
logical; should an attempt be made to download bibliographic
information from CrossRef if
any Document Object Identifiers (DOIs) are found? This is only supported if the Suggeseted package bibtex
is found.
logical; should the PDF metadata also be used to help create entries?
logical; should progress bar be generated when fetching from CrossRef?
This function requires that the pdfinfo
utility from Poppler PDF
https://poppler.freedesktop.org/ be installed.
This function will create only Article
or Misc
BibTeX
entries.
The absolute path to each file will be stored in the bib entry in a field
called ‘file’, which is recognized by BibLaTeX
(though not printed by
any standard style) and can be used by the
open.BibEntry
function to open the PDF in the default viewer.
If the keywords metadata field is available, it will be added to the bib entry
in a field ‘keywords’, which is recognized by BibLaTeX
.
ReadCrossRef
, BibEntry
,
open.BibEntry
if (FALSE) {
path <- system.file("doc", package = "RefManageR")
ReadPDFs(path)
}
Run the code above in your browser using DataLab