<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>You should have read the list sooner - you could have saved some time. &nbsp;:-)</div><div><br></div><div>Rotated text is solved, but hasn't been committed to the freedesktop repository. &nbsp;See&nbsp;<a href="https://bugs.freedesktop.org/show_bug.cgi?id=38586">https://bugs.freedesktop.org/show_bug.cgi?id=38586</a>&nbsp;.</div><div><br></div><div>Fonts are mostly solved, see&nbsp;<a href="https://bugs.freedesktop.org/show_bug.cgi?id=39385">https://bugs.freedesktop.org/show_bug.cgi?id=39385</a>&nbsp;.</div><div><br></div><div>It works, but you have to separately extract the fonts. &nbsp;Ideally, we would include the code to extract the fonts with Poppler. &nbsp;Right now you can use Mu PDF, pdfextract, to extract the fonts, and FontForge operates on them just fine. &nbsp;Mu PDF doesn't seem to be as forgiving as Poppler in terms of ill-formed PDF documents.</div><div><br></div><div>Z-index is a problem I've thought about too, but I haven't had any use cases yet, so we haven't tackled it. &nbsp;I believe that what should be done, as you guessed, is that the text and graphics output devices need to be combined into a single device. &nbsp;What makes this a bit tricky is that I believe we have to support the "HAVE_SPLASH" precompiler flag. &nbsp;So, in order to derive the HtmlOutputDev from the SplashOutputDev, it would probably have to be done conditionally. &nbsp;Ok, so you combine them. &nbsp;Then what?</div><div><br></div><div>If you look closely at the patches in the second bug referenced above, you'll see that we're keeping track of the bounding box of each drawing operation, using a new ImageProperties class. &nbsp;Then we coalesce them to find the regions of the "big background image" to extract into individual html images. &nbsp;Now, if you were to extend that to also keep track of text showing operations, you could use the order of those overlapping regions in the list as the z-index.</div><div><br></div><div>Currently, the image extraction algorithm isn't using the alpha channel. &nbsp;You would obviously need to fix that. &nbsp;I don't know if the underlying Poppler library starts with a blank canvas (alpha = 0) or with a blank white canvas (alpha = 1, color = 0xFFFFFF), but I believe you would need the former, not the latter.</div><div><br></div><div>Hope it helps. &nbsp;Let us know what you're working on, so that we don't duplicate effort and create competing solutions to the same problems. &nbsp;Btw., what Stephen and I are working on now is to&nbsp;fix text spacing. &nbsp;Now that we're using the right font, we're much closer, but there are still a bunch of issues. &nbsp;Stephen's already made some great progress, and we'll be submitting patches soon.</div><div><br></div><div>We look forward to working with you!</div><div><br></div><div>Best, --josh</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Akash Agrawal &lt;<a href="mailto:akash.agrawal84@gmail.com">akash.agrawal84@gmail.com</a>&gt;<br><span style="font-weight:bold">Date: </span> Wed, 20 Jul 2011 05:36:58 -0700<br><span style="font-weight:bold">To: </span> "<a href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a>" &lt;<a href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a>&gt;<br><span style="font-weight:bold">Subject: </span> [poppler] pdftohtml using Poppler<br></div><div><br></div>Hi All,<br><div class="gmail_quote"><div><br></div><div>My name is Akash Agrawal and I am working on producing a full-fledged&nbsp;pdf to html solution. I investigated poppler and made a lot of custom changes for my requirement. I got your reference from revision log in pdfthtml source files. I will appreciate if you can address my queries. I am stuck at 2 issues currently:</div><div><ol><li>z-index</li><li>Fonts</li></ol></div><div><b>z-index:</b> In it's current solution, poppler's pdftohtml puts all the non-text data into an image and use this image as a background image in html. But at times, there are pdfs which have image/graphics over the text and current solution fails in such case. I looked into Gfx and OutputDevice code and didn't reach a good workable solution for this case. I will be highly indebted if you can suggest some pointers.</div><div><br></div><div><b>Fonts:</b> Fonts are the biggest problem here. I saw that currently, it outputs all fonts as Times (default font), so I fixed that with exact font names (with tag coz multiple&nbsp;versions&nbsp;of a same fonts might be present in pdf). I also made non-horizontal text as part of image coz rotating the glyphs were not a very good idea to me seeing the time in hand. I am also able to extract font data but facing difficulties to extract encoding info like cmap etc. Your pointers on the same will be very much appreciated. FYI I am using fontforge to convert extracted fonts in a common format (ttf in my case). I am thing to apply cmaps using fontforge. Please let me know if you suggest otherwise.</div><div><br></div><div>I am waiting for a positive response from your side regarding the same. Looking forward for a strong technical relationship.</div><div><br clear="all">Regards,<br>Akash Agrawal<br><a href="http://tech-queries.blogspot.com/" target="_blank">http://tech-queries.blogspot.com/</a><br></div></div><br></span></body></html>