• Post Reply Bookmark Topic Watch Topic
  • New Topic

Html to PDF in Java  RSS feed

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all...

I have to "convert" an html file to a PFD file.

I have tried a lot of code to obtain this result, but every time I have to convert an img tag (html) to an image (into the pdf document), I have an exception (file name too long).

The img tag looks like this:

<img alt="" src=" data:image/png;base64, aiushdasybasuydboasuybdcoausydbcoasuydbvoauybadvouysdb..............."

with almost 500 charafter the encoding instruction (base64)....

How can I convert this kind of img tag into a valid image into my pdf file?

TY and BR,

Adriano.
 
Adriano Bellavita
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all...

I have found a way...

The char sequence is the base64 encodeing of the image I have to insert into the pdf file.



ENCODED_STRING is the string between img tags... In this way, I can obtain the image...

But I need a set of APIs that can obtain this result, I can't parse html manually...

Any ideas?
 
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure what it the exact question. Do you only want to parse the input html and retrieve the contents of the image tag?
 
Adriano Bellavita
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to parse an html file to obtain a pdf file.

But I have problems when parsing the img tags like the abovementioned.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!