• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1904
  • Last Modified:

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
0
flyfishin4trout
Asked:
flyfishin4trout
  • 4
  • 3
  • 3
1 Solution
 
for_yanCommented:

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?
0
 
flyfishin4troutAuthor Commented:
here it is
transformXSD.java
0
 
for_yanCommented:
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

0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
flyfishin4troutAuthor 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;
0
 
for_yanCommented:
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?
0
 
objectsCommented:
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
0
 
for_yanCommented:
OK, I finally found the problem - I needed this iText-paulo-155.jar

So I created PDF and first could not understand what you are talking about,
 because my IE 6 obviously does not support css  to that level just as iText.
So PDF file which I created and the HTML page in IE 6 look identical.
It is only when I went to FireFox, when I saw the rounded angles
of this National label.
So I guess you have to go with images if you want
everyone to see it rounded - both in PDF and in old browsers.



0
 
objectsCommented:
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.

0
 
flyfishin4troutAuthor Commented:
Points were awarded to the individual who provided support by replicating the process I used and informing me that images are needed.
0
 
objectsCommented:
> 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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 4
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now