itext7

Text scaling problem with itext7, hidden margins?

六眼飞鱼酱① 提交于 2020-02-25 04:13:07
问题 I'm trying to get this c# function from within a asp.netcore razor project using itext7 (7.1.7) to output a div containing text that scales up to within the constraints given with height and width. However, for some reason it seems there's some kind of hidden margin that will not scale the text to the boundaries of the given width and height, even though the margins are set to 0. At the moment the maximum text i get is only half of what it should be. Also, the paragraph, nor the div is

Get marked content using the MCID content

孤街醉人 提交于 2020-02-08 06:20:03
问题 I am using iText to recreate the Tag Tree feature of Acrobat. So far I have managed to get the tag structure. The final thing I am trying to figure out is how to get & decode the "Marked Content" for a tag from the content stream. Edit : added purpose The intent of this question is to figure out how to access the content streams, with a mcid, and decode the content. Edit 2 : Add iText RUPS reference Below image shows where I have reached in the tree, the red line points to a MCID, I am trying

Get marked content using the MCID content

白昼怎懂夜的黑 提交于 2020-02-08 06:19:50
问题 I am using iText to recreate the Tag Tree feature of Acrobat. So far I have managed to get the tag structure. The final thing I am trying to figure out is how to get & decode the "Marked Content" for a tag from the content stream. Edit : added purpose The intent of this question is to figure out how to access the content streams, with a mcid, and decode the content. Edit 2 : Add iText RUPS reference Below image shows where I have reached in the tree, the red line points to a MCID, I am trying

Get marked content using the MCID content

时光怂恿深爱的人放手 提交于 2020-02-08 06:18:11
问题 I am using iText to recreate the Tag Tree feature of Acrobat. So far I have managed to get the tag structure. The final thing I am trying to figure out is how to get & decode the "Marked Content" for a tag from the content stream. Edit : added purpose The intent of this question is to figure out how to access the content streams, with a mcid, and decode the content. Edit 2 : Add iText RUPS reference Below image shows where I have reached in the tree, the red line points to a MCID, I am trying

iText7: Creating PDF from TIFF multipage image using iText

会有一股神秘感。 提交于 2020-02-04 06:40:29
问题 I am trying to use iText 7.1.1 to convert a TIFF image to PDF file with multiple pages. Thanks for those to get me started with this article Create PDF from TIFF image using iText. However, it is iText 5.5.x and I have trouble to duplicate it in iText 7. I did find TiffImageData.getNumberOfPages(raf) to replace int pages = TiffImage.getNumberOfPages(rafa) . However, I am not able to replace TiffImage.getTiffImage(rafa, i) in iText7. Do I need to use new Image(ImageDataFactory.createTiff(...))

How to create Header in PDF generation using C# iText7

随声附和 提交于 2020-01-25 06:56:10
问题 I tried to add Header in all the pages of my PDF using iText package in .NET C#, but it's not working. Note: I'm using iText version 7 I tried the following Stack Overflow answers, they demonstrated only for Footer (i.e., END_PAGE ) not for START_PAGE Add Header and Footer for PDF using iTextsharp My Code : class Program { static void Main(string[] args) { var writer = new PdfWriter("E:/pdfSample/bala.pdf"); var pdf = new PdfDocument(writer); var document = new Document(pdf,PageSize.A4);

Itext 7 - PdfReader is not opened with owner password Error

家住魔仙堡 提交于 2020-01-24 12:10:08
问题 I am using This example for the latest Itext7 to fill in a document and I am getting this error: iText.Kernel.Crypto.BadPasswordException: PdfReader is not opened with owner password So I looked around the net I found that some people found solution to this error using PdfReader.unethicalreading = true; but when I try to use this same code it says there is no definition in PDFReader named unethicalreading Here is the Code I have: string src = @"C:\test1.pdf"; string dest = @"C:\Test2.pdf";

Getting form field font information in itext7

左心房为你撑大大i 提交于 2020-01-16 18:57:46
问题 I am parsing a PDF document using itext7. I have fetched all the form fields from the document using AcroForm, but I am unable to get font associated with the field using GetFont method. I also tried to parse /DA dictionary but it returns as a PDFString. Is there any way around to get font information or I have to parse /DA dictionary 回答1: Actually iText 7 does have a method to determine form field font information, it's needed for generating form field appearances after all: PdfFormField

itext7 table SetFixedPosition on Page 1 fails

橙三吉。 提交于 2020-01-16 17:04:01
问题 I can´t believe, what I see.... I try to print a table with itext7 into a PDF on a defined page. The table-creation is made as last statement before finishing the PDF. The PDF has (after finishing) 5 pages. I can print the table to every page except the first page. This is my code: If placeOnPage = 0 Then table.SetFixedPosition(200, 250, 100) Else table.SetFixedPosition(placeOnPage, 200, 250, 100) End If If placeOnPage = 0, then the table is printed correctly on the last page. If I set

itext7 table SetFixedPosition on Page 1 fails

主宰稳场 提交于 2020-01-16 17:03:31
问题 I can´t believe, what I see.... I try to print a table with itext7 into a PDF on a defined page. The table-creation is made as last statement before finishing the PDF. The PDF has (after finishing) 5 pages. I can print the table to every page except the first page. This is my code: If placeOnPage = 0 Then table.SetFixedPosition(200, 250, 100) Else table.SetFixedPosition(placeOnPage, 200, 250, 100) End If If placeOnPage = 0, then the table is printed correctly on the last page. If I set