pdf-generation

Converting HTML to PDF (not PDF to HTML) using PHP [closed]

為{幸葍}努か 提交于 2019-11-26 12:26:31
问题 I am a PHP developer and in one of my projects, I need to convert some HTML documents (about 30 to 50 pages) into PDF documents. My search has turned up the following possible solutions. Among them are some PHP libraries and some command line applications. Each has its own advantages and disadvantages. PHP libraries: fpdf (need more effort to convert) tcpdf (need more effort to convert) html2fpdf http://html2fpdf.sourceforge.net html2pdf http://html2pdf.fr/ dompdf http://code.google.com/p

PDF Generation Library for Java [closed]

岁酱吖の 提交于 2019-11-26 12:04:07
问题 I know this has been asked before, but I\'m still undecided on which PDF generation framework to use for my current project. My requirements on-the-fly generation of PDF documents (mainly order forms, invoices) Java based easy to layout should be open source easy to change layout A lot of people seem to use iText , but I have some concerns (apart from the changed licence) regarding separation of concerns: In an HTML context there\'s good MVC support, where I usually stick to Spring MVC and

Using iTextPDF to trim a page's whitespace

≯℡__Kan透↙ 提交于 2019-11-26 11:56:22
I have a pdf which comprises of some data, followed by some whitespace. I don't know how large the data is, but I'd like to trim off the whitespace following the data PdfReader reader = new PdfReader(PDFLOCATION); Rectangle rect = new Rectangle(700, 2000); Document document = new Document(rect); PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(SAVELCATION)); document.open(); int n = reader.getNumberOfPages(); PdfImportedPage page; for (int i = 1; i <= n; i++) { document.newPage(); page = writer.getImportedPage(reader, i); Image instance = Image.getInstance(page);

HTML to PDF with Node.js

大憨熊 提交于 2019-11-26 11:45:40
问题 I\'m looking to create a printable pdf version of my website webpages. Something like express.render() only render the page as pdf Does anyone know a node module that does that ? If not, how would you go about implementing one ? I\'ve seen some methods talk about using headless browser like phantom.js , but not sure whats the flow. 回答1: Extending upon Mustafa's answer. A) Install http://phantomjs.org/ and then B) install the phantom node module https://github.com/amir20/phantomjs-node C) Here

How can I serve a PDF to a browser without storing a file on the server side?

故事扮演 提交于 2019-11-26 11:38:15
问题 I have two methods. One that generates a PDF at the server side and another that downloads the PDF at the client side. How can i do this without storing it in the Server side and allow the client side to directly download this. The Following are the two methods: public void downloadPDF(HttpServletRequest request, HttpServletResponse response) throws IOException{ response.setContentType(\"application/pdf\"); response.setHeader(\"Content-disposition\",\"attachment;filename=\"+ \"testPDF.pdf\");

How to fill out a pdf file programatically? [closed]

对着背影说爱祢 提交于 2019-11-26 11:34:57
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . What techniques available to fill a pdf form automatically using external data and save them. I have to use data from a database to

How can I export report to PDF/A-1a, PDF/A-1b?

白昼怎懂夜的黑 提交于 2019-11-26 11:24:07
问题 Generating PDF/A in jasper-report, contains numerous pitfalls and is not supported in some versions of jasper-report. This is why I have decided to pass this Q uestion- A nswer post, indicating the steps and library version necessary to export a simple report with a graph to PDF/A Sample data (usersRep.csv) +----------------+--------+ | User | Rep | +----------------+--------+ | Jon Skeet | 854503 | | Darin Dimitrov | 652133 | | BalusC | 639753 | | Hans Passant | 616871 | | Me | 5640 | +-----

Convert all sheets to PDF with Google Apps Script

你。 提交于 2019-11-26 11:15:33
问题 I\'m trying to convert a Google spreadsheet with multiple sheets to a PDF file. The script below works, but it only creates a PDF with the last page of the spreadsheet. function savePDFs() { SpreadsheetApp.flush(); var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheets = ss.getSheets(); var url = ss.getUrl(); //remove the trailing \'edit\' from the url url = url.replace(/edit$/,\'\'); //additional parameters for exporting the sheet as a pdf var url_ext = \'export?exportFormat=pdf&format

Convert Word doc, docx and Excel xls, xlsx to PDF with PHP

纵饮孤独 提交于 2019-11-26 11:14:29
I am looking for a way to convert Word and Excel files to PDF using PHP. The reason for this, is I need to be able to combine files of various formats into one document. I know that if I am able to convert everything to PDF I can then merge the PDFs into one file using PDFMerger (which uses fpdf). I am already able to create PDFs from other file types / images, but am stuck with Word Docs. (I think I would possibly be able to convert the Excel files using the PHPExcel library that I already use to create Excel files from html code). I do not use the Zend Framework, so am hoping that someone

Unicode in PDF

ぃ、小莉子 提交于 2019-11-26 11:06:44
问题 My program generates relatively simple PDF documents on request, but I\'m having trouble with unicode characters, like kanji or odd math symbols. To write a normal string in PDF, you place it in brackets: (something) There is also the option to escape a character with octal codes: (\\527) but this only goes up to 512 characters. How do you encode or escape higher characters? I\'ve seen references to byte streams and hex-encoded strings, but none of the references I\'ve read seem to be willing