itextsharp

Programmatically determine text visibility in PDF document

随声附和 提交于 2019-12-08 11:58:04
问题 Using iTextSharp or some other library, is it possible to determine if a given part of the text is visible? Using other word, is it possible to extract (to simple text) only the visible parts? For example, if a given text segment has its font color white, then that text segment would be invisible when printing or displaying on screen. My goal is to find a way to extract only the text that would be visible when printing that document! 来源: https://stackoverflow.com/questions/18302431

iTextSharp: Setting text on textfield that is on a table cell results in text being too wide and squashed

浪尽此生 提交于 2019-12-08 10:58:20
问题 I think this might be a bug, but if anyone can help I'd appreciate it. I currently have another question open that deals with a similar issue, but I think this question better exemplifies the problem, and more simply too. That being said I don't want to delete the old one in case it increases my wait time. I yield to the mods to decide which question is better. Here's a sample application that creates a pdf, then a table. It adds a cell to the table and then ties a fieldpositioningevent to

Check Mark in iTextSharp

泄露秘密 提交于 2019-12-08 10:47:27
问题 I am building a pdf. I would like to have some text and next to the text a check mark. Does anyone have an idea as to how to do this? Thanks 回答1: One way is to create a PNG of a check mark, load the image and draw it next to your text. I've done something similar many times but not specifically with iTextSharp. Here is an iText example to get you started though. 回答2: Use this for checkmarks as bullets : List myList = new ZapfDingbatsList(52); ZapfDingbatsList(52) - checkmark in bold.

Merge content of pdf files using iTextSharp

ε祈祈猫儿з 提交于 2019-12-08 10:45:01
问题 Is it possible to place the content of one pdf file to a specific place in another one (e.g. between two paragraphs) and have the original content automatically shift downwards so it does not underlay the new one? If not, is it at least possible to get a height of only the content part of a pdf page? I have a number of templates with AcroForms, where one is the main template containing several pages and I need to stamp and insert the other files into it at specific places. I can do that using

How do I add table to existing pdf using iTextSharp

a 夏天 提交于 2019-12-08 09:48:28
问题 I'm developing an app to merging pdf documents into one document using itextsharp. I've gotten the single pdf created. Now I have to create a table and add it to the first page. Unfortunately this is becoming more complicated than it seams. After hours of trying I was able to add the table into the second page. How can I add the table to the first page? I'm using this sample project for testing http://gamepacks.org/Sample.zip. Public Sub MergePdfFiles(ByVal docList As List(Of String), ByVal

search PDF text, highlight found words by drawing rectangle after getting their coordinates save PDF with text highlighted

让人想犯罪 __ 提交于 2019-12-08 09:37:32
问题 Anyone can help with how to get a text coordinates? can this be possible? because I just wanted a windows form app where the user types a word in a text box, and the app reads existing PDF using iTextSharp, highlights the matched words if found, and saves the PDF with highlighted text. so far i have almost everything done, including the drawing of a yellow rectangle, but what is lacking is how to get the text coordinates of the matched patterns to highlight them, thanks in advance: (by the

Get coordinates from the pdf using itextsharp

怎甘沉沦 提交于 2019-12-08 09:36:51
问题 I have done something like this: PdfReader reader = new PdfReader("cde.pdf"); TextWithPositionExtractionStategy S = new TextWithPositionExtractionStategy(); PdfTextExtractor.GetTextFromPage(reader,1,S); Vector curBaseline = renderInfo.GetDescentLine().GetStartPoint(); Vector topRight = renderInfo.GetAscentLine().GetEndPoint(); iTextSharp.text.Rectangle rect = new iTextSharp.text.Rectangle(curBaseline[Vector.I1], curBaseline[Vector.I2], topRight[Vector.I1], topRight[Vector.I2]); string x1 =

How to create an editable pdf in asp.net?

两盒软妹~` 提交于 2019-12-08 09:29:06
问题 here is a different type of requirement in my project regarding pdf. I want to generate a pdf with few of prefilled values. rest of the fields can be filled by user so Pdf should allow the user to edit the pdf so that he can save it locally on his system. The pdf may contain checkboxes and textboxes. I have worked with "itextsharp", "abc pdf" and "Rad Pdf". For this purpose i can't use "Rad Pdf", due to some limitations by project owner. Please share your valuable answers to give me a proper

PDF Add Text and Flatten

半世苍凉 提交于 2019-12-08 08:52:42
问题 I'm developing a web application that displays PDFs and allows users to order copies of the documents. We want to add text, such as "unpaid" or "sample", on the fly when the PDF is displayed. I have accomplished this using itextsharp. However, the page images are easily separated from the watermark text and extracted using a variety of freeware programs. How can I add the watermark to the pages in the PDF, but flatten the page images and watermark together so that the watermark becomes part

Using iText to fill text field background

*爱你&永不变心* 提交于 2019-12-08 08:49:21
问题 I am trying to Use iText to fill the color of a text field. I have tried setfieldproperty and it does not work with bgcolor or fill color attribute. What I am looking for is the property of the text field to set as it will be overlayed existing text or image I have tried the couple of cases at the end.. ' Create a new PDF reader based on the PDF template document Dim pdfReaderBG As PdfReader = New PdfReader(pdfTemplate) ' Page of Fields Dim pdfReaderFG As PdfReader = New PdfReader(pdfExisting