itext7

Page size and formatting of PDF using iText pdfHTML

空扰寡人 提交于 2021-02-07 18:34:26
问题 I am trying to export 3 HTML pages (all with same content) into a PDF using iText7.1.0 and pdfHTML2.0.0 using this example. For some reason, the pages have formatting issue at the footer. The jsFiddle link to my HTML code that is being used by PDF renderer. Below is the Java code used for rendering the PDF (Test.html is the same HTML code in the fiddle): package com.itextpdf.htmlsamples.chapter01; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File;

How to improve iText performance when creating tables

感情迁移 提交于 2021-02-07 10:24:11
问题 Hey awesome Stackoverflow people I am currently evaluating if we should use iText 7.1.9 for Java or C#. To do this, I created a test case where I write a single PDF with a bunch of pages, each containing a big table (code below). In Java, creating a PDF with x pages yields the following results: 1 page: 0 sec 10 pages: 1 sec 100 pages: 5 sec 1000 pages: 23 sec This is reasonably performant. However, when I ported the exact same code to C# .Net, I got quite the shock: 1 page: 0 sec 10 pages: 1

How to improve iText performance when creating tables

拥有回忆 提交于 2021-02-07 10:23:22
问题 Hey awesome Stackoverflow people I am currently evaluating if we should use iText 7.1.9 for Java or C#. To do this, I created a test case where I write a single PDF with a bunch of pages, each containing a big table (code below). In Java, creating a PDF with x pages yields the following results: 1 page: 0 sec 10 pages: 1 sec 100 pages: 5 sec 1000 pages: 23 sec This is reasonably performant. However, when I ported the exact same code to C# .Net, I got quite the shock: 1 page: 0 sec 10 pages: 1

itext7 error in .net core web application: AdobeGlyphList

我是研究僧i 提交于 2021-02-05 09:02:28
问题 I'm using iText 7.1.10 and .net core 3.0. If I generate a pdf with a console application, there is no problem, but if I generate the same pdf in a web application, I have the error : AdobeGlyphList.txt loading error: The type initializer for 'iText.IO.Util.ResourceUtil' threw an exception. Have you encountered this problem and do you have solutions? Thank You 回答1: Solution : Add package Microsoft.DotNet.PlatformAbstractions 来源: https://stackoverflow.com/questions/60333632/itext7-error-in-net

Using iText 7, what's the proper way to export a Flate encoded image?

北慕城南 提交于 2021-02-05 08:19:47
问题 I am trying to create code to export out the images within a PDF using iText Version 7.19. I'm having some issues with Flate encoded images. All the Flate encoded images from the Microsoft free book I'm using as an example (see Moving to Microsoft Visual Studio 2010) always coming out pink and depending upon how I try to copy the bytes they can come out distorted. If I attempt to copy all the image bytes at once (see the SaveFlateEncodedImage2 method in the code below), they come out

iText 7 : This pdf document might not be displayed correctly Firefox

梦想与她 提交于 2021-02-05 06:39:46
问题 I am running into strange issue with generated pdf's from iText7 . The generated pdf's are opening properly in Adobe reader and Chrome browser . But the same pdf is opening partially in the Firefox browser. I am getting the below message in Firefox. The strange thing is other pdf, which are not generated via iText are properly rendering in firefox. Java code public static byte[] createPdf(List<String> htmlPages, PageSize pageSize, boolean rotate) throws IOException { ConverterProperties

add Inline image in pdf document using itext library

我与影子孤独终老i 提交于 2021-01-29 15:55:00
问题 we have created an application to generate pdf documents using itext 5 library. As the part of pdf generation, we tried to embed an image inline in pdf which should be non editable and read only. We tried with an addImage method of PdfContentByte as below, byte[] decoded = Base64.getDecoder().decode(encodedImage); image = Image.getInstance(decoded); After this image is retrieved, used the same in addImage method. PdfContentByte canvas = pdfStamper.getOverContent(item.getPage(0)); canvas

Generate a pdf with images on header and footer with iText

烂漫一生 提交于 2021-01-29 09:57:52
问题 I am looking forward to create a pdf using iText. The pdf will have a header and a footer. Both the header and footer will have a image (company logo) in it. I am looking forward to an example similar to that. I will be using the iText library for the first time so I am not sure where to start off from. 回答1: To add headers and footers to a PDF you generate using iText 7.x, you will generally create event listeners for page starts and/or page ends and add the header and footer contents there

Project works in eclipse but not after being packaged in a jar

守給你的承諾、 提交于 2021-01-29 07:20:14
问题 My project uses itext7 to create PDF files. When I launch from eclipse everything works perfectly. When I package it as a jar, everything works until I get to the point that I want to create a PDF. I then get: Exception in thread "JavaFX Application Thread" com.itextpdf.io.IOException: I/O exception. ..... Caused by: java.io.FileNotFoundException: C:\Users\puser\eclipse-workspace\Document\target\SE001-0.1.1-SNAPSHOT.jar\img\Safety.png (The system cannot find the path specified) The project

allow arabic text in pdf table using itext7 (xamarin android)

我只是一个虾纸丫 提交于 2021-01-29 07:11:07
问题 I have to put my list data in a table in a pdf file. My data has some Arabic words. When my pdf is generated, the Arabic words don't appear. I searched and found that I need itext7.pdfcalligraph so I installed it in my app. I found this code too https://itextpdf.com/en/blog/technical-notes/displaying-text-different-languages-single-pdf-document and tried to do something similar to allow Arabic words in my table but I couldn't figure it out. This is a trial code before I apply it to my real