pdf-generation

iTextSharp generate PDF and show it on the browser directly

99封情书 提交于 2020-01-21 08:40:07
问题 How to open the PDF file after created using iTextSharp on ASP.Net? I don't want to save it on the server, but directly when the new PDF is generated, it shows on the browser . Is it possible to do that? Here is the example for what I mean: Click here . But on this example, the file directly downloaded. How can I do that? Dim doc1 = New Document() 'use a variable to let my code fit across the page... Dim path As String = Server.MapPath("PDFs") PdfWriter.GetInstance(doc1, New FileStream(path &

display pdf in browser using itext

僤鯓⒐⒋嵵緔 提交于 2020-01-17 15:43:37
问题 i have modify a pdf with itext using pdfstamper. my application now create and save a new pdf file. i want to dipslay the pdf directly in the browser. Here my actual code public static void test07(){ try{ PdfReader reader = new PdfReader("c:\\temp\\file.pdf"); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("c:\\temp\\new.pdf")); AcroFields form = stamper.getAcroFields(); //fill the fields stamper.close(); reader.close(); } catch (Exception e){ e.printStackTrace(); } } The

display pdf in browser using itext

余生颓废 提交于 2020-01-17 15:41:07
问题 i have modify a pdf with itext using pdfstamper. my application now create and save a new pdf file. i want to dipslay the pdf directly in the browser. Here my actual code public static void test07(){ try{ PdfReader reader = new PdfReader("c:\\temp\\file.pdf"); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("c:\\temp\\new.pdf")); AcroFields form = stamper.getAcroFields(); //fill the fields stamper.close(); reader.close(); } catch (Exception e){ e.printStackTrace(); } } The

SpraedPDFGeneratorBundle : Generate PDF with CSS

别等时光非礼了梦想. 提交于 2020-01-17 04:19:09
问题 I'm trying to generate a PDF document from a Twig HTML Page using SpraedPDFGeneratorBundle, but the problem is that my stylesheet is not supported. Somewhere I followed this question : Generate PDF with CSS and Images and I I tried to do like that: <link rel="stylesheet" href="{{ app.request.scheme ~'://'~ app.request.httpHost ~ asset('css/bootstrap.min.css') }}" /> But I'm getting an error: The exit status code '1' says something went wrong: stderr: "Exception in thread "main" java.lang

How to get jasperreport file (.JRXML) exact location to load to the system?

半世苍凉 提交于 2020-01-16 06:27:44
问题 I trying to load jasper report (.jrxml) that i created, i named the report "JREmp1.xml". but i got this error "HTTP Status 500 - Request processing failed; nested exception is net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: D:\printpdf.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\JasperExample\jasper\JREmp1.jrxml (The system cannot find the path specified)" how to got the exact location? here is my JREmp1.xml file location : and here is code in my

ReportLab table with a column spanning all rows split across PDF page?

守給你的承諾、 提交于 2020-01-15 05:53:29
问题 I am trying to layout a table in reportLab in the following format. The table is dynamic and can have many rows. --------- | a | b | |---| | | a | | |---| | | a | | --------- tTableStyle=[ ('SPAN',(1,0),(1,-1)) ] Works beautifully if the table fits on one page but crashes if the table is split over pages. Without the span the table splits ok but I'm stuck with the gridlines in the second column. Have read here that this is due to the algorithm used not being able to SPAN across pages

Image transparency in PDF using iTextSharp

匆匆过客 提交于 2020-01-15 05:23:58
问题 I have an incoming jpg file, that I can set a colour to transparent. When I add the image to another image, this works perfectly. I am trying to add the same image to a PDF using iTextSharp, but I cannot get the transparency to work. I have tried two ways, but neither is working. The first way was to open the image in a Bitmap, set transparency, then use that Bitmap object in the PDF. The second way (shown here) was saving the Bitmap to disk and opening the file into the iTextSharp image.

html2pdf page numbering

痴心易碎 提交于 2020-01-14 09:33:29
问题 I have code like this: $html2pdf = new HTML2PDF('P','A4','en'); $html2pdf->WriteHTML($html); $html2pdf->Output(); How add page number at the bottom of the document? 回答1: i'm still looking for it ... and i have just found the solution : in your template, insert a code like : <page> <page_footer> [[page_cu]]/[[page_nb]] </page_footer> </page> complete sample here : http://wiki.spipu.net/doku.php?id=html2pdf:en:v4:bookmark 回答2: I tried the following code. <page> <page_header footer='page'> <!--

PDFsharp on Azure with Custom Fonts

时光毁灭记忆、已成空白 提交于 2020-01-14 03:08:13
问题 I am using a webapp on azure to create a PDF using PDFsharp 1.32. As it is a Azure webapp I cannot install fonts. Therefore I am using the following with embedded font options: var globalFontCollection = XPrivateFontCollection.Global; _fontBytes = File.ReadAllBytes(_pathToFont); globalFontCollection.AddFont(_fontBytes, _fontName); However this does not work. There is no error just acts as if the font is not known and falls back to the default. If I install the font it works so I know the rest

“Access is Denied” when attempting to open a URL generated for a procedurally-generated PDF in IE11

萝らか妹 提交于 2020-01-13 18:11:08
问题 For an application I am working on, we have a feature where we are generating a report for an object on the server side, and opening it in a new tab (for the time being) on the client. I'm using the URL.createObjectURL function to make a URL for a Blob , which is comprised of the results of an AJAX call. Whenever a $window.open(generatedFileUrl) call is made, however, I recieve a JavaScript error. Controller: (function() { angular.module('app').controller('someCtrl', [ '$window', 'someSvc',