Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

flying saucer not converting cellspacing html property properly into pdf

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using flying saucer for converting html into pdf and for that I used

StringBuffer buf = new StringBuffer();
buf.append("<html xmlns='http://www.w3.org/1999/xhtml'>");
buf.append("<head>");
buf.append("<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />");
buf.append("<link rel='stylesheet' type='text/css' href='css/style_pdf1.css' title='style'");
buf.append(" media='print' />");
buf.append("</head>");
buf.append("<body>");
.....
....

and then

DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
ITextRenderer renderer = new ITextRenderer();
renderer.setDocument(builder.parse(new InputSource(new StringReader(buf.toString()))), null);
String outputFile = "ppt.pdf";
OutputStream os = new FileOutputStream(outputFile);
renderer.layout();
renderer.createPDF(os);
os.close();

but
flying saucer not converting cellspacing html property properly into pdf ,any suggestion please !
 
How do they get the deer to cross at the signs? Or to read this tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!