> Am 28.04.2017 um 10:03 schrieb Mickael Marrache <[email protected]>: > > Yes - I'm looking for a Java library. I heard about iText and BFO but they > are not free. Also heard about Apache FOP but I'm not sure if it is > applicable.
many are not free for commercial use. in addition to the ones you mentioned Datalogics PDF Java Toolkit http://www.datalogics.com/products/pdf/pdfjavatoolkit/ PDFTron http://www.pdftron.com/pdfnet/index.html Quoppa https://www.qoppa.com/pdffields/ to name some. Apache FOP would be a good option for PDF generation from scratch. There might be others I'm not aware of which can fulfill your needs. Maybe some more people comment on that thread. Maruan PS: implementing complex-text support for PDFBox will propably be several weeks (if not months) effort. > > Thanks, > Mickael > > On Fri, Apr 28, 2017 at 8:59 AM, Maruan Sahyoun <[email protected]> > wrote: > >> Hi, >>> Am 28.04.2017 um 05:44 schrieb Mickael Marrache < >> [email protected]>: >>> >>> Thanks for looking at this. >>> >>> Is there an estimate for when PDFBox will be able to support it? >>> >> >> no, as this is a volunteers effort I can't give you any timing on this. We >> are planning to do it but maybe in another major release as one of the >> options we are looking into is dependent on Java 8 (and we are just moving >> to Java 7 for PDFBox 3.0). >> >> Is it Java libraries you are looking for? I could give you some names but >> as I havn't tried filling forms in Hebrew with these I don't know if they >> are able to handle your requirements. >> >> BR >> Maruan >> >> >>> Could you please propose alternative libraries that we can use in the >>> meantime? Free libraries preferred but not only. >>> >>> Thanks, >>> Mickael >>> >>> Le 28 avr. 2017 01:14, "Maruan Sahyoun" <[email protected]> a >> écrit : >>> >>>> OK, I had a look at this. >>>> >>>> At this point in time PDFBox doesn't support the appearance generation >> for >>>> RTL text. The reason you see the text reverted is because one would >> need to >>>> handle the text in visual order. >>>> >>>> So where PDFBox writes the string as >>>> >>>> \000\250\000\243\000\245\000\232\000\246 >>>> >>>> Adobe Reader writes the string as >>>> >>>> \000\246\000\232\000\245\000\243\000\250 >>>> >>>> This could be fixed but wouldn't be sufficient to completely handle >> Hebrew >>>> and other languages whith complex-text requirements (word forming, >>>> character shaping, BIDI …). >>>> >>>> At that point in time PDFBox doesn't provide the capabilites needed. >>>> >>>> BR >>>> Maruan >>>> >>>> >>>>> Am 26.04.2017 um 12:34 schrieb Mickael Marrache < >>>> [email protected]>: >>>>> >>>>> The PDF before filling: >>>>> >>>>> http://docdro.id/ybLln7x >>>>> >>>>> The PDF after filling: >>>>> >>>>> http://docdro.id/QcZfT9H >>>>> >>>>> On 2017-04-26 10:56 (+0300), Maruan Sahyoun <[email protected]> >>>> wrote: >>>>>> Hi, >>>>>> >>>>>>> Am 26.04.2017 um 08:19 schrieb Mickael Marrache < >>>> [email protected]>: >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I'm trying to fill a PDF form using PDFBox 2.0.5 as follows: >>>>>>> >>>>>>> PDDocument pdfDocument = >>>>>>> PDDocument.load(this.getClass().getClassLoader(). >>>> getResourceAsStream("form.pdf")); >>>>>>> PDAcroForm acroForm = pdfDocument.getDocumentCatalog(). >> getAcroForm(); >>>>>>> >>>>>>> PDResources formResources = acroForm.getDefaultResources(); >>>>>>> PDTrueTypeFont font = (PDTrueTypeFont) >>>>>>> formResources.getFont(COSName.getPDFName("David,Bold")); >>>>>>> >>>>>>> TrueTypeFont ttFont = font.getTrueTypeFont(); >>>>>>> >>>>>>> PDFont font2 = PDType0Font.load(pdfDocument, ttFont, true); >>>>>>> ttFont.close(); >>>>>>> >>>>>>> formResources.put(COSName.getPDFName("F0"), font2); >>>>>>> >>>>>>> if (acroForm != null) { >>>>>>> PDTextField field = (PDTextField) acroForm.getField("full_name"); >>>>>>> field.setDefaultAppearance("/F0 10 Tf 0 g"); >>>>>>> field.setValue(/* hebrew text here*/); >>>>>>> } >>>>>>> >>>>>>> File targetFile = File.createTempFile("", ".pdf"); >>>>>>> pdfDocument.save(targetFile); >>>>>>> pdfDocument.close(); >>>>>>> >>>>>>> The reason I embed the David,Bold font is explained here >>>>>>> http://stackoverflow.com/questions/42903217/write- >>>> cyrillic-chars-into-pdf-form-fields-with-pdfbox >>>>>> >>>>>> >>>>>> could you upload a PDF before and after filling to a public location? >>>>>> >>>>>> BR >>>>>> Maruan >>>>>> >>>>>> >>>>>>> . >>>>>>> >>>>>>> The issue is that the resulting PDF file has the text in the >> full_name >>>>>>> textbox displayed in the reverse direction. However, if I click on >> the >>>>>>> textbox, the text appears correctly. I precise that the text filled >> in >>>> the >>>>>>> textbox is in Hebrew (right-to-left). >>>>>>> >>>>>>> Any idea? >>>>>>> >>>>>>> Thanks, >>>>>>> Mickael >>>>>> >>>>>> >>>>>> --------------------------------------------------------------------- >>>>>> To unsubscribe, e-mail: [email protected] >>>>>> For additional commands, e-mail: [email protected] >>>>>> >>>>>> >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: [email protected] >>>>> For additional commands, e-mail: [email protected] >>>>> >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: [email protected] >>>> For additional commands, e-mail: [email protected] >>>> >>>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

