itext

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

iText-5.0.1 + Make the border of PdfPTable with dotted line

徘徊边缘 提交于 2019-12-24 10:58:00
问题 Is there any way to make the border of a cell with dotted line (e.g _ _ _ _ _ _ _ _ _ _ _ _) instead of solid line ( e.g ________________ ) in iText-5.0.1???? 回答1: could you rig something like adding new paragraphs with small height and text="---------" PdfPCell Cell = new PdfPCell(new Paragraph("------")); Cell.Height = 0.2f; You can also draw the borders yourself using a PdfPCellEvent. There are different layers to add to. See the API here: http://api.itextpdf.com/com/itextpdf/text/pdf

Can't add ltv to PDF document. Error

柔情痞子 提交于 2019-12-24 10:46:09
问题 I'm sign document, using Itext. I have that method: public static void sign(String src, String dest, Certificate[] chain,PrivateKey pk, String digestAlgorithm, String provider,CryptoStandard subfilter, TSAClient tsa ) { // Creating the reader and the stamper PdfReader reader = new PdfReader(src); FileOutputStream os = new FileOutputStream(dest); PdfStamper stamper = PdfStamper.createSignature(reader, os, '\0'); // Creating the appearance PdfSignatureAppearance appearance = stamper

Custom-built iText version required by JasperReports library?

纵然是瞬间 提交于 2019-12-24 10:45:06
问题 I tried to add jasper reports library ( net.sf.jasperreports:jasperreports:5.2.0 ) as a maven dependency to my project , unfortunately one of it's dependencies com.lowagie:itext:2.1.7.js2 is a little bit untypical and cannot be located in maven central. I've found, however, that it's available at http://jasperreports.sourceforge.net/maven2/com/lowagie/itext/ . My questions are: What is the purpose of jaspersoft custom-build of iText? Patches? Is it safe to use regular iText library, version 2

Hide / Remove columns when exporting to PDF document using iTextSharp

对着背影说爱祢 提交于 2019-12-24 10:18:26
问题 I have a GridView with data. Some of the columns in my Gridview are hidden visible=false . I am trying to export the GridView to a PDF document using iTextSharp but the columns that are set to visible=false are also showing in my PDF document and I don't want that. How can I export my GridView data to a PDF document without the hidden columns? This is what I've done so far: protected void Button1_Click(object sender, EventArgs e) { PdfPTable pdfTable = new PdfPTable(gvSchedule.HeaderRow.Cells

PdfTable isn't added to my document

我只是一个虾纸丫 提交于 2019-12-24 10:00:04
问题 Here's the code: public void PrintBoletin(int studentId, int gradeParaleloId) { StudentRepository studentRepo = new StudentRepository(); var student = studentRepo.FindStudent(studentId); int rowHeight = 20; string filePath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "\\Boletin.pdf"; Document document = new Document(PageSize.LETTER); BaseFont baseFont = BaseFont.CreateFont(BaseFont.COURIER, BaseFont.CP1250, BaseFont.EMBEDDED); Font font = new Font(baseFont, 8);

Java iText and custom Radiobutton behaviour

霸气de小男生 提交于 2019-12-24 09:48:41
问题 I am using iText 2.1.7. I have three radiobuttons in a table cell. Initial all buttons (b1, b2 and b3) are unchecked. Desired behaviour: If Check b1: b2 & b3 to uncheck If Check b2: b1 to uncheck If Check b3: b1 to uncheck So b2 and b3 can be checked at the same time. Additionally i want that all buttons can be toggled to off again. How can i achieve that behaviour? Help appreciated! 回答1: Before I fully answer your question have a look a the example behavior - is that what you want? Do you

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

iTextSharp Fill Pdf Form Image Field

荒凉一梦 提交于 2019-12-24 09:26:57
问题 I created a pdf form with Acrobat DC 2015. I have a image field on it. I fill text field succesfully. But I don't know how to fill image field. Do you help me? private static void FillPdfForm() { // Original File const string pdfTemplate = @"pdf\form.pdf"; // New file which will be created after fillin PDF var newFile = @"pdf\FilledCV.PDF"; var pdfReader = new PdfReader(pdfTemplate); var pdfStamper = new PdfStamper(pdfReader, new FileStream( newFile, FileMode.Create)); var pdfFormFields =

itext, Flying Saucer: xhtml to pdf ClassCastException

巧了我就是萌 提交于 2019-12-24 09:07:49
问题 public void createPDF() { FacesContext facesContext = FacesContext.getCurrentInstance(); ExternalContext externalContext = facesContext.getExternalContext(); HttpSession session = (HttpSession) externalContext.getSession(true); String url = "http://localhost:8080/comap/pages/admin/student.xhtml"; try { ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(url); renderer.layout(); HttpServletResponse response = (HttpServletResponse) externalContext.getResponse(); response.reset();