• 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
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

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 !
 
Oh, sure, you could do that. Or you could eat some pie. While reading 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!