itext7

How do i use itext7.pdfhtml in AGPL mode?

本秂侑毒 提交于 2020-01-04 03:01:07
问题 I'm trying to use itext7.pdfhtml to convert a html string to a pdf document in a C# .Net project. When I run this code: iText.Html2pdf.HtmlConverter.ConvertToPdf(htmlString, pdfStream) I get the following exception: iText.License.LicenseKeyException: License file for product not loaded . I don't want to load a trial license or a commercial license. I want to run itext7 in AGPL mode. How do I do that? I'm using: itext7 v7.0.3 itext7.licensekey v2.0.4 itext7.pdfhtml v1.0.0.2 回答1: You can't.

What replaces chunk in iText 7?

眉间皱痕 提交于 2020-01-03 07:31:33
问题 Attempting to use iText 7 in java. Want to have part of a paragraph be bold. Apparently in earlier releases this was done by formatting "chunks" separately then adding them to the paragraph. Apparently "chunks" don't exist in iText 7. What is the procedure for iText 7? 回答1: Text in com.itextpdf.layout.element is meant to be an alternative for Chunk . To make a part of a paragraph bold, you would need a bold font to be specified for a piece of a text. Paragraph p = new Paragraph(); p.add(new

What replaces chunk in iText 7?

随声附和 提交于 2020-01-03 07:30:03
问题 Attempting to use iText 7 in java. Want to have part of a paragraph be bold. Apparently in earlier releases this was done by formatting "chunks" separately then adding them to the paragraph. Apparently "chunks" don't exist in iText 7. What is the procedure for iText 7? 回答1: Text in com.itextpdf.layout.element is meant to be an alternative for Chunk . To make a part of a paragraph bold, you would need a bold font to be specified for a piece of a text. Paragraph p = new Paragraph(); p.add(new

Continuous text in text-area cuts the PDF overflowing the text when using Itext 7.1.7

隐身守侯 提交于 2020-01-03 07:18:07
问题 I see there are lot many questions related to the same scenario this one is little different couldn't figure out the solution. I have a in a tabl in a cell. When I give the continous text like "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" Its overflowing the text when I download the print file and its normal when I give normal text with breaks.Here is my code .generaltable { background-color : #5C7FBF; border:thin; width : 100%;

iText 7 HTML to PDF conversion [duplicate]

寵の児 提交于 2019-12-31 03:57:06
问题 This question already has an answer here : iText 7 java.lang.NoSuchMethodError (1 answer) Closed 2 years ago . I am using iText 7 for PDF generation.I need to append Rich Text which having HTML document. In itext 5, i was using Chunk class for extracting data. But in itext 7 I don't see any API. And I tried with the code HtmlConverter.convertToPdf(is, os, properties); But it is giving below error. Exception in thread "main" java.lang.NoSuchMethodError: com.itextpdf.layout.font.FontSet

iText 7 - Different footer on last page - Null pointer in PdfDictionary

浪尽此生 提交于 2019-12-31 03:45:12
问题 I am trying to implement a footer in iText7 , the footer should be different on the last page of the document, I have added an event handler which is called when the document is closed but trying to then loop over the pages causes a null pointer exception: java.lang.NullPointerException at com.itextpdf.kernel.pdf.PdfDictionary.get(PdfDictionary.java:482) at com.itextpdf.kernel.pdf.PdfDictionary.get(PdfDictionary.java:152) at com.itextpdf.kernel.pdf.PdfPage.newContentStream(PdfPage.java:777)

How to bring image to the front(of the text/image) or send the image to the back((of the text/image)) in IText7 using java?

為{幸葍}努か 提交于 2019-12-31 03:40:29
问题 How to bring image to the front(of the text/image) or send the image to the back((of the text/image)) in IText7(7.0.8) using Java? import java.io.FileNotFoundException; import java.io.IOException; import com.itextpdf.io.image.ImageData; import com.itextpdf.io.image.ImageDataFactory; import com.itextpdf.kernel.pdf.PdfDocument; import com.itextpdf.kernel.pdf.PdfReader; import com.itextpdf.kernel.pdf.PdfResources; import com.itextpdf.kernel.pdf.PdfWriter; import com.itextpdf.kernel.pdf.canvas

Why font is not being embedded to the PDF using content stream before in Itext7?

旧巷老猫 提交于 2019-12-29 09:32:33
问题 I am trying to add a watermark text with font Helvitica to a simple PDF using one of the examples provided in the IText examples site (https://developers.itextpdf.com/examples/stamping-content-existing-pdfs/clone-watermark-examples), but for some reason the PDF is not showing the font properly in the PDF. I looked at the pdf property fonts and it seems the font is not embedded to the PDF. I am using itext 7.0.8 version. Am I doing some thing wrong here. My Code: import java.io

Does iText (any version) work on Windows Azure websites?

余生长醉 提交于 2019-12-29 06:29:50
问题 There are many limitations with the Azure App Service (formerly websites), so I was wondering if iText's PDF creation tools still worked. Specifically, I will be converting HTML to PDF, including all manner of styles and images. Neither rotativa nor Pechkin work on Azure App Service due to its limitations. 回答1: There are many limitations with the Azure App Service (formerly websites), so I was wondering if iText's PDF creation tools still worked. Based on my test with following sample, I can

Calculate the width of a table in iText 7

≡放荡痞女 提交于 2019-12-25 19:13:05
问题 I use iText 7 with html2pdf 2.1.2 version and try to convert HTML file to PDF. I use HtmlConverter#convertToElements to process an html file. Then I would like to calculate the width of one of the elements (a table in particular). I have tried to implement custom TagWorker class, but i get table only after it's filled. Also tried convertToDocument and some other ways but with no success. Is there a way to get a table width at run time? Thanks in advance. 回答1: The bad news: in general, it's