- Package:
- poppler-utils
- Source:
- poppler
- Description:
- PDF utilities (based on Poppler)
- Submitter:
- Date:
- 2024-09-13 03:51:01 UTC
- Severity:
- wishlist
- Tags:
Dear Maintainer, *** Reporter, please consider answering these questions, where appropriate *** * What led up to the situation? pdftohtml was applied to a pdf file containing pixmap images. * What exactly did you do (or not do) that was effective (or ineffective)? The command was "pdftohtml -s <file>.pdf". * What was the outcome of this action? All the text was in one <file>.html but each picture was an additional file. * What outcome did you expect instead? With the -s option, text and pictures should all be in one <file>.html. A JPEG or PNG picture can be included in an html document with Base64 encoding. The syntax is very simple. Examples here. http://easthope.ca/Category2.html Scroll down to the heading "Inline, Base64 encoded PNG bitmaps". The first instance of an embedded bitmap is <img src="data:image/png;base64,iVBORw0K ..." alt="Diagram for 0x0 with test object 0,<br>represented in PNG.<br>">
severity 775049 wishlist tag 775049 - newcomer patch thanks Hi Peter, In data sabato 10 gennaio 2015 10:01:45, hai scritto: The current behaviour is generally acceptable, as the binary resources (like images) are put outside the main HTML content, so they can be f.e. stored better in version control systems (HTML changes, images stay the same), or also better served/cached via HTTP. Thus, I would consider making the image data as inline as a new feature, which should be explicitly requested. Can you please request this new feature on the bug tracking system of Poppler, at https://bugs.freedesktop.org/, "poppler" product and "utils" component? Once done, you can report here its bug number. Thanks for your report,
From: Pino Toscano <pino@debian.org> Date: Sat, 25 Jul 2015 20:54:44 +0200 OK, good. Also good. My proposal is for the case where the user has a book, thesis or similar document and an e-reader or smartphone able to render HTML5 but not PDF. If the document contains a number of illustrations scattered in the text, the multiple files from the -s option are awkward or infeasible. A single HTML is needed. Have you already chosen an identifier for the new option? -1 perhaps? From 2015-03-20, https://bugs.freedesktop.org/show_bug.cgi?id=89696 . If you prefer it to be filed again with emphasis on feature request rather than bug report, please let me know. I'm working on the implementation, although unfamiliar with the territory. Regards, ... Peter E.
Resolved upstream with addition of the option -dataurls. The name of the option is rather obscure but means that an entity such as an image is included as a Base64 encoded src attribute of an img tag. In Debian 11 the command pdftohtml -dataurls -c -s MyPhDthesis.pdf produces MyPhDthesis.html as a complete document, including images, in one file. Regards, ... P.
-dataurls is definitely a valuable addition. Thanks. One further detail is worth attention. The man page notes "-c generate complex output". For at least one HTML file here, "pdftohtml -dataurls -c -s <file>.pdf" and "pdftohtml -dataurls -s <file>.pdf" produce the same output. Therefore when -dataurls is used, -c may have no effect. Therefore the manual page should explain -c with more than "generate complex output". Thanks again, ... P. mobile: +1 778 951 5147 VoIP: +1 604 670 0140 https://en.wikibooks.org/wiki/User:PeterEasthope
Hello Pino Toscano and all interested in pdftohtml, The concern I reported has been solved and pdftohtml now has option -dataurls. This option indicates that images are embedded in the html text as Base64 encoded pixelmaps. HTML documentation refers to such embedded image by the abstruse term "data URL". This allows one PDF file to be converted to one HTML file. Thx, ... P.