We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

itext, Java, html

flyfishin4trout
on
Medium Priority
2,164 Views
Last Modified: 2012-05-11
Hi,

I am using
org.xhtmlrenderer.pdf.ITextRenderer; to convert an html file to a pdf file

I have everything working except for a stylesheet property. I want to round the corners of <div> tags.

I am using the following which work in the browser but not when I convert to PDF
-moz-border-radius:25px; /* Firefox */
-webkit-border-radius:25px; /* Safari and chrome */
-khtml-border-radius:25px; /* Linux browsers */
border-radius:25px; /* CSS3 */
behavior:url(border-radius.htc); /* IE */

Attached is the html file and java source code.

Thanks!

FWI: I've done this with images but am trying it this way.
DataDictionary-Medications-Medic.html
transformHTMLtoPDF.java
Comment
Watch Question

Awarded 2011
Awarded 2011

Commented:

In your code  
transformXSD
is not recognized by my Java

I added

iText-2.1.7.jar
and core-renderer-R8pre.jar

 and it resolved all other symbols,
but not
 transformXSD

Where would I get this?

Author

Commented:
here it is
transformXSD.java
Awarded 2011
Awarded 2011

Commented:
Which versions of jars were you using?
It looks like I'm using someting incompatible
does not find the method on execution

Exception in thread "main" java.lang.NoSuchMethodError: com.lowagie.text.pdf.BaseFont.getCharBBox(C)[I

Author

Commented:
this is what is my CLASSPATH
.;C:\Program Files\Java\jdk1.6.0_22\lib\tools.jar;
C:\Program Files\Microsoft SQL Server JDBC Driver 3.0\sqljdbc_3.0\enu\sqljdbc4.jar;
C:\Program Files\Microsoft SQL Server JDBC Driver 3.0\sqljdbc_3.0\enu\sqljdbc.jar;
C:\Program Files\Java\jre6\lib\ext\QTJava.zip;
C:\Program Files\Java\Saxon9.3\saxon9he.jar;
C:\Program Files\Java\iText\iText-5.0.6.jar;
C:\Program Files\Java\iText\core-renderer.jar;
C:\Program Files\Java\iText\itext-paulo-155.jar;
Awarded 2011
Awarded 2011

Commented:
Anyway, it is probably useles, but I can't make it compile
when I use this early iText -2,1,7  it knows about this loawgie DocumentException
but has mismatch with some method
When I switch to 5.0.6 it cannot resolve this lowagie  exception
Don't know how you guys are doing that - mybe i need
different renderer.
Do you know from where this  loawagie.DocumentException comes from which jar?
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
itext's css support in html conversion is pretty poor and doesn't support things like rounded borders.
They are promising better support in the next version but not much you can do at the moment
Awarded 2011
Awarded 2011
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
objection is based on the fact that I already stated that rounded corners were not supported by itext

objects> itext's css support in html conversion is pretty poor and doesn't support things like rounded borders.

Author

Commented:
Points were awarded to the individual who provided support by replicating the process I used and informing me that images are needed.
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
> Points were awarded to the individual who provided support by replicating the process I used and informing me that images are needed.

there was no need to replicate, rounded rectangles are not supported in itext
points are awarded for answers, not for effort
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.