pdf-generation

Relative paths in Flying Saucer XHTML?

戏子无情 提交于 2020-01-31 08:43:10
问题 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 create Header in PDF generation using C# iText7

随声附和 提交于 2020-01-25 06:56:10
问题 I tried to add Header in all the pages of my PDF using iText package in .NET C#, but it's not working. Note: I'm using iText version 7 I tried the following Stack Overflow answers, they demonstrated only for Footer (i.e., END_PAGE ) not for START_PAGE Add Header and Footer for PDF using iTextsharp My Code : class Program { static void Main(string[] args) { var writer = new PdfWriter("E:/pdfSample/bala.pdf"); var pdf = new PdfDocument(writer); var document = new Document(pdf,PageSize.A4);

Error converting HTML text to a pdf file using itextsharp in asp.net

吃可爱长大的小学妹 提交于 2020-01-24 14:41:09
问题 I am using the following code to convert contents in Editor(Ajax control) to pdf, using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.IO; using iTextSharp.text.html.simpleparser; using iTextSharp.text; using iTextSharp.text.pdf; using iTextSharp.text.html; /// <summary> /// Summary description for pdfgeneration /// </summary> public class pdfgeneration { public pdfgeneration() { // // TODO: Add constructor logic here // } public void pdfgenerator

Ruby library for manipulating existing PDF [closed]

谁说胖子不能爱 提交于 2020-01-24 12:26:52
问题 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 6 years ago . I'm searching for a library to edit already existing PDF's and add a watermark to each page, for example. Could also be blank every other page etc. There seem to be a few PDF libraries out there, but only very few of them can edit existing PDF's and I'm a bit lost on which way to go. Any recommendations? Thank

Itext 7 - PdfReader is not opened with owner password Error

家住魔仙堡 提交于 2020-01-24 12:10:08
问题 I am using This example for the latest Itext7 to fill in a document and I am getting this error: iText.Kernel.Crypto.BadPasswordException: PdfReader is not opened with owner password So I looked around the net I found that some people found solution to this error using PdfReader.unethicalreading = true; but when I try to use this same code it says there is no definition in PDFReader named unethicalreading Here is the Code I have: string src = @"C:\test1.pdf"; string dest = @"C:\Test2.pdf";

Setting the background color of a contentbyte itextsharp

三世轮回 提交于 2020-01-24 00:02:27
问题 MVC3 VB.NET application using Itextsharp. I have a section of code that generates a pdf file everything looks great but I would like to alternate the line colors in that pdf file between 2 color so that the values are easy to follow for the person looking at it. Is there a way to set the background color of a whole line based on font size to a set color? A function I would be using this in is below: For Each _reg_ In _reg Dim _registrant As reg_info = _reg_ If y_line1 <= 30 Then doc.NewPage()

online pdf generation

泪湿孤枕 提交于 2020-01-23 19:22:57
问题 I'm looking to create PDF files instantly online given user input in my html/php page. are there any FREE API's out there that will allow me to do this? 回答1: various options, here are a couple: Prince XML wkhtmltopdf TCPDF HTML2PDF PDF converter PDFSharp pdflib formatter coverters 回答2: Php uses the PDFlib library, it has a lot of pdf functions, check it out here http://php.net/manual/en/book.pdf.php 回答3: You could probably use pdflib 回答4: Hi You have two or three approaches: 1) If you can

How to set the background color for every page tcpdf

懵懂的女人 提交于 2020-01-23 08:14:34
问题 I'm currently using TCPDF to generate a resume in my web application. But with the limited support for css have cornered me. Now I'm trying to apply the background color for the every page that is generated. But I'm only getting the color for the first page. My code is: <?php class PROFILE_PDF extends TCPDF { public function Header() { $this->SetFillColor(52, 21, 0, 76); $this->Rect(0, 0, $this->getPageWidth(), $this->getPageHeight(), 'DF', ""); } private $footer_data = array(); public

How to set the background color for every page tcpdf

雨燕双飞 提交于 2020-01-23 08:14:23
问题 I'm currently using TCPDF to generate a resume in my web application. But with the limited support for css have cornered me. Now I'm trying to apply the background color for the every page that is generated. But I'm only getting the color for the first page. My code is: <?php class PROFILE_PDF extends TCPDF { public function Header() { $this->SetFillColor(52, 21, 0, 76); $this->Rect(0, 0, $this->getPageWidth(), $this->getPageHeight(), 'DF', ""); } private $footer_data = array(); public

How to reduce the size of the PDF generated by tesseract?

北战南征 提交于 2020-01-22 20:48:06
问题 The setup of my (web) app is the following: I get user uploaded PDF files, I run OCR on them and show them the OCRed PDF. Since everything is online, the minimizing the size of the resulting PDF file is key to reduce loading and wait time for the user. The file I receive from the user is sample.pdf (I've created an archive with the original files as well as those that I generate here: https://dl.dropboxusercontent.com/u/1390155/tess-files/sample.zip). I use tesseract 3.04 and do the following