p:dataexporter columns with images - pdf

I want to export a datatable (with p:graphicImages in columns) in PrimeFaces but even in the new version of PrimeFaces I can only see the alt: value of image in my PDF file. Can't I export graphicImage itself?
It's also asked in this link comment #3.

No you can't, not without extending the exporter

I can give you two ideas of how I got to put in a pdf images:
1. Use a printer (), then print it to pdf and you're done. You will have your table with the pretty images.
2. Generate the PDF using iText and you can personalize it as far as you want.

Related

Generation pdf truncated

I have to transform a HTML badly built in PDF.
I transformed the HTML file into XTML with the class Tidy.
Then, generated my PDF with XMLWorkerHelper.
It's work but the generated PDF is not correct.
The images are missing and the text is truncated on certain files.
What specific configuration may I use to solve this problem?
It is the first time when I use these class and it's not easy.
Thanks for your help
I have files html badly constituted to transform into PDF.
I thus used at first Tidy to format them in XHTML and then XMLWorkerHelper to generate the pdf.
I've used itextpdf-5.4.2 xmlworker-5.4.2 .
PdfWriter writer = PdfWriter.getInstance(documentPDF, new FileOutputStream(pdfFilename));
documentPDF.open();
XMLWorkerHelper.getInstance().parseXHtml(writer, documentPDF, new FileInputStream(HTMLFileName));
I can't post my file, it's too big.

Gujarati fonts not displaying in PDF properly using itext 5.5.5 and xmlworker 5.5.5

I am using arial .ttf file. I have tried different font file for gujarati such as lohit, padmaa, shruti but it not displaying properly. The characters are not getting substituted properly.
In PDF it displays as :
અરથ પરજ ડરમ વૈભવ સવગે
Originally it should display as:
અર્થ પ્રજા ડ્રમ વૈભવ સ્વર્ગે
I have tried using GlyphSubstitutionTableReader but its not working for me.
Please guide me. Thanks in advance.
iText 5 currently doesn't support any Brahmic scripts. The reason is that these require an implementation of a specific font table called GSUB, which simply isn't there yet. There is no way to get this to display correctly with iText 5.5.5, but anyone is welcome to try and implement it.

Exporting map from TileMill to PDF/SVG

I have such a big problem with exporting and importing map from TileMill to Illustrator/Inkscape. The problem is with strokes of labels / names.
It seems that TileMill export each letter of label as a separate expanded path–object and doing an outline of that. The result is very bad. Take a look: http://cl.ly/image/0Z2o2v3v2r2C
Do you have any ideas how to fix it? Or maybe there is a solution to create a working text path in Illustrator from that kind of object?
This is unfortunately an upstream bug in Mapnik, and upstream from there in the raw SVG rendering libraries it uses.

How to configure ZeroClipboard for pdf generation?

I am using Datatable Tools to export some table to PDF but I am getting error while exporting the data. The error says
This instance of ZeroClipboard is not configured for PDF export. Please use the PDF export version.
Anyone knows how I can configure ZeroClipboard.js so I can get PDF?
Any help would be appreciated!
Based on your question, I assume you have it working and its displayed properly on the DataTable. I had the same problem recently and the fix was fairly easy, all I had to do was change the location of the swf file to the PDF one. Below is an example.
"sDom": '<"clear">lfrtipT',
"oTableTools": {
"sSwfPath": "/js/DataTables-1.9.4/extras/TableTools-2.0.0/media/swf/copy_cvs_xls_pdf.swf"
}
Normally the default import is just "copy_cvs_xls.swf". The other file should be in the same location, check it out and import it instead.

How to create pdf file from Qt application?

In my Qt application I am conducting some network tests. I have to create a report according to the test output. So I need to create the report in pdf format.
Can anybody please let me know how I can put my test results in a pdf file? My result contains graphs using the Qwt library.
this code outputs pdf from html:
QTextDocument doc;
doc.setHtml("<h1>hello, I'm an head</h1>");
QPrinter printer;
printer.setOutputFileName("c:\\temp\\file.pdf");
printer.setOutputFormat(QPrinter::PdfFormat);
doc.print(&printer);
printer.newPage();
I guess you can generate an html wrapper for your img and quickly print your image. Otherwise you might copy the image directly on the printer, since it is a paint device in a similar fashion
QPrinter printer;
QPainter painter(&printer);
printer.setOutputFileName("c:\\temp\\file.pdf");
printer.setOutputFormat(QPrinter::PdfFormat);
painter.drawImage(QRect(0,0,100,100), <QImage loaded from your file>);
printer.newPage();