-
FEATURED COMPONENTS
First time here? Check out the FAQ!
As I have mentioned above I need a information regarding Export Timeline Component to pdf. As for as I know only Mesh and Tree Components are possible to Export to pdf. Plz help me regarding this issue.
Hey Thank you!!! But my problem is I don't want only String content.I want charts also in PDF.So I am trying to pass complete component to PDF. That is not happening. If I use IText it exports only String content not the charts.Hope you understood my problem.
Thanks again!!!!
Everything is possible to export to PDF.
You could use basic IText(is in Exporter project also used).
First of all you create a class where you create your PDF document.
In the constructor you could give the data needed to create the class.
This will contain a method like this :
public byte[] createDocument(ByteArrayOutputStream out) throws DocumentException, IOException {
Document document = createDocument();
pdfWriter = PdfWriter.getInstance(document, out);
document.open();
createDocument(document);
document.close();
return out.toByteArray();
}
protected Document createDocument() {
return new Document(PageSize.LETTER.rotate());
}
protected void createDocument(Document document) throws DocumentException {
//example code :
PdfPTable table = new PdfPTable(1);
PdfPCell cell = new PdfPCell(new Phrase(" "));
document.add(table);
}
and in the viewmodel you need to give the PDF to the client :
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
Filedownload.save(report.createDocument(out), null, "someName.pdf");
}
Greetz chill.
Asked: 2015-12-02 09:07:40 +0800
Seen: 30 times
Last updated: Dec 02 '15
http://viralpatel.net/blogs/generate-pie-chart-bar-graph-in-pdf-using-itext-jfreechart/ You need your data to the class, not the component.
chillworld ( 2015-12-02 10:36:39 +0800 )editBut JFreeChart doesn't support Zk-Timeline-Component!!
temp0225 ( 2015-12-02 10:59:00 +0800 )editTemp, you have to write it for your own...(What I already tried to tell you)... If you want it, you could create a project like zk exporter for zk timeline and share with us.
chillworld ( 2015-12-02 11:05:22 +0800 )editThanks....how can I share zip file to you??
temp0225 ( 2015-12-02 11:44:40 +0800 )editI think you misunderstand it, I'm not going to write it for you, when you are finished you could, if you want, share your knowledge with us.
chillworld ( 2015-12-02 12:10:53 +0800 )edit