0

How to Export Timeline Component to PDF??

asked 2015-12-02 09:07:40 +0800

temp0225 gravatar image temp0225
1

updated 2015-12-02 10:01:36 +0800

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!!!!

delete flag offensive retag edit

Comments

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 )edit

But JFreeChart doesn't support Zk-Timeline-Component!!

temp0225 ( 2015-12-02 10:59:00 +0800 )edit

Temp, 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 )edit

Thanks....how can I share zip file to you??

temp0225 ( 2015-12-02 11:44:40 +0800 )edit

I 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

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-12-02 09:23:07 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

updated 2015-12-02 09:28:06 +0800

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.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-12-02 09:07:40 +0800

Seen: 30 times

Last updated: Dec 02 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More