pdf-generation

BadPasswordException when filling out pdf with iTextSharp

我与影子孤独终老i 提交于 2019-12-04 04:02:16
I have a third-party PDF file with some form fields, that I need to fill out programmatically. PDF file is secured. Detailed security settings: SecurityMethod: Password Security, Document Open Password: No, ... Form Field Fill-in or Signing: Allowed... When I'm trying to open and fill out the document manually, everything is ok, and I'm not asked for any password. But with the code, it fails with exception. Here's the code (I'm using iTextSharp library): var str = new MemoryStream(); var reader = new PdfReader(_path); var stamper = new PdfStamper(reader, str); Creating the PdfStamper object

Generate a PDF logbook from git commits

筅森魡賤 提交于 2019-12-04 03:33:18
I know that I am able to view previous commits in various ways using git log but I was wondering if anybody here could recommend some good tools for creating a PDF or HTML logbook from git commits. I was hoping I would be able to generate something similar to the style of Github commit logs but with different info. If people don't have any ideas on programs to generate these logs, what are their thoughts or recommendations if I attempt to make my own generator? Since the project is due quite soon i just wrote up a quick script myself to output a log the way i want to, it just scrapes the data

How to create a iTextSharp.text.Image object startng to a System.Drawing.Bitmap object?

有些话、适合烂在心里 提交于 2019-12-04 02:59:05
问题 I am pretty new in iTextSharp (the C# version of iText ): I have something like this: System.Drawing.Bitmap bitmap = (System.Drawing.Bitmap)ChartHelper.GetPdfChart((int)currentVuln.UrgencyRating * 10); iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(bitmap); vulnerabilityDetailsTable.AddCell(new PdfPCell(img) { Border = PdfPCell.RIGHT_BORDER, BorderColor = new BaseColor(79, 129, 189), BorderWidth = 1, Padding = 5, MinimumHeight = 30, PaddingTop = 10 }); As you can see I have

Dowloading multiple PDF files from javascript

感情迁移 提交于 2019-12-04 02:32:53
问题 I have a gridview in which I have one column for downloading pdf files for each row. I fire a javascript function which uses "window.location.href" to create and download PDF file from another page. Now on Clientclick of some button ,I am calling a javascript function in which a for loop reads each line of gridview and fire click event (of the button which i used in grid to download PDF) for downloading multiple PDF files at once for all the rows. By using this technique I am only getting PDF

Plotting and saving PDFs in a loop

半世苍凉 提交于 2019-12-04 02:20:10
问题 I have a semi-melted data frame that looks like this: head(final_melt) Group Source variable value Control Whole Kidney MZF1 0.23879 Control Whole Kidney MZF1 0.49381 Control Whole Kidney MZF1 0.40827 Control Whole Kidney MZF1 0.55548 Control Whole Kidney MZF1 0.34664 Control Whole Kidney MZF1 0.68102 Group has two levels (Control and Disease), source has 4 levels (Whole Kidney, Glomerulus, Tubulointerstitium, and HK-2 + TGF-B). variable also has four levels (TFAP2A, MZF1, YY1, SP1). I would

Use of relative path for anchor method using iText for pdf Generation

天涯浪子 提交于 2019-12-04 02:20:00
问题 I am using iText for PDF generation and I create an anchor using the following code: String newPath = "file:///"; newPath = newPath + completePath; trial.setAnchor(newPath); The trial object is of type Chunk and completePath is the path to the file I want a link to. When I try to use a relative path, the link doesn't work. For instance "C:\Doc\folder1\trial.xml" works fine but when I try relative paths such as "..\trial1.xml" there is no link being formed, although both my PDF document and

Add text to existing PDF document in Python

浪子不回头ぞ 提交于 2019-12-04 02:08:34
I'm trying to convert a pdf to the same size as my pdf which is an A4 page. convert my_pdf.pdf -density 300x300 -page A4 my_png.png The resulting png file, however, is 595px × 842px which should be the resolution at 72 dpi. I was thinking of using PIL to write some text on some of the pdf fields and convert it back to PDF. But currently the image is coming out wrong. Edit: I was approaching the problem from the wrong angle. The correct approach didn't include imagemagick at all. agf You should look at Add text to Existing PDF using Python and also Python as PDF Editing and Processing Framework

How to Set Document Orientation (for All Pages) in MigraDoc Library?

我们两清 提交于 2019-12-04 01:13:20
问题 I'm using MigraDoc to programatically generate a PDF file with text, images and tables. I need to set Document Orientation (for all pages) in the document object to Landscape . So I tried the following. document.DefaultPageSetup.Orientation = Orientation.Landscape; But I get the following debug assertion error. --------------------------- Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue --------------------------- DefaultPageSetup must not be modified If I click Ignore , it goes

How can you find a problem with a programmatically generated PDF? [closed]

笑着哭i 提交于 2019-12-04 00:17:35
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . My group has been using the itext-sharp library and C#/.NET to generate custom, dynamic PDFs. For the most part, this process is working great for our needs. The one problem we can run into during development/testing is layout issues which can cause the PDF to not open/render correctly in Adobe Reader, esp. the newer versions of Acrobat/Reader. The document will open the display correctly for the first

Python configure pdfkit on windows

醉酒当歌 提交于 2019-12-03 22:58:50
I started to learn python recently and I want to convert existing html file to pdf file. It is very strange, but pdfkit seems to be the only lib for pdf docs for python. import pdfkit pdfkit.from_file("C:\\Users\\user\Desktop\\table.html", "out.pdf") An error occurs: OSError: No wkhtmltopdf executable found: "b''" How to configure this lib properly on windows to make it work? I can't get it :( It looks like you need to install wkhtmltopdf. For windows, the installer can be found at https://wkhtmltopdf.org/downloads.html Also check out a post by this guy, who is having the same problem: Can't