ropensci / pdftools

Text Extraction, Rendering and Converting of PDF Documents
https://docs.ropensci.org/pdftools
Other
518 stars 69 forks source link

factor to character in pdf_fonts #1

Closed sckott closed 8 years ago

sckott commented 8 years ago

Minor point, but I get

str(pdf_fonts("R-exts.pdf"))
#> 'data.frame':    22 obs. of  4 variables:
#>  $ name    : Factor w/ 22 levels "AYLODX+CMTI10",..: 17 12 9 5 16 21 19 1 6 3 ...
#>  $ type    : Factor w/ 1 level "type1": 1 1 1 1 1 1 1 1 1 1 ...
#>  $ embedded: logi  TRUE TRUE TRUE TRUE TRUE TRUE ...
#>  $ file    : Factor w/ 1 level "": 1 1 1 1 1 1 1 1 1 1 ...

would you be willing to change the factor columns to character? seems safer, less likely to cause problems downstream if users don't realize they're dealing with factors

jeroen commented 8 years ago

Good catch, that is definitely not intended.

jeroen commented 8 years ago

Fixed @ https://github.com/jeroenooms/pdftools/commit/e91e4c92a1d3ae1bf750a7136cc22de39cc58fe3.