pdf-generation

iTextSharp fields rename does not work with Merge

不羁岁月 提交于 2019-12-07 20:16:36
问题 This is a follow up to another question I had earlier, after the merge of PDF files with form fields worked successfully, if fields with same names do appear then they are not getting their distinct values from their original documents, it looks like a field with the same name propagate its values to the following fields which have the same name. This is the code to merge and rename in 2 separate functions: public byte[] MergeFiles(IList<DBForms> forms) { if (forms.Count < 1) return null;

Setting the background color of a contentbyte itextsharp

旧时模样 提交于 2019-12-07 17:38:32
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() _Page = _Page + 1 y_line1 = 670 End If If y_line1 = 670 Then cb.BeginText() cb.SetFontAndSize(BF_Times

VBA to save a sheet to a password protected PDF

会有一股神秘感。 提交于 2019-12-07 17:00:41
问题 The following saves the activesheet as a PDF: ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:="C:\blahblah2.pdf", _ Quality:=xlQualityStandard, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False I need to be able to create a password protected PDF - is this possible using VBA without buying any additional software? 回答1: I used PDFsharp using VS - my project is in C# ... this free library works very well 来源: https://stackoverflow.com/questions/12373631/vba-to-save-a-sheet-to-a

Border around the page in PDF with MPDF

北慕城南 提交于 2019-12-07 14:44:07
问题 I have an html page that has borders around, but when I use the MPDF, he breaks a div and not puts border above or down of the broken div, does anyone know how to fix it, or let each page with border around? 回答1: Perhaps you could try a hack using watermarks: http://www.olivettorestaurante.com.br/mpdf/examples/example35_watermarks.php A full page square image used as watermark could work. I know, a bit triky, but sometimes MPDF turns weird when facing some problems... :/ A better answerd

Free PDF writer for Windows 8 Metro Apps [closed]

六月ゝ 毕业季﹏ 提交于 2019-12-07 13:55: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 7 years ago . Is there any PDF writer for Windows 8 / Metro Application? I am developing a Windows 8 App and looking for a library that can generate

embaded images are breaked between pdf pages in flaying-saucer

别来无恙 提交于 2019-12-07 13:30:37
问题 I have some problem with images (all images are embedded in html as base64 strings). I use css img {page-break-inside: avoid;} and it helps but not always. In some cases the same image can be processed correctly where in other situation is divided between pages. It depends form many factors, examples: image is assigned as block element previous images are or are not block elements there is some big image before divided one I also noticed that if the problem occurred at least once than all

PDFKit, nodeJS merging two PDF files

隐身守侯 提交于 2019-12-07 12:22:57
问题 does anyone have experience with PDFKit with NodeJS. Specifically, I'm trying to merge 2 PDF documents into 1, but I can't seem seem to get the content of the two PDFs properly with formatting inside the merged one. Here's what I do: var PDFDocument = require('pdfkit'); var fs = require('fs'); var doc = new PDFDocument(); var fileName = 'test.pdf'; doc.pipe(fs.createWriteStream(fileName)); var file1 = '1.pdf'; var file2 = '2.pdf'; var stream1 = fs.createReadStream(file1); doc.text(stream1);

iTextSharp - Use Colspan with PdfPRow

六月ゝ 毕业季﹏ 提交于 2019-12-07 06:43:04
问题 I am able to create multiple rows if they contain the same number of columns: table = new PdfPTable(3); var firstRowCell1 = new PdfPCell( new Phrase ("Row 1 - Column 1")); var firstRowCell2 = new PdfPCell( new Phrase ("Row 2 - Column 2")); var firstRowCell3 = new PdfPCell( new Phrase ("Row 3 - Column 3")); PdfPCell[] row1Cells = { firstRowCell1, firstLineRow2, firstRowCell3 }; var row1 = new PdfPRow(row1Cells); table.Rows.Add(row1); var nextRowCell1 = new PdfPCell( new Phrase ("Row 2 - Column

Wicked pdf not rendering header/footer

元气小坏坏 提交于 2019-12-07 06:28:50
问题 I am using wicked_pdf for generating pdf from html on my rails project. It is rendering template but I could not manage to print header/footer sections. Below is my code that print only template section render pdf: "pdf_name", layout: 'application', template: 'reports/show', formats: [:html], margin: { top: 10, bottom: 10, left: 10, right: 10 }, disable_javascript: true, show_as_html: params[:debug], header: { html: { template: 'shared/header' }, spacing: 10 }, footer: { html: { template:

R: monte carlo integration using Importance Sampling

徘徊边缘 提交于 2019-12-07 06:19:55
问题 I have an integral to evaluate "x^(-0.5)" ; x in [0.01,1] for which I am using Importance Sampling MC : The theory says that an approximate PDF has to be used to compute the expected value (which will almost surely converge to the mean - value of the integral) After plotting the given integral, and exponential PDF, based only on the plots, I chose the rexp and dexp to generate the PDF - and my code looks like this - #Without Importance Sampling set.seed(1909) X <- runif(1000,0.01,1) Y <- X^(