pdf-generation

TCPDF list item margin

瘦欲@ 提交于 2019-12-05 19:57:31
Couldn't find it anywhere. Having list: <ol> <li>Foo</li> <li>Bar</li> <li>Baz</li> </ol> and CSS: ul li, ol li{ margin-bottom: 10px; } While previewing list in browser, margin-bottom is interpreted correctly. Unfortunately, TCPDF somehow doesn't recognize this style (while recognizing other parts of included css file). Is there any trick/hack to make it work? tcpdf allows to define the vertical spaces for HTML tags, see Method setHtmlVSpace of TCPDF Class Documentation , use: $pdf->setHtmlVSpace(array( 'li' => array( 'h' => 5, // margin in mm ) )); The name of the html-Element is the key (li)

pdfkit not rendering correctly in rails 3.1

自作多情 提交于 2019-12-05 19:48:47
I have followed the following railscast about adding pdfkit to an application, and I am having some issues with the generation of pdfs. Here are the following things that I have done: I downloaded wkhtmltopdf via the homebrew package manager brew install wkhtmltopdf Then I added the pdfkit gem to my gemfile and ran the bundle install command. I added the following to my config/application.rb file require 'pdfkit' ... config.middleware.use PDFKit::Middleware, :print_media_type => true I then changed my application layout file to include all stylesheet types. If I run rake middleware, the

Displaying a pdf to webpage using iTextSharp?

我怕爱的太早我们不能终老 提交于 2019-12-05 19:31:10
I am generating a pdf using iTextSharp. I would like to display it on the webpage and let the user save it from the online pdf viewer. dynamicpdf has a drawtoweb() method, but it is not free to use and I cannot find the same functionality using iTextSharp. How can I display the pdf? string newFile = "Pdf Document.pdf"; Document doc = new Document(); PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(newFile, FileMode.Create)); doc.AddCreator("Myself"); doc.AddTitle("Sample PDF Document"); doc.Open(); doc.Add(new Paragraph("Hello, World!")); doc.Close(); Daniel Hilgarth Is there a

Border around the page in PDF with MPDF

删除回忆录丶 提交于 2019-12-05 19:26:21
I have an html page that has borders around, but when I use the MPDF, he breaks a div and not puts border above or down of the broken div, does anyone know how to fix it, or let each page with border around? Perhaps you could try a hack using watermarks: http://www.olivettorestaurante.com.br/mpdf/examples/example35_watermarks.php A full page square image used as watermark could work. I know, a bit triky, but sometimes MPDF turns weird when facing some problems... :/ A better answerd would be wellcome. Here is the sampl code available in the MPDF examples directory, related to watermarks: <?php

VBA to save a sheet to a password protected PDF

血红的双手。 提交于 2019-12-05 19:24:49
The following saves the activesheet as a PDF: ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:="C:\blahblah2.pdf", _ Quality:=xlQualityStandard, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False I need to be able to create a password protected PDF - is this possible using VBA without buying any additional software? I used PDFsharp using VS - my project is in C# ... this free library works very well 来源: https://stackoverflow.com/questions/12373631/vba-to-save-a-sheet-to-a-password-protected-pdf

How to write content into pdf use iText?

谁说我不能喝 提交于 2019-12-05 18:17:53
Right now i use iText to generate a pdf automatically. And my problem is that when the content is really very large, i need to calculate the content's height and width, and then add new page... this is really very inconvinent. so I wonder whether or not there is a method like: Document.add("a very very large article"); and after this , it will auto generate a pdf file ???? Thanks in advance ! The following creates a 9 page pdf without having to calculate height and width. import java.io.FileOutputStream; import java.io.IOException; import com.lowagie.text.Document; import com.lowagie.text

Image auto resizes in PdfPCell with iTextSharp

跟風遠走 提交于 2019-12-05 18:08:08
问题 I'm having a weird problem with images in iTextSharp library. I'm adding the image to the PdfPCell and for some reason it gets scaled up. How do i keep it to original size? I though that the images would be same when printed but the difference on the pic is the same on the printed version. Having to manually scale the image with ScaleXXX to get it to right seems a bit illogical and does not give a good result. So how do I put the image in its original size inside a PdfPCell of a table without

C# html to pdf converter using wkhtmltopdf or any other free tools [closed]

ⅰ亾dé卋堺 提交于 2019-12-05 17:50:19
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . What is the perfect tool for converting html to pdf in C# ?? I have found wkhtmltopdf through stackoverflow.com . But its not working . showing this message in time of converting "www.google.com" in command line. C:\Program Files\wkhtmltopdf>wkhtmltoimage.exe www.google.com go.pdf Loading page (1/2) Rendering (2/2) Error: Could not save image Done I have also downloaded EO.pdf , but not sure how to use it

Using PHP to create a PDF from a mix of plain text and HTML text [duplicate]

喜欢而已 提交于 2019-12-05 16:56:45
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Convert HTML + CSS to PDF with PHP? I have a form with 5 fields, two of which are textboxes extended with tinyMCE, the rest are simple inputs of type text. I need to generate a PDF from this input. I understand that I can use Zend_Pdf to generate the PDF and include the plain text data. But how, for example, can I include a bulleted list from the tinyMCE fields? Would the best way be to create an HTML file, and

Generate PDF file with Zend Framework 2 [closed]

≯℡__Kan透↙ 提交于 2019-12-05 14:31:19
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm started to learn ZF2 right now and notice that there's no "Zend_Pdf" or similar on zend framework 2... How can I create pdf on this version of the framework? Anyone knows a good tutorial? Zend Framework 2 has moved many of the old Zend Framework libraries out of the main core and created modules instead. Zend_Pdf is one of the libraries that was moved to a module. You can find them all in the Zend Framework