pdf-generation

Why are PDF files different even if the content is the same?

╄→尐↘猪︶ㄣ 提交于 2019-11-28 01:25:05
"There’s usually more than one way to create PDF documents that look like identical twins when opened in a PDF viewer. And even if you create two identical PDF documents using the exact same code, there will be small differences between the two resulting files. That’s inherent to the PDF format." i read this paragraph in "Itext in action-second edition".(p 17).Can anyone please explain me what kind of differences the author's talking about.and reason why pdf format has this defect if i may say. Files that are created on a different moment, have a different value for the CreationDate and they

Create pdf file in Asp.net

南笙酒味 提交于 2019-11-28 01:25:00
问题 string s=" Name nnnn Age dd </tr> </table>" I need to convert this string to a pdf file.Can anybody help me for doing this? 回答1: iTextSharp - Introducing Tables The .NET framework does not contain any native way to work with PDF files. So, if you want to generate or work with PDF files as part of your ASP.NET web application, you will have to rely on one of the many third party components that are available. Google will help you to find one that fits your budget, as well as a range of open

Indentation in generated PDF using JasperReports

﹥>﹥吖頭↗ 提交于 2019-11-28 01:09:19
I have a piece of HTML stored in a database as: <ul> <li>Pretend you're talking to a busy colleague and have to sum up your entire question in one sentence: what details can you include that will help someone identify and solve your problem?</li> <li>Spelling, grammar and punctuation are important! Remember, this is the first part of your question others will see - you want to make a good impression. If you're not comfortable writing in English, ask a friend to proof-read it for you. </li> <li>If you're having trouble summarizing the problem, write the title last - sometimes writing the rest

Draw a rectangle in a PDF document using iText

泄露秘密 提交于 2019-11-28 00:52:51
问题 Is there a way in iText to draw a rectangle in a PDF document? 回答1: Here is the solution. Thanks Dylan McClung. PdfWriter writer = ...; PdfContentByte cb = writer.getDirectContent(); cb.saveState(); cb.setColorStroke(Color.black); cb.rectangle(x,y,x1,y1); cb.stroke(); cb.restoreState(); 回答2: In the .NET version I just create a table with a border. I know it isn't Java but maybe the following code will help you. iTextSharp.text.Document document = new iTextSharp.text.Document(PageSize.LETTER,

Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

谁说胖子不能爱 提交于 2019-11-28 00:48:28
问题 I'm using iTextSharp 5.3.2.0 to add information to an existing PDF file that contains a W-2 form. Everything is working perfectly and the PDF file looks great when written into the browser's response stream; however, when the user is done looking at the PDF, he is asked "Do you want to save changes to 'W2.pdf' before closing?" every time he views the document from the web page. In trying to narrow the problem down, I've actually stripped out all of my modifications but the problem continues.

How to create PDF file using iText or some other library on android?

陌路散爱 提交于 2019-11-28 00:40:18
问题 How to create PDF file using iText or some other library on android? Is there any tutorial on iText for android? Thanks 回答1: You can use iText to create PDFs. Use the latest version (5.1.3) and include only the itextpdf-5.1.3.jar in the build path. You can use something like this to accomplish the pdf creation. Document document = new Document(); file = Environment.getExternalStorageDirectory().getPath() + "/Hello.pdf" PdfWriter.getInstance(document,new FileOutputStream(file)); document.open(

Generate and design PDF with iTextSharp or similar [closed]

徘徊边缘 提交于 2019-11-28 00:22:09
tl;dr : Basically I'm just wondering what is the best/easiest way to design a PDF document? Is it remotely legit to actually design a whole PDF document with iTextSharp with code(i.e not loading external files)? I want the final result to look similar to a webpage with various colours, borders, images and everything. Or do you have to rely on other documents like .doc, .html files to achieve a good design? Originally I thought that I would use HTML markup to generate a PDF, however seeing how bad the support seems to be when it comes to styling/CSS so am I rethinking the whole situation. Which

HTML2PDF in PHP - convert utilities & scripts - examples & demos

人盡茶涼 提交于 2019-11-27 23:15:43
I have a quite complicated HTML/CSS layout which I would like to convert to PDF on my server. I already have tryed DOMPDF, unfortunately it did not convert the HTML with correct layout. I have considered HTMLDOC but I have heard that it ignores CSS to a large extent, so I suppose the layout would break apart with that tool too. My question therefor is - are there any online demos for other tools (like wkhtmltopdf i.e.) that I could use to verify how my HTML is converted? Before spending the rest of my life installing & testing one by one? Unfortunately, I can't change the HTML layout to fit

Html to pdf some characters are missing (itextsharp)

孤人 提交于 2019-11-27 23:07:07
I want to export gridview to pdf by using the itextsharp library. The problem is that some turkish characters such as İ,ı,Ş,ş etc... are missing in the pdf document. The code used to export the pdf is: protected void LinkButtonPdf_Click(object sender, EventArgs e) { Response.ContentType = "application/pdf"; Response.ContentEncoding = System.Text.Encoding.UTF8; Response.AddHeader("content-disposition", "attachment;filename=FileName.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); System.IO.StringWriter stringWrite = new StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite =

Cannot create PDF document with 400+ pages on iOS

北城以北 提交于 2019-11-27 22:52:48
I am using the following pseudocode to generate a PDF document: CGContextRef context = CGPDFContextCreateWithURL(url, &rect, NULL); for (int i = 1; i <= N; i++) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; CGContextBeginPage(context, &mediaBox); // drawing code CGContextEndPage(context); [pool release]; } CGContextRelease(context); It works very well with small documents ( N < 100 pages), but it uses too much memory and crashes if the document has more than about 400 pages (it received two memory warnings before crashing.) I have made sure there were no leaks using Instruments