pdf-generation

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

蹲街弑〆低调 提交于 2019-11-29 08:15:29
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) Example PDF files"; and from there, I wanted to try "H.3 Simple Text String Example" (the "classic Hello

HTML Rendering with TCPDF(PHP)

自作多情 提交于 2019-11-29 08:09:33
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 render correctly in the browser, it needs to be 12px. To render correctly in the PDF, it needs be something

How to export table displayed on jsp to pdf in java strust2

徘徊边缘 提交于 2019-11-29 08:08:06
This is my data display in table format. I want to show as it is in PDF without using display tag library of struts2. <table border="1" align="center" style="border-color: #CCCCCC; border-width: 1px; border-style: None; width: 1320px; border-collapse: collapse;" id="tablepaging"> <tbody> <tr> <td>Leave ID</td> <td>FROM DATE</td> <td>TO DATE</td> <td>DAYS REQUESTED</td> <td>APPROVER</td> <td>NOTES</td> <td>REMARK</td> <td>IS PLANNED</td> <td>REASON</td> </tr> <tr> <td>270</td> <td>12/27/12</td> <td>12/29/12</td> <td>2</td> <td>Sagar</td> <td>s</td> <td>s</td> <td>true</td> <td>s</td> <td> <a

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

人走茶凉 提交于 2019-11-29 07:57:12
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. However, upon focus of an edited field it will show the saved text. Unfocus, text disappears. Cut the

Create pdf file in Asp.net

五迷三道 提交于 2019-11-29 07:53:55
string s=" Name nnnn Age dd </tr> </table>" I need to convert this string to a pdf file.Can anybody help me for doing this? iTextSharp - Introducing Tables The .NET framework does not contain any native way to work with PDF files. So, if you want to generate or work with PDF files as part of your ASP.NET web application, you will have to rely on one of the many third party components that are available. Google will help you to find one that fits your budget, as well as a range of open-source free components. One of the free components is iTextSharp, which is a port of a well known Java utility

Adding metadata to PDF via PHP

[亡魂溺海] 提交于 2019-11-29 07:38:49
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 Gordon 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->properties['Title'] = 'New Title.'; $pdf->save($pdfPath); 来源: https://stackoverflow.com/questions

wkhtmltopdf failure when embed an SVG

谁说我不能喝 提交于 2019-11-29 05:47:13
Has anyone in this vast space has ever had the luck to successfully create a PDF with an embedded SVG on an HTML? I've been receiving segmentation fault all the time. Or perhaps is there any other way to embed an SVG into an HTML file and then export it to PDF instead of wkhtmltopdf ? Yuriy Chemerys I had similar problem. Seems like javascript embedded in SVG image can cause segmentation fault. I was generating SVG graphs using pygal Python module. To successfully generate PDF from HTML with SVG graphs I had to do several things: Remove reference to javascript. (In case of pygal add js=() key

How to generate PDF from markdown using pure ruby

不打扰是莪最后的温柔 提交于 2019-11-29 05:20:06
问题 I'm currently using Kramdown to generate HTML from Markdown in Ruby. I know that I can generate a latex file using kramdown and convert it to pdf usaing a command line utility. But I want a pure ruby solution. Is there a way to convert markdown to pdf using only ruby without using command-line utilities? 回答1: You can use https://github.com/walle/gimli I made it just for this purpose. Though, I use textile. But gimli supports all formats supported by GitHub-Markup. 回答2: Prawn: The Pure Ruby

Programmatically provide a filepath as input file for “Microsoft Print to PDF” printer

◇◆丶佛笑我妖孽 提交于 2019-11-29 05:08:04
Desired result I want to print a file to a new PDF using the Windows 10 printer "Microsoft Print to PDF" which is installed by default. When you select this printer as your default printer and use your context menu on a file and select Print , it only asks for a save directory and name. After that, it immediately converts to PDF and saves the file. As long as MS Office is installed, this works for Word, Excel, PowerPoint file types. But also for common image types and normal text files. I'd like to automate this by providing a default path. What I already tried Stackoverflow already has this

Displaying headers and footers in a PDF generated by Rotativa

筅森魡賤 提交于 2019-11-29 04:37:53
I'm trying to specify headers and footers in a PDF generated by Rotativa library. As the author answered here it should be possible using CSS (described here ). However, I'm not able to do this. I have a stylesheet loaded in the meta tag: <link href="print.css" rel="stylesheet" type="text/css" media="print" /> And in the stylesheet at the bottom: @page { @top-left { content: "TOP SECRET"; color: red } @bottom-right { content: counter(page); font-style: italic } } And then generating PDF by: public ActionResult ShowPdf() { var model = new Model(); return new ViewAsPdf("view.cshtml", model) {