itextsharp

Create barcode with text image (not pdf) using itextsharp

僤鯓⒐⒋嵵緔 提交于 2019-12-06 11:49:51
I am able to create barcode using itextsharp CreateDrawingImage method. But I want to include the actual text into the image. How do I do that? or How do I use CreateImageWithBarcode method to save as image (Jpeg/Png)? Thanks Facing the same problem and after looking in iTextSharp sources it appears you can't. Besides with CreateDrawingImage() I had problems with image resizing, it was fuzzy and unreadable. I ended up using this library (very cool): http://www.codeproject.com/KB/graphics/BarcodeLibrary.aspx Code for EAN13: System.Drawing.Image imageBarcode = BarcodeLib.Barcode.DoEncode

How to Detect table start in itextSharp?

大城市里の小女人 提交于 2019-12-06 11:42:05
问题 I am trying to convert pdf to csv file. pdf file has data in tabular format with first row as header. I have reached to the level where I can extract text from a cell, compare the baseline of text in table and detect newline but I need to compare table borders to detect start of table. I do not know how to detect and compare lines in PDF. Can anyone help me? Thanks!!! 回答1: As you've seen (hopefully), PDFs have no concept of tables, just text placed at specific locations and lines drawn around

iTextSharp: Convert PdfObject to PdfStream

[亡魂溺海] 提交于 2019-12-06 11:15:47
I am attempting to pull some font streams out of a pdf file (legality is not an issue, as my company has paid for the rights to display these documents in their original manner - and this requires a conversion which requires the extraction of the fonts). Now, I had been using MUTool - but it also extracts the images in the pdf as well with no method for bypassing them and some of these contain 10s of thousands of images. So, I took to the web for answers and have come to the following solution: I get all of the fonts into a font dictionary and then I attempt to convert them into PdfStreams

iTextSharp change outcome quality / compression like PDF24Creator

Deadly 提交于 2019-12-06 10:55:43
问题 I was wondering if I can compress/Change the Quality of my outcoming pdf-file with iTextSharp and C# like I can do with Adobe Acrobat Pro or PDF24Creator. Using the PDF24Creator I can open the pdf, save the file again and set the "Quality of the PDF" to "Low Quality" and my file size decreases from 88,6MB to 12,5MB while the Quality is still good enough. I am already using the writer = new PdfCopy(doc, fs); writer.SetPdfVersion(PdfCopy.PDF_VERSION_1_7); writer.CompressionLevel = PdfStream

How to create and fill out a PDF form

喜欢而已 提交于 2019-12-06 10:32:57
background of the issue: I may get different kind of templates which contains controls(Text Box, check box) some times in a paper/word document.pdf document templates. Now i have to assign values in that provided templates, and have to save it as pdf document. So i found some thing useful for templating called Openoffice,from there i am able to add controls and able to save as pdf template document. Now for that template need to assign values, for that found one dll called iTextSharp. based on the samples while i am trying to add , the count of the fields in the pdf template is showing as 0.

Make AcroFields(iTextSharp) are non editable and set bold

自古美人都是妖i 提交于 2019-12-06 10:18:34
I'm using iTextSharp to populate the data to PDF Templates, which is created in OpenOffice. it populating fine, I'm getting proper PDF, But that is coming editable mode. I want non-editable PDF . And also make some rows BOLD( by Program) . below is my snippet code. PdfStamper stamper = new PdfStamper(reader, outputStream); AcroFields fields = stamper.getAcroFields(); //loop fields.setField("Desc_", "HILINSKI, MARK"); Please help me. Thanks. If you don't want to form to be editable, use form flattening as is done in the FillDataSheet example. Add this to your code: fields.setGenerateAppearances

iTextSharp z-index

 ̄綄美尐妖づ 提交于 2019-12-06 08:47:59
I'm using itextSharp to add anotations in a pdf document. I have a pdf document that already contains an image saved in it, it's a stamp. So I draw some stroke on this pdf in the stamp and everything is fine when I draw them in my WPF but when I send the pdf by email using iTextSharp for the conversion the line I drawed is now below the stamp. How I can solve this problem ? Thank you mkl The explanation you posted as an answer (BTW, more apropos would have been to edit your question to contain that data) explains the issue. There are two principal types of objects visible on a PDF page: the

c#/asp.net - How to catch “System.Web.HttpException: Request timed out”?

╄→гoц情女王★ 提交于 2019-12-06 08:33:15
In my asp.net/c# project I am using the iTextsharp dll to read the text from many pdf documents, but sometimes I get this error System.Web.HttpException: Request timed out. But the code that does it is: public static bool does_pdf_have_keyword(string keyword, string pdf_src) { try { PdfReader pdfReader = new PdfReader(pdf_src); string currentText; int count = pdfReader.NumberOfPages; for (int page = 1; page <= count; page++) { ITextExtractionStrategy strategy = new SimpleTextExtractionStrategy(); currentText = PdfTextExtractor.GetTextFromPage(pdfReader, page, strategy); if (currentText.IndexOf

Dynamically creating .pdfs under the ITextSharp Free Licence

◇◆丶佛笑我妖孽 提交于 2019-12-06 07:30:50
In a ASP.NET C# website/server I am using the .pdf creater library called ITextSharp to create .pdfs with text & some images about a product. As usual the boss doesn't want to purchase a licence. I know that if I use ITextSharp versions 4.1.6 or lower I can use the library under the free licence(cant I?) My Question: Will the older versions(4.1.6-)/free versions meet my needs of generating a pdf with an image at the top, text content in the middle(some paragraphs) and an image at the bottom? Will I find some API functions not available to myself because I have the older versions? Would you

iText(Sharp) - Text is different when drawn with cell event vs. directly

白昼怎懂夜的黑 提交于 2019-12-06 07:30:14
I've got a PdfPTable in which I am drawing simple text: BaseFont bf = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED); Font f2 = new Font(bf, 10.0f); PdfPTable tab = new PdfPTable(2); table.AddCell(new PdfPCell(new Phrase("Dude", f2))); And that's all fine and dandy. But then in order to do some fancier stuff , I'm trying to get cell events to work: Font f2 = new Font(bf, 10.0f); // Pretend this is a global class CellEvent : IPdfPCellEvent { void IPdfPCellEvent.CellLayout(PdfPCell cell, Rectangle r, PdfContentByte[] canvases) { ColumnText ct = new ColumnText