itext

How to add/project iTextSharp vectors

你说的曾经没有我的故事 提交于 2020-01-17 01:32:07
问题 The Question The PDF toolkit iText(Sharp) has its own vector type, implementing Substract , Dot product Cross product and Multiply , but I do not see an addition of vectors nor a projection of one vector onto antother. Is there a simple way to do that? The context I am implementing an ITextExtractionStrategy that collects text into chunks ( class MyTextChunk ) if they are on the same line renderInfo.GetBaseline() follow closely to avoid concatenating texts from different columns in a table

How to set two different colors for a single string in itext

六眼飞鱼酱① 提交于 2020-01-16 19:18:31
问题 I have string like below, and i can't split the string. String result="Developed By : Mr.XXXXX"; i can create a paragraph in itext and set font with color like below, Font dataGreenFont = FontFactory.getFont("Garamond", 10,Color.GREEN); preface.add(new Paragraph(result, dataGreenFont)); it set the green color to entire text result but i want to set color only for Mr.XXXXX part. How do i do this? 回答1: First this: you are using an obsolete version of iText. Please upgrade! As for your question:

How to set two different colors for a single string in itext

一笑奈何 提交于 2020-01-16 19:17:13
问题 I have string like below, and i can't split the string. String result="Developed By : Mr.XXXXX"; i can create a paragraph in itext and set font with color like below, Font dataGreenFont = FontFactory.getFont("Garamond", 10,Color.GREEN); preface.add(new Paragraph(result, dataGreenFont)); it set the green color to entire text result but i want to set color only for Mr.XXXXX part. How do i do this? 回答1: First this: you are using an obsolete version of iText. Please upgrade! As for your question:

itext7 table SetFixedPosition on Page 1 fails

橙三吉。 提交于 2020-01-16 17:04:01
问题 I can´t believe, what I see.... I try to print a table with itext7 into a PDF on a defined page. The table-creation is made as last statement before finishing the PDF. The PDF has (after finishing) 5 pages. I can print the table to every page except the first page. This is my code: If placeOnPage = 0 Then table.SetFixedPosition(200, 250, 100) Else table.SetFixedPosition(placeOnPage, 200, 250, 100) End If If placeOnPage = 0, then the table is printed correctly on the last page. If I set

itext7 table SetFixedPosition on Page 1 fails

主宰稳场 提交于 2020-01-16 17:03:31
问题 I can´t believe, what I see.... I try to print a table with itext7 into a PDF on a defined page. The table-creation is made as last statement before finishing the PDF. The PDF has (after finishing) 5 pages. I can print the table to every page except the first page. This is my code: If placeOnPage = 0 Then table.SetFixedPosition(200, 250, 100) Else table.SetFixedPosition(placeOnPage, 200, 250, 100) End If If placeOnPage = 0, then the table is printed correctly on the last page. If I set

Add named destinations to an existing PDF document with iText

无人久伴 提交于 2020-01-16 11:26:30
问题 I have a PDF previously created with FOP, and I need to add some named destinations to it so later another program can open and navigate the document with the Adobe PDF open parameters, namely the #namedest=destination_name parameter. I don't need to add bookmarks or other dynamic content but just some destinations with a name and thus injecting a /Dests collection with names defined in the resulting PDF. I use iText 5.3.0 and I read the chapter 7 of iText in Action (2nd edition), but still I

Add named destinations to an existing PDF document with iText

青春壹個敷衍的年華 提交于 2020-01-16 11:26:24
问题 I have a PDF previously created with FOP, and I need to add some named destinations to it so later another program can open and navigate the document with the Adobe PDF open parameters, namely the #namedest=destination_name parameter. I don't need to add bookmarks or other dynamic content but just some destinations with a name and thus injecting a /Dests collection with names defined in the resulting PDF. I use iText 5.3.0 and I read the chapter 7 of iText in Action (2nd edition), but still I

itext or itextsharp - move text in an existing PDF

旧城冷巷雨未停 提交于 2020-01-16 05:25:23
问题 my goal is to move text in a PDF around, which is within a certain rectangular area. There is an existing Item on stackoverflow, which already got me close to achiving this: iText or iTextSharp rudimentary text edit However, I would be back at manipulating the PDF on a very basic level. Is there a chance to use higher level facilities of itext to alter the position of the text? I'm afraid there is no simple solution, but I'd be happy to get some suggestions. PS: Also keep in mind that I want

Itext combobox, width of selected option issue

寵の児 提交于 2020-01-16 04:58:08
问题 I have a problem with using Itext pdf. The problem is, after an option is selected and the pointer is focused on another element of pdf, the text in TextField is somehow cut off or some letters are floating over. What would be the solution? The image that shows what's going on Chunks of the code are @Override public void writePdfElement(RankingQuestionDTO input, Document document, PdfWriter writer, PdfPTable baseTable) { try{ PdfPTable table = new PdfPTable(2); PdfPCell cell; document.add(new

How can I replace text in PDF with iText without encoding issue? (Android)

て烟熏妆下的殇ゞ 提交于 2020-01-16 04:37:05
问题 I need some help. I want to replace a text with an another in a PDF file (I'm using iText library), but when I'm trying to do it with accent letters, it has encoding problems. public static void manipulatePdf(String src, String dest) throws IOException, DocumentException { PdfReader reader = new PdfReader(src); PdfDictionary dict = reader.getPageN(1); PdfObject object = dict.getDirectObject(PdfName.CONTENTS); if (object instanceof PRStream) { PRStream stream = (PRStream) object; byte[] data =