itextsharp

With iTextSharp, how do I get the x,y coordinates of the image on a specific layer of a PDF

[亡魂溺海] 提交于 2019-12-08 03:10:04
问题 I'm generating certificate documents for different clients. I have different pdf documents that I use as a template and fill in the relevant info for the client. I also add in a logo specific to the client. I currently remove a layer that contains only the logo in my template pdf and add in the new logo. //Apply Logos if (_CertificateLogo != "" || _ExpiryDate.HasValue) { foreach (string key in layers.Keys.ToList()) { if (key.ToLower().Equals("logo") && _CertificateLogo != "") { PdfLayer

iTextSharp: Convert PdfObject to PdfStream

亡梦爱人 提交于 2019-12-08 02:41:17
问题 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

embed font into pdf using itextsharp

天大地大妈咪最大 提交于 2019-12-08 02:39:40
问题 I am trying to embed a font using itextsharp 5.2.1.0, but am getting errors. the font is KozGoPro-Light.otf which after doing a bit of research is a japenese font. I have tried the following... Dim tblx1 As PdfPTable = New PdfPTable(1) Dim tblrightcell_margin2 As PdfPCell Dim bfR As iTextSharp.text.pdf.BaseFont **bfR = iTextSharp.text.pdf.BaseFont.CreateFont("KozGoPro-Light.otf", iTextSharp.text.pdf.BaseFont.IDENTITY_H, iTextSharp.text.pdf.BaseFont.EMBEDDED) fntKozgoProExtra = New Font(bfR,

How to read a PDF Portfolio using iTextSharp

◇◆丶佛笑我妖孽 提交于 2019-12-08 02:27:14
问题 I'm using iTextSharp, in a C# app that reads PDF files and breaks out the pages as separate PDF documents. It works well, except in the case of portfolios. Now I'm trying to figure out how to read a PDF portfolio (or Collection, as they seem to be called in iText) that contains two embedded PDF documents. I want to simply open the portfolio, enumerate the embedded files and then save them as separate, simple PDF files. There's a good example of how to programmatically create a PDF portfolio,

Problem with PdfTextExtractor in itext!

你离开我真会死。 提交于 2019-12-08 00:25:48
问题 first excuse me for my bad english! I want to search in pdf document for a word like "Hello" . So I must read each page in pdf by PdfTextExtractor. I did it well. I can read all words in each page separately an save it in string buffer. but when i push this code in For loop ,(for example from page 1 to 7 for search in it) earlier page's words will remain in string buffer.I hop you understand my problem. Tanx all. this is my code : PdfReader reader2 = new PdfReader(openFileDialog1.FileName);

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

瘦欲@ 提交于 2019-12-07 23:33:09
问题 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

How to create “reply” to sticky note annotation in iText

醉酒当歌 提交于 2019-12-07 23:31:24
问题 I trying to create "reply" to sticky note annotation using iText, does anyone know how to do that? Another question: how to modify the date of annotation? 回答1: Taking a look at the innards of just such an annotation, I see the following: A new text note annotation with the same bounding box A new popup annotation with the same bounding box The new text annot has an IRT (in regards to?) key in its dictionary that is an indirect reference to the first text annotation. The creation date is

iTextSharp z-index

╄→гoц情女王★ 提交于 2019-12-07 21:24:24
问题 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 回答1: The explanation you posted as an answer (BTW, more apropos would have been to edit your question to

Problems loading iTextSharp in PowerShell

那年仲夏 提交于 2019-12-07 21:18:58
问题 I am having problem loading the iTextSharp.dll in PowerShell. Sometimes it works fine using either: [System.Reflection.Assembly]::LoadFrom("C:\dll\itextsharp.dll") Add-Type -Path C:\dll\itextsharp.dll' However, most times I get the following error: Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:/// C:\dll\itextsharp.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)" At line:1 char:1 + [System.Reflection

Make AcroFields(iTextSharp) are non editable and set bold

a 夏天 提交于 2019-12-07 20:54:15
问题 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. 回答1: If you don't want to form to be editable, use