konnectors/libs

Handle PDF generation

Opened this issue ยท 3 comments

For websites that don't propose PDF files (like The Old Reader and Booking ๐Ÿ˜‰ ).

I think that there are at least two levels:

  • the "I don't want to touch at the pdf" high level, like the html2pdf in the booking konnector
  • the "I want to decide how the pdf will look" low level, for cases when the html can't be rendered in pdf

The high level could be a method which takes either an url or an html fragment to be converted.

The low level could just expose the pdfjs api to a dedicated namespace?
The last version simplify the doc creation (no mandatory font, defaults to helvetica) and the resulting document inherits directly from Readable, so there is no more _doc field.

The is also a need to find a way to add images in PDF files even when the connector is built with webpack

Does it works for remote images or not at all?
I haven't got the time to check it.

I will try to check it. It was just a reminder