pdf-generation

Fastest PDF generation in PHP?

↘锁芯ラ 提交于 2019-12-01 01:44:31
问题 I'm attempting to generate some reports dynamically, very simple HTML tables with borders. I've tried TCPDF and it renders up to 400 rows just fine but anything more than that (about 20 pages) it can't handle it. DOMPDF can't even do that. These reports can be thousands of rows. Any idea on a faster library or a better plan of attack? 回答1: Try php-wkhtml2x php extension. It uses popular web engine webkit(Chrome and Safari uses that) 回答2: I use the FPDF library, the output is fast and resource

How to force a Save As dialog when streaming a PDF attachment

橙三吉。 提交于 2019-12-01 01:38:00
I am using the following code to stream a pdf to the browser: header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Pragma: public"); header("Content-type:application/pdf"); header("Content-Disposition:attachment;filename=file.pdf"); echo $pdf; Works fine, except (in Chrome anyhow) it just saves the file "file.pdf" - it does not prompt a Save As dialog so I can rename the file, if I choose. I suspect this may be one of those browser-dependent things, but is it possible to force a Save As dialog with the php headers when streaming a pdf for download? Thanks (in advance)

Create PDF from a PNG image Or Java Panel

与世无争的帅哥 提交于 2019-12-01 01:18:32
I'm looking for a Java library that will can take a Image (PNG) and create a PDF. Or Create the PDF directly from a java panel that has been drawn. You can achieve this using Gnostice PDFOne for Java ( http://www.gnostice.com/PDFOne_Java.asp ). Find below the code snippet that creates a PDF document from a PNG image. PdfDocument doc = new PdfDocument(); // Read the image as BufferedImage object BufferedImage bufImg = ImageIO.read(new File( "SampleImage.PNG")); // Create PdfImage object using the above BufferedImage object PdfImage img = PdfImage.create(bufImg); // Create a PdfPage of image

How to add text object to existing pdf

岁酱吖の 提交于 2019-12-01 00:50:10
I have a source pdf which I am modifying by adding text objects. I am using "Incremental Updates" which is mentioned in the PDF specification. But while adding text objects using this method I am making some mistakes due to which the pdf doesn't render properly in Adobe Reader 11. When the pdf is opened and I double-click on it, the added text objects get deleted. I figured out that this is due to text annotation. Now I want to know how a new text object can be added using incremental update? How do the Contents and RC of a free text annotation have to be to maintained? Also is it possible to

How to create PDF reports using PL/SQL

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 00:49:49
Is there PL/SQL package or engine available which would enable the creation of PDF reports from stored procedures? If your looking for a freeware or open source package, their is this. I've not used it, but it has good reviews. lPL_FPDF If you have a budget, then this, which enterprise class product, meaning excellent documentation, is available. plpdf . The commercial package is written in native Pl/SQL so will be very easy to use. The open source package I don't know. If your running in an Oracle environment, with any of the reports servers, then all of then support PDF being emitted both to

Why doesnt Acrobat Distiller embed all fonts fully?

自闭症网瘾萝莉.ら 提交于 2019-12-01 00:17:18
When I use Acrobat Distiller (v.9.1.3), it seems that I cannot embed all fonts -- at least not in the way I want to (no subsetting). One example is Wingdings (TrueType). I activated the tickboxes and settings to "Always embed" and "No subsetting" . If I check in a text editor the *.joboptions file that I saved as my custom Distiller profile it clearly says: /EmbedAllFonts true /EmbedOpenType true /MaxSubsetPct 1 /SubsetFonts false Some fonts Distiller does embed fully (as requested by me), others not. If I change the setting to do font subsetting, this works with all fonts. Therefore I think

ITextPdf: Printing Arabic strings from Right To Left (RTL)

ぃ、小莉子 提交于 2019-12-01 00:01:20
I use iTextpdf on java in order to generate stamped PDFs, sometimes the generated PDF is in Arabic and I am facing a funny problem. To let the Arabic page being created from Right To Left (RTL) I use tables and cells which have the property PdfPCell.setRunDirection(PdfWriter.RUN_DIRECTION_RTL) . When I use this property Arabic does not show at all, if I avoid the call to this property Arabic strings are correctly showed, this means I shouldn't have problems with fonts and I don't really know if this is an issue with iText or I'm just missing something. Here a small piece of code which shows an

iTextSharp: table in landscape

微笑、不失礼 提交于 2019-11-30 23:25:09
I'm using iTextSharp to generate a large document. In this document I want some specific pages in landscape. All the rest is portrait. Does anyone know how I can do this? Starting a new document is not an option. Thanks! You can set the document size and it will affect the next pages. Some snippets: Set up your document somewhere (you know that already): var document = new Document(); PdfWriter pdfWriter = PdfWriter.GetInstance( document, new FileStream(destinationFile, FileMode.Create) ); pdfWriter.SetFullCompression(); pdfWriter.StrictImageSequence = true; pdfWriter.SetLinearPageMode(); Now

MemoryStream, Cannot access a closed stream

筅森魡賤 提交于 2019-11-30 22:33:47
问题 With the sharpPDF library I generate a pdf memory stream, and I want to send it directly via email. But the line ms.Seek(.... gives an ObjectDisposedException; Cannot access a closed Stream. The pdf.CreatePDF method takes either an (output) fileName string, or an (out)Stream. But I guess it also closes the stream? I'm not used to work much with streams, so if you could please advise how it should be done? The sharpPDF source code of the CreatePDF method can be found here: http://www.java2s

How do I draw graphics to PDF using iText?

99封情书 提交于 2019-11-30 22:26:31
I am trying to complete an example that draws graphics and writes them to PDF, but I keep getting errors that the PDF has no pages. if I add something simple with document.add() after opening it works fine, I just never see the graphics. Here is my code: Document document = new Document(); PdfWriter writer = new PdfWriter(); response.setContentType("application/pdf"); response.setHeader("Content-Disposition", " attachment; filename=\"Design.pdf\""); writer = PdfWriter.getInstance(document, response.getOutputStream()); document.open(); PdfContentByte cb = writer.getDirectContent(); Graphics2D