0

I am building a PDF report with data retrieved from a database.

Some data contains HTML content , especially base 64 images.

While using XMLWorkerHelper.ParseToElementList am facing some issue.

So looked around a bit and found some fixes here, but non of it mentioned how to parse it to element list.

Can you please help me with my code.

<img title=\"Call: ********\" class=\"fr - draggable fr - dii\" style=\"border: currentColor; border - image: none; left: 0px; top: 0px; width: 16px; height: 16px; right: 0px; bottom: 0px; white - space: nowrap; src =\"data: image / png; base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8 / 9hAAABcklEQVR4XpXTPUvDUBTH4aR2c2hBQXGpTiIORhBcBOvgYKf0Awi + 4Ggr1MVPIIrYdnEpShddHIyLi6AVXVxsRRDRwbi4KNgu4lCIv8i / i6QRDzycy + 09555LqOl5nhEUptPoJe1iDHU8oYlrlDw79m4QEbSLPexzsIc8hDRm8YBjLpj4q8EgxQdab + MNd4ghhQ2adIc1 + ORAFEnWWfTDRp7GDfImlsIavKALLuqoqMGUCs4wHtagiQ5uc8kDyCOBKlP1k78QNTOZnMXCQRxWsbjl6iuskV41SQG2Gj9rikvcR1WcgKFDBa1LOEUK56hqv8BUFV3SGWkVS9JQ6Dsv4wQ1DKMPORUvkm78BhdQMI1CTa5I0yrcwSFqFD + SZ7DQesIkCG5S / JpkHYERQRmuNsrZ7Grc + Ef8 / Bcoslkfae8Wc7CUHZ++TuAEBj86pHntjaDKXllPy6PW / gkKFaThwp / K87N8hDcQTTKKFTioSxqB8Q2BNX5JtAljwgAAAABJRU5ErkJggg == \"/>";
JustBaron
  • 2,319
  • 7
  • 25
  • 37
Akhil CS
  • 1
  • 2
  • Yes, it can, but you need to do more programming. That's why it is recommended to upgrade from XML Worker to pdfHTML: https://developers.itextpdf.com/content/itext-7-converting-html-pdf-pdfhtml/chapter-7-frequently-asked-questions-about-pdfhtml/can-pdfhtml-render-base64-images-pdf – Bruno Lowagie Sep 11 '17 at 10:08
  • @BrunoLowagie I have already done a lot of work in XMLWorker so changing would be a bit of trouble. Can you please provide the way to do this in XMLWorker ? Thank you – Akhil CS Sep 11 '17 at 10:16
  • See my second comment. Maybe I should have closed this question as a duplicate, so that it was more clear that I already provided a way to do this in XML Worker. – Bruno Lowagie Sep 11 '17 at 10:25
  • @BrunoLowagie Yes I saw that , but in my code it is like : list = XMLWorkerHelper.ParseToElementList(html, CSS); In this code how can I call the custom image provider ? – Akhil CS Sep 11 '17 at 10:27
  • Er... it seems that you haven't done much work yet with XML Worker after all, otherwise you surely would have known about the `ElementHandlerPipeline`. See the [ParseHtmlObject](https://developers.itextpdf.com/examples/xml-worker-itext5/xml-worker-examples#718-d11_parsehtmlobjects.java) example. Or see [How to convert an HTML table to PDF?](https://developers.itextpdf.com/de/node/2077) – Bruno Lowagie Sep 11 '17 at 10:35
  • @BrunoLowagie Thanks a lot it worked :) – Akhil CS Sep 11 '17 at 11:14

0 Answers0