pdf-generation

Directly convert .aspx to .pdf [closed]

好久不见. 提交于 2019-12-17 06:07:07
问题 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 . A project I am working on requires me to build a report that is output in both HTML (.aspx) and as a PDF. Is there a solution

django - pisa : adding images to PDF output

萝らか妹 提交于 2019-12-17 05:50:11
问题 I'm using a standard example from the web (http://www.20seven.org/journal/2008/11/pdf-generation-with-pisa-in-django.html) to convert a django view / template into a PDF. Is there an "easy" way to include images (either from a url or a reference on the server) in the template so they will show on the PDF? 回答1: I got the images working. the code is as follows: from django.http import HttpResponse from django.template.loader import render_to_string from django.template import RequestContext

Python PDF library [closed]

。_饼干妹妹 提交于 2019-12-17 04:46:38
问题 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 7 years ago . What Python PDF libraries are there? I need to make some PDF with many grids, and I'm looking for a library that allows to manage

Converting HTML to PDF using PHP? [duplicate]

倾然丶 夕夏残阳落幕 提交于 2019-12-17 03:52:17
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Convert HTML + CSS to PDF with PHP? Is it possible to convert a HTML page to PDF using PHP, and if so, how can it be done? Specifically, the page is an invoice generated dynamically. So I would like it loaded using: http://example.com/invoices/3333 And the HTML output would have to be converted to PDF. Any good libraries that do this will be fine. 回答1: If you wish to create a pdf from php, pdflib will help you

ITextSharp insert text to an existing pdf

不打扰是莪最后的温柔 提交于 2019-12-17 02:33:31
问题 The title sums it all. I want to add a text to an existing PDF file using iTextSharp, however i can't find how to do it anywhere in the web... PS: I cannot use PDF forms. 回答1: I found a way to do it (dont know if it is the best but it works) string oldFile = "oldFile.pdf"; string newFile = "newFile.pdf"; // open the reader PdfReader reader = new PdfReader(oldFile); Rectangle size = reader.GetPageSizeWithRotation(1); Document document = new Document(size); // open the writer FileStream fs =

Using iTextPDF to trim a page's whitespace

帅比萌擦擦* 提交于 2019-12-17 02:26:00
问题 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

Can I replicate the table header when a table keep on in more pages?

蹲街弑〆低调 提交于 2019-12-16 18:03:38
问题 I have the following situation creating a PDF with iTextSharp. I have some pages that contains some tables. It could be happen that a table begin in a page and keep on in the following page. I want to know if, when a table keep on in the following page, is it possible to "replicate" the table header in the new page. For example if a table begin in the page 1 and keep on in the table 2 I want have the following situation: The table begin with its header in page 1 and keep on in page 2 so at

set barcode 128 to type B in java

只谈情不闲聊 提交于 2019-12-14 04:22:33
问题 I am using this code to generate barcode128 : String stb1 = "123456789"; code128.setCode(stb1); //code128.setCodeType(Barcode128.CODE128_UCC); //code128.setCode("1234567890"); code128.setStartStopText(true); Image image128 = code128.createImageWithBarcode(cbd, null, Color.white); image128.setAbsolutePosition(20 + x, 626 + y); image128.scaleAbsolute(109, 33); document.add(image128); My client want the barcode 128 type B. How to set it to type B? I tried CODE128_UCC , CODE128_RAW , CODE128 in

Creating read only pdf file using Python

我是研究僧i 提交于 2019-12-14 04:19:50
问题 Is there any python module using that we can create a new pdf file or modify the existing pdf file which have only read permission. I want to disable the "Save as" and "Save as to other formats" for the pdf file.(DRM things.) 回答1: I'm not sure this is portable, but you could use os.chmod: import os from stat import S_IREAD, S_IRGRP, S_IROTH filename = "yourfile.pdf" # Open the file and write your stuff to the file etc... os.chmod(filename, S_IREAD|S_IRGRP|S_IROTH) Thanks to: Change file to

What to use to generate pdf documents that will incorporate dynamically generated barcodes (Java)?

笑着哭i 提交于 2019-12-14 04:19:06
问题 My requirements ask for generating pdf documents that contain both arbitrary text and barcodes. I have related question that addresses pdf generation part, but here I'd like to know about how to incorporate barcode in pdf in Java. So far, I've found clear explanation on how barcode4j does it with Apache FOP: Instructions for the Apache FOP extension But it looks that XSL-FO is not primary option for my requirements as I prefer to go with pdf forms (using iText or PDFBox or similar). Again,