pdf-generation

I can't insert something as “Page X of Y” into my PDF footer using iTextSharp

穿精又带淫゛_ 提交于 2019-12-02 09:47:35
问题 I am pretty new in iTextSharp and I have the following situation: I am creating a PDF that contains an header and a footer (for the header and footer creation I am using a class that extends PdfPageEventHelper and I have override the OnStartPage() and the OnEndPage() method, it work fine). Now my problem is that I have to insert as Page X of Y into my footer. Where X**is the **current page number and Y is the total page number . The value of Y is not fixed (because the length of my PDF is not

Get the whole page as a PDF [closed]

﹥>﹥吖頭↗ 提交于 2019-12-02 09:41:41
Question: I want a button on my page on clicking which the whole content of the page is saved in the form of pdf. Queries: So any one has any idea that, is there any library or assembly or any piece of code that can provide me with this feature? Thanks in advance body part <asp:PlaceHolder ID="PlaceholderPdf" runat="server"> <asp:Label ID="Label1" runat="server" Text="hi hw r u ...i m fine wht about u"></asp:Label> </asp:PlaceHolder> <asp:Button ID="Button2" runat="server" onclick="Button2_Click1" Text="converting to pdf" /> download itextsharp.dll some necessary name space are using

How to set the position of an image in reportlab using pdfrw?

陌路散爱 提交于 2019-12-02 08:56:25
问题 I'm using reportlab to generate reports. I can define the creation process in four steps: 1) get the data via API, 2) filter the data, 3) generate the graphics with matplotlib and 4) insert information in PDF with reportlab . I found in this (thanks Patrick Maupin!) and in this (thanks Larry Meyn!) answer a flowable matplotlib for ReportLab . I made some changes and I copy below the part of the code that interests: import os from matplotlib import pyplot as plt from matplotlib.backends

iTextSharp: Why when adding a image to a pdf page the text font is different?

老子叫甜甜 提交于 2019-12-02 08:51:55
I use Helvetica font and 14 px size for text. The problem is that if a page does not have any image on it the text is very clear, but in a page with at least 1 image the text is getting a little bold. You can see what I mean in images below: * Without image on page * With image on page The correct font is the one that appear in picture #1. How to make all pages have the same font even if the page contains an image or not? Thanks. Sample code: Document document = new Document(PageSize.LETTER); document.SetMargins(docMargin, docMargin, docMargin, 25); writer = PdfWriter.GetInstance(document, new

PowerBuilder 12.5 Classic PDF SaveAs creating files of 0 size on Win7 x64

断了今生、忘了曾经 提交于 2019-12-02 08:23:50
问题 Platform: Windows 7 x64 PB 12.5 Classic Ghostscript 9.07 (both x32 and x64 are installed) HP Laserjet PS printer installed as "Sybase DataWindow PS" Datawindow's Data Export tab has Format to configure: PDF and Method: Distill . Both the checkboxes "Distill custom postscript" and "Print using XSLFOP" are unchecked. I click File | Run/Preview and File | Save Rows As and select PDF as save as type and enter a pdf file name and click on Save. It says in a message box that Save Rows As failed . I

iTextSharp adding new instances of an existing page

北城以北 提交于 2019-12-02 08:07:03
Let's say I have a three page PDF and all three of them have AcroFields. I need to be able to generate a new PDF with page 2 repeated N number of times. Each new instance of page 2 will need to have the field names modified to make them distinct from the other instances of page 2. Can someone who's solved this problem before provide a syntax example? This is explained in the MergeForms2 example. You should split your document into 3 documents each having one page. Use the renameFields() method to create variations of the second page. Concatenating forms is done like this: Document document =

How to set the position of an image in reportlab using pdfrw?

為{幸葍}努か 提交于 2019-12-02 08:05:45
I'm using reportlab to generate reports. I can define the creation process in four steps: 1) get the data via API, 2) filter the data, 3) generate the graphics with matplotlib and 4) insert information in PDF with reportlab . I found in this (thanks Patrick Maupin !) and in this (thanks Larry Meyn !) answer a flowable matplotlib for ReportLab . I made some changes and I copy below the part of the code that interests: import os from matplotlib import pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from reportlab.platypus import Paragraph, SimpleDocTemplate, Flowable from

TCPDF remote image loading problem

[亡魂溺海] 提交于 2019-12-02 07:46:57
Im trying to load a remote image into a pdf generated by tcpdf however I can't seem to get it to work? The rest of the pdf loads fine and it looks like to trying to retrieve the image however it just does print to the page? The code I am using is: $pdf->Image("http://media.domain.com/logo.jpg", 0, 0, 100, 150, 'JPEG', '', 'T', true, 72,'','','','','','',''); Any help on this would be a massive help, Thanks, I think you need to set allow_url_fopen = On in php.ini It works for me $pdf->Image('http://chart.apis.google.com/chart?cht=ls&chd=t:1366,1459,2534,2551,2589&chco=76A4FB&chls=2.0,0.0,0.0

Javascript to automatically supply password

六月ゝ 毕业季﹏ 提交于 2019-12-02 07:43:38
I have an application that displays password protected PDFs using iTextSharp. pdfCopy.SetEncryption(true, "Secretinfo", "Secretinfo", 0); If the user saves the PDF, the saved copy of the PDF is password protected. Which is great. The problem is it also prompts for password before displaying the PDF on the browser. Which isn't good. So I'm thinking maybe it's possible to supply the password using javascript just to display it on the browser. It's bad practice but I don't see that I have any other choice. I'm no good at JavaScript. Maybe someone here can help me? But hey if you have another idea

How to give width, height, x and y coordinates in generating pdf from html using JSPDF new html API

和自甴很熟 提交于 2019-12-02 07:21:25
I have been using JSPDF to generate pdf document based on some html. Earlier using jspdf fromHTML Api, we could give margins like this var margins2 = { top: 415, bottom: 10, left: 55, width: 300 }; doc.fromHTML(reactListContent, margins2.left, margins2.top, { 'width': margins2.width, 'elementHandlers': specialElementHandlers }, margins2); But, in the new .html API , how can i provide margins, width and height. The new API is like var pdf = new jsPDF('p', 'pt', 'letter'); pdf.html(document.getElementById('html'), { callback: function (pdf) { console.log("how to get margins"); } }); If you look