Link to home
Start Free TrialLog in
Avatar of flyfishin4trout
flyfishin4trout

asked on

itext, Java, html

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
Avatar of for_yan
for_yan
Flag of United States of America image


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?
Avatar of flyfishin4trout
flyfishin4trout

ASKER

here it is
transformXSD.java
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

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;
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?
Avatar of Mick Barry
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
ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.

Points were awarded to the individual who provided support by replicating the process I used and informing me that images are needed.
> 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