pdf-generation

iTextSharp for PDF - how add file attachments?

青春壹個敷衍的年華 提交于 2019-11-28 04:05:47
问题 I am using iTextSharp to create a PDF document in C#. I would like to attach another file to the PDF. I'm having just loads of trouble trying to do so. The examples here show some annotations, which apparently attachments are. This is what I've tried: writer.AddAnnotation(its.pdf.PdfAnnotation.CreateFileAttachment(writer, new iTextSharp.text.Rectangle(100,100,100,100), "File Attachment", its.pdf.PdfFileSpecification.FileExtern(writer, "C:\\test.xml"))); Well, what happens is it does add an

Open Source HTML to PDF Renderer with Full CSS Support [closed]

懵懂的女人 提交于 2019-11-28 03:38:50
I asked about getting iTextSharp to render a PDF from HTML and a CSS sheet before here but it seems like that may not be possible... So I guess I will have to try something else. Is there an open source .NET/C# library out there that can take HTML and CSS as input and render it correctly? I must reiterate... the library MUST be free and preferably something with a fairly liberal license. I'm working with basically no budget here. I've always used it on the command line and not as a library, but HTMLDOC gives me excellent results, and it handles at least some CSS (I couldn't easily see how much

ITextSharp PdfCopy use examples

偶尔善良 提交于 2019-11-28 03:26:39
问题 I am trying to use PdfSmartCopy from ItextSharp but I cannot find any relevant examples in c#. The ideea is that I have a pdf containing form fields and the fields add 700kb to the size of the pdf document. The original document without form fields was 100kb . Any other sugestions are welcome, especially o reduce the pdf size consistently. (I optimised the generated PDF with adobe acrobat, and it reduced it to 44kb . So there must be a glitch somewhere.) Is there any way to reduce the PDF

Merge PDF's with PDFTK with Bookmarks?

非 Y 不嫁゛ 提交于 2019-11-28 03:09:09
Using pdftk to merge multiple pdf's is working well. However, any easy way to make a bookmark for each pdf merged? I don't see anything on the pdftk docs regarding this so I don't think it's possible with pdftk. All of our files merged will be 1 page, so wondering if there's any other utility that can add in bookmarks afterwards? Or another linux based pdf utility that will allow to merge while specifying a bookmark for each individual pdf. Kurt Pfeifle You can also merge multiple PDFs with Ghostscript. The big advantage of this route is that a solution is easily scriptable, and it does not

XSL-FO fop. Long text flows into adjacent cells/block, obscuring stuff there

匆匆过客 提交于 2019-11-28 02:56:34
问题 Could anyone suggest me a way to make long words (like serial numbers) to be wrapped? I tried some commercial software and there is no such issue. Is it a fop bug or probably there is a solution available? I can't insert zero length space after each character of every word in document. This solution sounds insane for me. 回答1: You can specify the wrap-option attribute in your fo:block like so: <fo:block wrap-option="wrap"> ... stuff </fo:block> Here's the XSL-FO specification for this

PDF doc text shows differently in IE / Firefox / Chrome

微笑、不失礼 提交于 2019-11-28 02:09:59
问题 I try to produce a PDF text file with Hebrew text. I managed to produce a simple file. file is here The file opens in Adobe Acrobat Reader perfectly, showing the string "אאא ווו תתת". It opens perfectly also in IE. The problem is other viewers show it badly: Google Chrome / Google Docs show it without all "ו" occurances (that is, three letters "ו" disapear!) Mozilla Firefox show it very badly, showing some letters many times and in odd places on the page... What am I doing wrong?? What is

HTML Rendering with TCPDF(PHP)

假如想象 提交于 2019-11-28 01:51:55
问题 I am using TCPDF's writeHtml function for a page that renders properly in the browser. In the output PDF, the fonts are too small. I've tried with setFont, but it doesn't seem to have an effect. Does anyone have experience with this? I'd like to add here that the HTML is not always in my control, so I would prefer to do this with TCPDF options(and not by modifying the source html) UPDATE : I am able to change the font size by setting it on the body. The only remaining problem is that, to

Editable .pdf fields disappear (but visible on field focus) after save with evince

强颜欢笑 提交于 2019-11-28 01:48:29
问题 First off, let me thank the SO community for helping me so many times in the past; you guys are an amazing resource! At my job I work on a web application that uses PDF templates created in Scribus and the iText Java library to populate the templates with data from our database. Sometimes, a user-supplied field is required and not touched by iText. When the .pdf is downloaded, a field is edited, and a copy is saved with Evince the resulting file will not display the edited text upon reopen.

How to generate plain-text source-code PDF examples that work in a document viewer?

此生再无相见时 提交于 2019-11-28 01:39:07
问题 I just found the post Adobe Forums: Simple Text String Example in specification broken., so I got interested in finding plain-text source code PDF examples. So, through that post, I eventually found: The webpage PDF Reference and Adobe Extensions to the PDF Specification | Adobe Developer Connection ; which contains: The PDF Document Management – Portable Document Format – Part 1: PDF 1.7, First Edition (PDF32000_2008.pdf) The PDF 1.7 spec has on page 699 appendix "_Annex H (informative)

Adding metadata to PDF via PHP

一曲冷凌霜 提交于 2019-11-28 01:34:50
问题 I need to augment a PDF with a custom metadata field on download in PHP (5.3). I have been looking at the pdftk library, but I can't get my head around how I would get PHP to interface with it on our (Ubuntu) web server. The deprecated PDFInfo library seems like a dead end. Is there a simpler/easier/better solution? Thanks 回答1: You could use Zend_Pdf. It's from the Zend Framework but can be used as a standalone component. Adding metadata is as easy as: $pdf = Zend_Pdf::load($pdfPath); $pdf-