itext7

What is the iText 7 equivalent of FontSelector.Process?

蓝咒 提交于 2019-12-24 23:42:49
问题 I'm beginning the process of updating code written against iText5 to work with iText7. Is there a similar mechanism in iText7 to the FontSelector class, where you would load up fonts and the "Process" action would automatically determine which font to use (and return a formatted pdf "chunk" that could be added to the document)? Here's the code snippet (this is C++, but my "native" language is C#, so feel free to answer with C#). try { doc = gcnew Document(); pdfWriter = PdfWriter::GetInstance

iTextSharp - where are PdfDocument, PdfCanvas, …?

你说的曾经没有我的故事 提交于 2019-12-24 22:22:27
问题 I'm generating PDF documents using iText(Sharp). I'm developing the app using Visual Studio 2017. I've added iTestSharp using NuGet and I've experimented with both VB and C# All is fine for the 'high-level' stuff (chapter 1 from the jumpstart tutorial). Now I want to go more low-level using 'page', 'canvas' and 'low-level' drawing commands : chapter 2 from the jumpstart tutorial http://developers.itextpdf.com/content/itext-7-jump-start-tutorial/chapter-2-adding-low-level-content My problem is

iText7 converting signature as an invisible signature after using append mode property

旧街凉风 提交于 2019-12-24 19:49:17
问题 I am getting issue that if I use UseAppendMode property while creating signature field in the document, upon signing it creates invisible signature. Otherwise it displays the content of my custom signature appearance and creates a visible signature into PDF. Following is my code snippet: SigningResponse signingResponse = new SigningResponse(); Stream outputStream = new MemoryStream(); Org.BouncyCastle.X509.X509Certificate x509Certificate = null; int estimatedSize = SigningProfile.ContainsKey

What is the equivalent of stamper.AddJavaScript function (iText 5) with iText7 (.NET)?

有些话、适合烂在心里 提交于 2019-12-24 19:44:21
问题 We are writing a program that needs to insert document-level JavaScript with iText 7. We founded that with iText 5, the solution was Stamper.AddJavaScript(). 回答1: It depends on the type of event you want your JavaScript code to be triggered at. For instance, to define an action that would be executed as soon as the document is opened, use PdfDocument#getCatalog().setOpenAction . Example for opening a print dialog when the document is opened: pdfDocument.getCatalog().setOpenAction(PdfAction

IText7 html2pdf footer CSS does not work

♀尐吖头ヾ 提交于 2019-12-24 19:16:11
问题 I am not able to see footer in resultant PDF for below HTML and CSS. This code works fine with IText version 2 . Does the way to show header and footer is changed in IText version 7 ? or am I missing any configuration required for newer version? Thanks. Java code public void createPdf(String src, String dest, String resources) throws IOException { try { FileOutputStream outputStream = new FileOutputStream(dest); WriterProperties writerProperties = new WriterProperties(); //Add metadata

PDF-Checkbox - check one and uncheck another without JavaScript

混江龙づ霸主 提交于 2019-12-24 15:33:19
问题 in my project I need 3 checkboxes which should work like radiobuttons. But radiobuttons have some drawbacks with appearance in Adobe Reader. For this reason I have to use checkboxes. There is a very interesting answer, but I don't understand how this can be done with iText: Java iText and custom Radiobutton behaviour Can anybody -- especially Lonzak, the author of this posting -- help me in this case. Thanks and Kind regards, Dirk 回答1: I think the solution is to fix your current code. The

Cannot draw elements on already flushed pages

白昼怎懂夜的黑 提交于 2019-12-24 11:18:18
问题 I wanted to generate the pdf with page numbers and also having table of content which has page numbers in it. I am up to generating PDF but cannot add page numbers to it. ol.anchorLink a::after { content: leader('.') target-counter(attr(href), page); } @page { @bottom-right { padding-right:20px; content: "Page " counter(page); } } this piece of cs is not woking in the dependency i am using which is itextpdf . so I have made changes in the java file @Override public DataHandler getPDFVersion

iText7:How to ignore PDF Page Rotation

不羁的心 提交于 2019-12-24 09:40:01
问题 I have been struggling with this issue for a long time now. I am simply trying to implement a stamping feature using iText7.NET. The issue first arises from transparency. If I use an image (tried it with transparent png), the pdf gets stamped, but the background is color black as opposed to being transparent: For the sake of interest, the associated code is the following: Rectangle location = new Rectangle(crop.GetLeft(),crop.GetBottom(),iWidth/4,iHeight/4); PdfStampAnnotation stamp = new

The removing page has already been flushed

风流意气都作罢 提交于 2019-12-24 08:21:31
问题 I created a PDF file with the data from an Excel file. I am not sure what was happened, but when I tried to remove one PdfPage and insert it somewhere else, it showed the warning message "The removing page has already been flushed". The used code is quite simple: PdfDocument pdf = ...; .... PdfPage page = pdf.removePage(10); pdf.addPage(1, page); But I got warning and errors: [main] WARN com.itextpdf.kernel.pdf.PdfPage - The removing page has already been flushed. Exception in thread "main"

iTextSharp 7 object reference not set to an instance of an object

被刻印的时光 ゝ 提交于 2019-12-24 07:51:12
问题 Is there some recommendation to build tables with cells having paragraphs in order to avoid an exception at adding of some cell to table or table to document? I get this and I can't figure out what happens: [NullReferenceException: Object reference not set to an instance of an object.] iText.Layout.Renderer.TableRenderer.DrawBorders(DrawContext drawContext) +2493 iText.Layout.Renderer.TableRenderer.DrawChildren(DrawContext drawContext) +1497 iText.Layout.Renderer.AbstractRenderer.Draw