itext

canvas incorrectly draws heights cell in table itext7

China☆狼群 提交于 2019-12-25 01:15:20
问题 i draw table as it: Draw custom borders for table with more flexibility in itext7 But i But with big data the table is badly drawn height cell in table. PdfDocument pdfDoc = new PdfDocument(new PdfWriter("_testPd/dashed_underline.pdf")); Document doc = new Document(pdfDoc, PageSize.A5); Table table = new Table(3).useAllAvailableWidth().setFixedLayout(); table.addCell("Highway System that runs east from the Indiana state line near Lake Michigan through the southern Lower Peninsula to Detroit,

How to retrieve the image of a PdfStampAnnotation

让人想犯罪 __ 提交于 2019-12-25 01:05:02
问题 I created a pdf using the following example: https://developers.itextpdf.com/examples/actions-and-annotations/clone-creating-and-adding-annotations#2260-addstamp.java @Category(SampleTest.class) public class AddStamp extends GenericTest { public static final String DEST = "./target/test/resources/sandbox/annotations/add_stamp.pdf"; public static final String IMG = "./src/test/resources/img/itext.png"; public static final String SRC = "./src/test/resources/pdfs/hello.pdf"; public static void

iText PDFSweep RegexBasedCleanupStrategy not work in some case

…衆ロ難τιáo~ 提交于 2019-12-25 00:59:53
问题 I'm trying to use iText PDFSweep RegexBasedCleanupStrategy to redact some words from pdf, however I only want to redact the word but not appear in other word, eg. I want to redact "al" as single word, but I don't want to redact the "al" in "mineral". So I add the word boundary("\b") in the Regex as parameter to RegexBasedCleanupStrategy, new RegexBasedCleanupStrategy("\\bal\\b") however the pdfAutoSweep.cleanUp not work if the word is at the end of line. 回答1: In short The cause of this issue

itext reading specific location from pdf file runs in intellij and gives desired output but executable jar throws error

强颜欢笑 提交于 2019-12-24 23:49:03
问题 I am reading specific location from an input pdf file with n number of pages and making a list of the texts on those locations. Then I write a new pdf document and write those strings from the list into a table with cells. I came up with two main problems. I want to have three columns in the table but if my strings in the list were not a multiple of 3 (i.e., the number of columns) then it would leave extra strings and would not print them. For example if I have 4 strings to print then the

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

PdfPKCS7 .verify() return false while signature verification

不想你离开。 提交于 2019-12-24 23:24:01
问题 I have been working with itextSharp-5.5.5, (5.5.10 / 5.5.13) Having issue with all version. TypeInfo typeInfo = typeof(PdfPKCS7).GetTypeInfo(); FieldInfo rsaDataField = typeInfo.GetDeclaredField("RSAdata"); Object rsadatafieldcontent = rsaDataField.GetValue(pkcs7); if (rsadatafieldcontent != null && ((byte[])rsadatafieldcontent).Length == 0) { _log.Info("Found zero-length encapsulated content: ignoring"); rsaDataField.SetValue(pkcs7, null); } if (pkcs7.Verifyc()) <------ **HERE return false**

How to save PDF file on Sdcard created using iText?

自闭症网瘾萝莉.ら 提交于 2019-12-24 23:22:16
问题 I am using iText library to create a pdf file from given string. But how can i save this document file to external storage ? Document document = new Document(); fileName = "Hello" + ".pdf"; PdfWriter.getInstance(document, new FileOutputStream(fileName)); document.open(); document.add(new Paragraph("Hellooo")); document.close(); What should i do after it to save this document to external storage ? 回答1: Have fileName point to a location on external storage, rather than be "Hello" + ".pdf" . You

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

How do I add a footer in a PDF using iTextSharp VB.net?

♀尐吖头ヾ 提交于 2019-12-24 20:53:37
问题 I have a piece of code that generates my PDF. I am trying to figure out how to add a footer to every page but I don't know how. I have seen a lot of examples in C# but I can't seem to find out how to exactly add the footer using VB.net (C# skills aren't that great). I believe that the correct way is to use the OnEndPage feature but I have no idea on how to add that in my code at this moment. I am new to this so any help would be great. The code below is what I am using now. Private Sub

How to achieve a dashed underline using chunk.setUnderline?

女生的网名这么多〃 提交于 2019-12-24 20:34:15
问题 I use SAXItexthandler to achieve custom underlining of specified thickness, color & specified Y position using the below code. So basically i have different strings in multiple itext cells in a itext row and the below code helps me to do the underlining for every chunk where every chunk is embedded within a cell and it works perfectly fine. Color c = Color.decode(custom_color); currentChunk.setUnderline(c, thickness, 0.01f, ypos, 0.01f, PdfContentByte.LINE_CAP_BUTT); Now is there a way i can