Replace text and adjust text positon

2016-05-20 Thread Thiruppathi M .
Hi, We are using Pdfbox for our internal pdf file automation. We struck in line adjustment. Refer the below input pdf file screen shot: [cid:image003.png@01D1B2BD.698964B0] For example: Here we need to replace the content "2016 Elsevier Ltd. All rights reserved." To below mention format Cas

Re: Setting base font from name as string

2016-05-20 Thread Peter Prusi
Exactly, I get some parameters like font name and size from a json file. So I dont know these at first. Am 20.05.2016 um 19:39 schrieb Tilman Hausherr: But how does it come that you have a name in the first place? It is normally a fixed decision to use a specific font when creating a file. Or

Re: Setting base font from name as string

2016-05-20 Thread Tilman Hausherr
But how does it come that you have a name in the first place? It is normally a fixed decision to use a specific font when creating a file. Or are you creating a file from parameters that are transmitted over a network, e.g. in an XML file, that has these names? Tilman Am 20.05.2016 um 19:16 s

Re: Setting base font from name as string

2016-05-20 Thread Peter Prusi
Not exactly. In my case, I dont know which font should be used. I am getting a string which respresents the font name. For example I could make a big switch/case block: switch (fontName) { case "HELVETICA": PDFont font = PDType1Font.HELVETICA; break; ...

Re: Setting base font from name as string

2016-05-20 Thread Tilman Hausherr
Just use the static variables, e.g. PDType1Font.HELVETICA. Is this what you had in mind? Tilman Am 20.05.2016 um 18:42 schrieb Peter Prusi: No, I like to use one of the 14 fonts defined in PDType1Font class. In version 1.8 it was possible to pass a font name to the PDType1Font constructor (PD

Re: Setting base font from name as string

2016-05-20 Thread Peter Prusi
No, I like to use one of the 14 fonts defined in PDType1Font class. In version 1.8 it was possible to pass a font name to the PDType1Font constructor (PDType1Font(String baseFont)) to create a PDType1Font object with given name. In version 2.0 this constructor is private. In 1.8 I see also a fu

Re: Setting base font from name as string

2016-05-20 Thread Tilman Hausherr
Am 20.05.2016 um 15:41 schrieb Peter Prusinowski: Hello, I am trying set a base font from its name as string. In PDType1Font class, there is a constructor for this purpose: PDType1Font(String baseFont), but only private accessible. I also tried with FontMappers class without success. Can anyo

Setting base font from name as string

2016-05-20 Thread Peter Prusinowski
Hello, I am trying set a base font from its name as string. In PDType1Font class, there is a constructor for this purpose: PDType1Font(String baseFont), but only private accessible. I also tried with FontMappers class without success. Can anyone help me ? Thank you --

Re: After using 'PrinterJob' to print a PDF form, the form fields are empty (PDFBox 2.0.0)

2016-05-20 Thread Maruan Sahyoun
Hi, > Am 20.05.2016 um 10:43 schrieb Maruan Sahyoun : > > Hi, >> Am 20.05.2016 um 09:49 schrieb Timo Rumland : >> >> Hi Maruan, >> >>> you can change your code like this to use Helvetica. >>> [...] >> >> you saved my day, sir! It works like a charm, thank you very much. > > Good to hear that,

Re: After using 'PrinterJob' to print a PDF form, the form fields are empty (PDFBox 2.0.0)

2016-05-20 Thread Maruan Sahyoun
Hi, > Am 20.05.2016 um 09:49 schrieb Timo Rumland : > > Hi Maruan, > >> you can change your code like this to use Helvetica. >> [...] > > you saved my day, sir! It works like a charm, thank you very much. Good to hear that, > > > To summarize it - I encountered two problems: > > > 1. "Invi

AW: After using 'PrinterJob' to print a PDF form, the form fields are empty (PDFBox 2.0.0)

2016-05-20 Thread Timo Rumland
Hi Maruan, > you can change your code like this to use Helvetica. > [...] you saved my day, sir! It works like a charm, thank you very much. To summarize it - I encountered two problems: 1. "Invisible" form field content. Workaround: Setting 'pdAcroForm.setNeedAppearances( false )',