itextsharp

ITextSharp include all pages from the input file

旧城冷巷雨未停 提交于 2019-12-11 14:09:30
问题 I used the following code by using itextsharp library to add text to a pdf.(got the code from link ITextSharp insert text to an existing pdf Dim reader As New PdfReader(oldFile) Dim size As iTextSharp.text.Rectangle = reader.GetPageSizeWithRotation(1) Dim document As New iTextSharp.text.Document(size) ' open the writer Dim fs As New FileStream(newFile, FileMode.Create, FileAccess.Write) Dim writer As PdfWriter = PdfWriter.GetInstance(document, fs) document.Open() ' the pdf content Dim cb As

identify paragraphs of pdf fiiles using itextsharp

◇◆丶佛笑我妖孽 提交于 2019-12-11 13:59:51
问题 Because of some semantic analysis work, I need identify paragraphs from pdf files with iTextSharp. I know the coordinates of iTextSharp live in the left bottom corner of a page. I find three features to define the paragraph boundaries: if the horizontal axis of the first word in one line is less than that of the general lines; if the leading of two consecutive lines is larger than that of the general ones; if one line ends with "." and the horizontal axis of the ending word is less than that

iTextSharp. How to get specific types from AcroFields? Like PushButtonField, RadioCheckField, etc

♀尐吖头ヾ 提交于 2019-12-11 13:32:51
问题 I am trying to cast AcroFields to the specific types so I can set properties on them. When I call AcroFields.GetField(string name); all I get is a string. When I call AcroFields.GetFieldItem(string name); I get an object but cannot cast it to the specific type. I have also tried: AcroFields.SetFieldProperty("myfield", "CheckType", RadioCheckField.TYPE_STAR, null); This returned false every time. To better explain my scenario: I have an existing PDF ( I am NOT generating this file ). There is

iTextSharp PdfPtable multipage

☆樱花仙子☆ 提交于 2019-12-11 13:23:07
问题 I am new to iTextSharp, and want to convert my DataGridView to a PdfPtable. When i write the table to PDF, it shows up nicely, except when the amount of columns is relatively large. Then it accomodates by making the column width smaller. Instead, I would like to start on a new page, with more of the table shown, with headers. Below is my code for the table: PdfPTable table = new PdfPTable( view.Columns.Count ); float[] widths = new float[view.Columns.Count]; for ( int i = 0; i < view.Columns

itextsharp images are not coming next to one another

為{幸葍}努か 提交于 2019-12-11 13:13:15
问题 I have 2 asp.net chart control which i want to convert to pdf. I am using iTextSharp to convert the images to pdf. The issue is with the position of images, i want images to come next to other. i tried to setpagesize but it didnt worked. Document pdfDoc = new Document(PageSize.A4); PdfWriter.GetInstance(pdfDoc, Response.OutputStream); pdfDoc.SetPageSize(iTextSharp.text.PageSize.A4.Rotate()); Chart1.SaveImage(stream, ChartImageFormat.Png); iTextSharp.text.Image chartImage = iTextSharp.text

How to Create PDF file with Tamil Font by using itextsharp in C#?

只谈情不闲聊 提交于 2019-12-11 13:03:39
问题 we are creating pdf files in our C# application by passing TAMIL text(one of the indian language).So, I already installed AVVAIYAR.TTF(one of the tamil font) font for my tamil language font.But when i run the below mentioned pgm, the created pdf file does not contain any tamil font display.It shows empty lines instead of the tamil text... C# Code: Document document = new Document(); PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(@"C:\pdfout.pdf", FileMode.Create)); document

itextsharp not closing files

情到浓时终转凉″ 提交于 2019-12-11 12:54:16
问题 I've got some code for itextsharp merging 2 pdf files. Found it online somewhere. The merging works fine, but it seems that the source files are staying in use after it is all done. What I'd like to do is to delete the first file that i have already merged, which is uploaded via a fileupload, and keep only the merged file. It's definitely the code doing the merging that is causing the file to stay open. I tried to delete the file on the server and it tells me something like it's open by the

Determine the max resolution (DPI) on a PDF page

左心房为你撑大大i 提交于 2019-12-11 12:38:28
问题 I am using GhostScript.Net to rasterize PDF to page images before sending the page images to the printer. I am doing this so that I can always rasterize to 300dpi. This allows me to print the PDF in a reasonable amount of time regardless of the size of any image in the PDF (mainly scanned PDFs). However, it strikes me that in some cases there will not be a need to rasterize as high as 300dpi. It may be possible to rasterize to 200dpi or even 100dpi depending on the content of the page. Has

Watermark in PDF file is hiding behind images

老子叫甜甜 提交于 2019-12-11 12:29:32
问题 I want to add a watermark to an existing PDF by using the following: ITextSharp insert text to an existing pdf The 3rd answer is working but if the PDF contains an image then the watermark is hidden behind it. 回答1: For questions like this, please consult The Best iText Questions on StackOverflow. This book bundles hundreds of questions previously posted and answered on StackOverflow, including some answers from our closed issue tracker. This is such an answer that wasn't published on