• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Html to PDF in Java

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic