pdf-generation

iPad App: Merge PDF files into 1 PDF document / Create PDF Document of multi-page scrollview

陌路散爱 提交于 2019-12-03 14:15:40
问题 I am writing an iPad application which uses a scrollview with page control. I need to create a PDF of all the pages as 1 PDF file. So far, I figured that I should loop through all the sub-views (pages) and create PDF files for each (using CGPDFContext). BUT I do need to combine all the files into 1 PDF document. Can you help me to do so?? OR if you have a better way to create a PDF document with multiple pages from this scrollview, that would even be better!! Please help. I've searched

Relative paths in Flying Saucer XHTML?

≡放荡痞女 提交于 2019-12-03 14:14:07
I am using Flying Saucer to render some PDF documents from strings to XHTML. My code is something like: iTextRenderer.setDocument(documentGenerator.generate(xhtmlDocumentAsString)); iTextRenderer.layout(); iTextRenderer.createPDF(outputStream); What I'm trying to understand is, when using this method, where are relative paths in the XHTML resolved from? For example, for images or stylesheets. I am able to use this method to successfully generate a text-based document, but I need to understand how to reference my images and CSS. The setDocument() method takes two parameters: document and url.

Add table into existing PDF using iTExtsharp

落花浮王杯 提交于 2019-12-03 13:54:28
I have one PDF in that there is one table that table is dynamic and I want to add another table below to that table dynamically in my existing PDF. Is there any way to add the table in existing PDF at specific place that existing table(that is not at the end of document) is completed then I want to add my table. How can I add? Please suggest me some good way. As you can see below image. Thanks, using iTextSharp.text; using iTextSharp.text.pdf; /// Function which will create pdf document and save in the server folder private void ExportDataToPDFTable() { Document doc = new Document(iTextSharp

Lock PDF against editing using iTextSharp

ε祈祈猫儿з 提交于 2019-12-03 13:38:36
问题 I've created a C# program using iTextSharp for reading a PDF, appending social DRM content and then saving the file. How do I lock this new PDF against further editing? I want the user to be able to view the file without entering a password and I don't mind select/copy operations but I do mind the ability to remove the social DRM. 回答1: Encrypt your PDF document. Simple HTTP Handler working example to get you started: <%@ WebHandler Language="C#" Class="lockPdf" %> using System; using System

Displaying SVG using XSLFO

有些话、适合烂在心里 提交于 2019-12-03 13:27:39
First question from me; I'm currently fixing a graphing service that uses XSLFO to convert our syntax to FO, and converting it to PDF in the end. Previously we've been using PNG graphs from the web in the PDF exports, but this creates really ugly results, so we've decided to go with SVG for PDF instead. However, the SVG doesn't seem to scale into the SVG canvas properly. Here is the syntax before run into XSLFO: <img src="someimage.svg"> And here is the XSLFO I'm using: <xsl:template match="img"> <fo:block space-after="12pt"> <fo:instream-foreign-object width="20cm" height="15cm" content-width

R markdown PDF: Temporarily hide spoiler code for quiz takers

余生颓废 提交于 2019-12-03 12:45:13
I am using R markdown to create a PDF R course. I want to insert a quiz like the following: --- output: pdf_document --- What is the class of the following R object? 1. `pi` ```{r} class(pi) ``` Which, as expected, creates a PDF with this content: However, I would like the reader to not have such an easy access to the answer. These are the ideas I've had so far to achieve this: Paint the answer and code white, so the reader would have to select the text to see the answer; Include a tooltip that would work on mouse over question. Flush the answer to the end of the document; Setting the answer

Generate pdf files phantomjs, repeating HEADER

久未见 提交于 2019-12-03 12:32:32
问题 I'm generating pdf files using phantomjs but I would like to repeat a defined header with HTML, it works when there are no images but as soon I add it doesn't work page.viewportSize = { width: 600, height: 600 }; page.paperSize = { format: 'A4', orientation: 'portrait', margin: '0px', header: { height: "1.2cm", contents: phantom.callback(function(pageNum, numPages) { return '<img src="https://www.google.com.bo/images/srpr/logo4w.png" height="0.95cm"/>'; }) }, footer: { height: "0.7cm",

Add image in header using html-pdf node module

让人想犯罪 __ 提交于 2019-12-03 12:17:18
I am using this to convert the html to PDF.The conversions are really good.But the problem is to add header and footer in the PDF pages.In the options if i add the header text i got the result what i expected. //Options var options = { "header": { "height": "45mm", "contents": "<div style='text-align: center;'>Author: Marc Bachmann</div>" // If i add image in content it wont work // sample i tried }, "footer": { "height": "28mm", "contents": "<span style='color: #444;'>{{page}}</span>/<span>{{pages}}</span>" } } // Tried this in contents <img src="image path" /> var result = <div class=

How to produce documents (docx or pdf) from SQL Server?

别等时光非礼了梦想. 提交于 2019-12-03 11:07:11
I know this is a little subjective, but I'm looking into the following situation: I need to produce a number of documents automatically from data in a SQL Server database. There will be an MVC3 app sat on the database to allow data entry etc. and (probably) a "Go" button to produce the documents. There needs to be some business logic about how these documents are created, named and stored (e.g. "Parent" documents get one name and go in one folder, "Child" documents get a computed name and go in a sub-folder. The documents can either be PDF or Doc(x) (or even both), as long as the output can be

Exporting Google Sheet as PDF with Custom Headers or Footers in Google Apps Script

落爺英雄遲暮 提交于 2019-12-03 09:57:26
问题 I'm wondering how to add custom headers or footers to a PDF that is exported using Google Apps Script from a Google Sheet. I would like to add a footer that says "My Company Proprietary and Confidential" in the center of the page. This is functionality that is available in normal PDF export from Sheets (i.e. File » Download as » PDF » Headers & footers » EDIT CUSTOM FIELDS), but I don't know how to replicate it with URL parameters. I've also tried setting '&sheetnames=true&printtitle=true' ,