WriteToDoc(ref cb, j.ToString(), j, 780) //Write the line number WriteToDoc(ref cb, j.ToString(), j, 10) //Write the line number PdfContentByte cb = writer.DirectContent įor (int i = 0 i < reader.NumberOfPages i++)īaseFont bf = BaseFont.CreateFont(BaseFont.HELVETICA_BOLD, BaseFont.CP1252, BaseFont.NOT_EMBEDDED) PdfWriter writer = PdfWriter.GetInstance(document, fs) size = reader.GetPageSizeWithRotation(1) įileStream fs = new FileStream(newFile, FileMode.Create, FileAccess.Write) PdfReader reader = new PdfReader(oldFile) And on the 4th and 5th pages, there are boxes that don't get populated, but they don't seem to be images. There is an image in the original pdf in this spot. In this example, there is a box in the upper left corner of every page that doesn't get populated. Here is the code I am using.With this I am trying to basically overlay graph paper on top of the PDF. I also tried using DirectContentUnder as was suggested in this link to no avail. Has anyone had any issues adding text being hidden using Itextsharp? It seems that the text I am adding is showing up behind the content that is already on the page? I flattened the pdf document down to it just being images but I am still having the same issue happen with the flattened file. I am finding that in some areas of the file, the text doesn't show up. ITextSharp insert text to an existing pdfīasically it uses the PdfContentByte and then adds the content template to the page. I am adding text to an already created pdf document using this method.
0 Comments
Leave a Reply. |