pdf-generation

Header in PDF page using DOMPDF in PHP

假装没事ソ 提交于 2019-12-27 17:01:11
问题 I am creating a PDF file using DOMPDF. I have a big content to extract in PDF, we need some header in all the pages. So can anyone telme how to add a header and footer in the PDF so that the header will shown in all the pages using DOMPDF. 回答1: In the 0.6.0 code you will be able to use HTML+CSS to generate headers and footers. There are a few limitations when compared to using inline PHP (e.g. no PAGE_COUNT placeholder yet), so whether or not this is viable depends on your needs. The

Header in PDF page using DOMPDF in PHP

空扰寡人 提交于 2019-12-27 17:01:05
问题 I am creating a PDF file using DOMPDF. I have a big content to extract in PDF, we need some header in all the pages. So can anyone telme how to add a header and footer in the PDF so that the header will shown in all the pages using DOMPDF. 回答1: In the 0.6.0 code you will be able to use HTML+CSS to generate headers and footers. There are a few limitations when compared to using inline PHP (e.g. no PAGE_COUNT placeholder yet), so whether or not this is viable depends on your needs. The

Store combined pdf combined by combine_pdf gem

被刻印的时光 ゝ 提交于 2019-12-25 18:49:10
问题 I have combined two pdf files as follows pdf = CombinePDF.new pdf << CombinePDF.parse(Net::HTTP.get_response(URI.parse(@task.assignable.pdf_file.try(:file).try(:url))).body, allow_optional_content: true) pdf << CombinePDF.load(file1_path) # one way to combine, very fast. pdf.save "combined.pdf" I can check and see my combined file by downloading as follows: send_data pdf.to_pdf, filename: "combined.pdf", type: "application/pdf" This all working fine but I want to store this pdf in @signed_pdf

How to get ordered list into pdf using itext?

半世苍凉 提交于 2019-12-25 17:03:14
问题 I have to get an ordered list into pdf.The data stored is in html format.When exporting to pdf using itextsharp,the ol-li tags should be replaced by an ordered list. 回答1: You'll want to use iTextSharp's iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList() method. Below is a full working sample WinForms app targeting iTextSharp 5.1.1.0 that does what you're looking for. See the inline comments for what's going on. using System; using System.Collections.Generic; using System.Linq; using

getBytes() doesn't work for Cyrillic letters

爷,独闯天下 提交于 2019-12-25 16:19:14
问题 I found some answers but none of them works for me. I want to make a pdf file from a html, but the problem is that my html has Cyrilic letters and I found that there's something to do with this simple code: String s = "Здраво Kris"; byte bytes[] = s.getBytes("UTF-8"); String value = new String(bytes, "ISO-8859-1"); // I tried with new String(bytes, "UTF-8") but it didn't work Then I pass the value to my pdf generator function but it outputs only the part from the string s that is not in

PDF Annotation not visible on Image using pdfbox API

旧时模样 提交于 2019-12-25 12:59:04
问题 I have text annotation on my pdf but when I am converting pdf to image file using pdfbox api, annotation disappears(not visible on image). I have searched for couple of forums but I did not get accurate answer of this question. for (int page = 0; page < document.getNumberOfPages(); ++page) { BufferedImage bim = pdfRenderer.renderImageWithDPI(page,70,ImageType.RGB); // suffix in filename will be used as the file format ImageIOUtil.writeImage(bim, pdfFullPath + "-" + (page+1) + ".png", 70); }

Reuse electron session with nightmare

守給你的承諾、 提交于 2019-12-25 11:53:11
问题 I am using Nightmare.js to print pdf's. I send a request to the node server and build the page, using Nightmare to ensure the page has loaded, then print a pdf. But for each request I create a new electron window, how do I reuse the same window, or a pool of max X electron windows, to handle my pdf printing? var nightmare = require('nightmare'), http = require('http'); function createPage(o, final) { var page = nightmare() .goto('file:\\\\' + __dirname + '\\index.html'); .wait(function () {

Add alternative text for an image in Tagged PDF in C#

一个人想着一个人 提交于 2019-12-25 09:44:40
问题 I need your help with this: public void manipulatePdf(String src, String dest) throws IOException, DocumentException { PdfReader reader = new PdfReader(src); PdfDictionary catalog = reader.getCatalog(); PdfDictionary structTreeRoot = catalog.getAsDict(PdfName.STRUCTTREEROOT); manipulate(structTreeRoot); PdfStamper stamper = new PdfStamper( reader, new FileOutputStream(dest)); stamper.close(); } public void manipulate(PdfDictionary element) { if (element == null) return; if (PdfName.FIGURE

Output a Document (preferably a PDF) from Python

自闭症网瘾萝莉.ら 提交于 2019-12-25 09:18:03
问题 I've got a Python script (3.5) that will go through a whole battery of tests. The user gets to select which tests get run out of N possible tests. So, the user could run 1 tests up to N tests. Right now, I'm just outputting the results of the test to a plot with matplotlib and that looks OK, but they're just saved as individual files. Also, the code has some PASS/FAIL criteria for each test. So, the issue is, I would like to use some tool with Python to output the whole story of the test

Export multiple charts and tables into 1 PDF

∥☆過路亽.° 提交于 2019-12-25 07:47:45
问题 I'm looking for 2 JS libraries for generating charts and PDFs. I've already tested some, but none of them has satisfied my needs so far. Background: I need to create several independent charts and tables in order to export all of them afterwards into 1 PDF . What I already tried: I have already tested highcharts and amcharts, but they don't seem to work the way I need them. highcharts offers the possibility to create a chart and a table, showing the same data. So same input visualized