itext

iText: missing characters when converting PDF to Text

本秂侑毒 提交于 2019-12-25 16:54:20
问题 I am Trying to extract the text from the this pdf using the LocationTextExtractionStrategy.class, but for some reason a number of characters are being dropped during the parsing. On the first page of the original .pdf; 【表紙】 【提出書類】有価証券報告書 【根拠条文】金融商品取引法第24条第1項 【提出先】近畿財務局長 【提出日】平成22年6月28日 【事業年度】第27期(自 平成21年4月1日 至 平成22年3月31日) 【会社名】株式会社カネミツ 【英訳名】KANEMITSU CORPORATION Resulting text output has numbers such as 22,28 and the english text "KANEMATSU" missing; 【表紙】 【提出書類】 有価証券報告書 【根拠条文】 金融商品取引法第条第1項

Resizing a form field in iTextSharp

我们两清 提交于 2019-12-25 16:43:49
问题 I am adding a checkbox field to a table cell and it expands across the whole cell. Is there a way I can control the size of the element so it does not take up the whole cell? I found someone else asking the same question but it was from 2006 so I am hoping something is now available. One idea I had while writing this was to nest a new table in the table cell and try do some cell alignment trickery to get the checkbox center aligned but I have already had a shower today and do not want to take

Resizing a form field in iTextSharp

心已入冬 提交于 2019-12-25 16:43:25
问题 I am adding a checkbox field to a table cell and it expands across the whole cell. Is there a way I can control the size of the element so it does not take up the whole cell? I found someone else asking the same question but it was from 2006 so I am hoping something is now available. One idea I had while writing this was to nest a new table in the table cell and try do some cell alignment trickery to get the checkbox center aligned but I have already had a shower today and do not want to take

iText Pdf Merging Checkbox Issue

微笑、不失礼 提交于 2019-12-25 15:29:50
问题 We are using iText Pdf API version 5.5.3 and we are trying to merge pdf documents which sometimes contain checkboxes , we write pdf document in servlet output stream and displays in iframe. It works well in IE(tried in 11) but checkbox doesn't appear in Chrome(tried in 52). Below is the sample code we use to display PDF. InputStream in = docFile.getImage() .getBinaryStream(); reader = new PdfReader(in); pdfReaderList.add(reader); document = new Document(PageSize.A4); byteArrayOutputStream =

iText Pdf Merging Checkbox Issue

巧了我就是萌 提交于 2019-12-25 15:29:09
问题 We are using iText Pdf API version 5.5.3 and we are trying to merge pdf documents which sometimes contain checkboxes , we write pdf document in servlet output stream and displays in iframe. It works well in IE(tried in 11) but checkbox doesn't appear in Chrome(tried in 52). Below is the sample code we use to display PDF. InputStream in = docFile.getImage() .getBinaryStream(); reader = new PdfReader(in); pdfReaderList.add(reader); document = new Document(PageSize.A4); byteArrayOutputStream =

html tag not accepted in itextsharp and text out of borders

本秂侑毒 提交于 2019-12-25 14:48:58
问题 I created a table with itextsharp and filled it with data from my database. Everything is ok but some data contains html tags , so in my table I get the tags instead of the text formatted, also some of the text gets outside of the table border . Here is some code: PdfPTable table4 = new PdfPTable(3); PdfPCell cell8 = new PdfPCell(new Phrase("Protocol", new Font(FontFactory.GetFont("Helvetica", 12f, Font.BOLD, new BaseColor(0, 0, 0))))); cell8.BackgroundColor = new BaseColor(242, 242, 242);

How to set line width on template clipping

邮差的信 提交于 2019-12-25 12:40:54
问题 I have some PdfTemplate and I want to clip its shape to some path. I know how to do this, but the clipping line is always the same (probably 1 px) and I want to be able to change it. Is there any way to do this? Half-measures, like resizing template will not do the trick. Piece of code: PdfTemplate template = contentByte.CreateTemplate(100, 200); template.MoveTo(0, 0); template.LineTo(50, 50); template.LineTo(50, 0); template.LineTo(0, 50); template.SetLineWidth(5); template.Clip(); Image img

iText 2.1.7 PdfCopy.addPage(page) can't find page reference?

被刻印的时光 ゝ 提交于 2019-12-25 10:02:12
问题 I'm maintaining a web application that uses iText 2.1.7 to create PDFs. I want to take the content of an existing PDF and put it into the pdf document that the code is in the middle of creating. I have the following (EDIT: more complete code): package itexttest; import com.lowagie.text.Document; import com.lowagie.text.PageSize; import com.lowagie.text.Paragraph; import com.lowagie.text.pdf.PdfCopy; import com.lowagie.text.pdf.PdfImportedPage; import com.lowagie.text.pdf.PdfReader; import com

java.io.FileNotFoundException on Itextpdf Library tutorial

萝らか妹 提交于 2019-12-25 09:59:23
问题 I have been trying iTextpdf today ang got into some shoddy error. mainly: java.io.FileNotFoundException: /storage/emulated/0/Download/pdfdemo20170521_145348.pdf: open failed: EACCES (Permission denied) I have already implemented the proper permissions like <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> but it also does not work. here is the code for my file processing: public class

Add alternative text for an image in Tagged PDF in C#

一个人想着一个人 提交于 2019-12-25 09:44:40
问题 I need your help with this: public void manipulatePdf(String src, String dest) throws IOException, DocumentException { PdfReader reader = new PdfReader(src); PdfDictionary catalog = reader.getCatalog(); PdfDictionary structTreeRoot = catalog.getAsDict(PdfName.STRUCTTREEROOT); manipulate(structTreeRoot); PdfStamper stamper = new PdfStamper( reader, new FileOutputStream(dest)); stamper.close(); } public void manipulate(PdfDictionary element) { if (element == null) return; if (PdfName.FIGURE