Re: Migrate form field entries from one pdf to another

2015-06-28 Thread Maruan Sahyoun
Hi, > Am 28.06.2015 um 22:18 schrieb Roberto Nibali : > > Hi > > >else if (f instanceof PDCheckbox) >>{ >>fieldValue = fieldValues.get(fieldName); >> > > How is this supposed to work? The value one gets via getValue() from the > PDField is a

Re: PdfBox 2.0 scale to A4 while printing document

2015-06-28 Thread John Hewson
> On 28 Jun 2015, at 11:04, Alex Sviridov wrote: > > Uff! I have finally made it to work. The following code prints with normal > margins: > > PrinterJob job = PrinterJob.getPrinterJob(); > Paper paper=new Paper(); > paper.setSize(72d*8.267d, 72d*11.692d); >

Re: PdfBox 2.0 scale to A4 while printing document

2015-06-28 Thread Tilman Hausherr
Thanks... I wonder what we'll do in the countries that don't use A4? According to wikipedia, this is North America, Bolivia, Colombia, Panama, Venezuela, the Philippines, Costa Rica, Dominican Republic, and Chile. We'd need to set up some default that will work in any country, e.g. by getting t

Re: Fwd: Migrate form field entries from one pdf to another

2015-06-28 Thread Tilman Hausherr
Am 28.06.2015 um 22:18 schrieb Roberto Nibali: Hi else if (f instanceof PDCheckbox) { fieldValue = fieldValues.get(fieldName); How is this supposed to work? The value one gets via getValue() from the PDField is always null for PDCheckbox

Re: Migrate form field entries from one pdf to another

2015-06-28 Thread Roberto Nibali
Hi The template PDF has the exact same form fields (and also javascript code behind the form events) as the source PDF. So, I'd like to open the source PDF, get all filled out values (text, checkbox, pushbuttons, you name it) and put it into the template PDF and store it as a new output PDF. Back

Re: Fwd: Migrate form field entries from one pdf to another

2015-06-28 Thread Roberto Nibali
Hi else if (f instanceof PDCheckbox) > { > fieldValue = fieldValues.get(fieldName); > How is this supposed to work? The value one gets via getValue() from the PDField is always null for PDCheckboxes. > if (("TRUE".equalsIg

Re: Migrate form field entries from one pdf to another

2015-06-28 Thread Maruan Sahyoun
Hi, > Am 28.06.2015 um 21:51 schrieb Roberto Nibali : > > Hi > > Thanks for the quick reply. This is exactly the approach I wanted to take > for my next option. > > On Sun, Jun 28, 2015 at 8:54 PM, Tilman Hausherr > wrote: > >> Here's some code I have from working on >> https://issues.apache.

Re: Fwd: Migrate form field entries from one pdf to another

2015-06-28 Thread Roberto Nibali
Hi Thanks for the quick reply. This is exactly the approach I wanted to take for my next option. On Sun, Jun 28, 2015 at 8:54 PM, Tilman Hausherr wrote: > Here's some code I have from working on > https://issues.apache.org/jira/browse/PDFBOX-2249 with the file > JMACTest.pdf that is in that iss

Re: Fwd: Migrate form field entries from one pdf to another

2015-06-28 Thread Tilman Hausherr
Here's some code I have from working on https://issues.apache.org/jira/browse/PDFBOX-2249 with the file JMACTest.pdf that is in that issue. While that issue was about listbox controls, the PDF file JMACTest.pdf does also have some radio and checkbox elements. Of the attached code, I tested chan

Re[2]: PdfBox 2.0 scale to A4 while printing document

2015-06-28 Thread Alex Sviridov
Uff! I have finally made it to work. The following code prints with normal margins:     PrinterJob job = PrinterJob.getPrinterJob();     Paper paper=new Paper();     paper.setSize(72d*8.267d, 72d*11.692d);     paper.setImageableArea(0,0,72d*8.267d, 72d*11.692d);  

Re: PdfBox 2.0 scale to A4 while printing document

2015-06-28 Thread Tilman Hausherr
Thanks, I have opened an issue in JIRA. I can confirm it, and it is only in 2.0, not on 1.8 (which doesn't help, because 1.8 doesn't render your fonts properly) https://issues.apache.org/jira/browse/PDFBOX-2844 Tilman Am 28.06.2015 um 18:01 schrieb Alex Sviridov: The file I tested is here

Fwd: Migrate form field entries from one pdf to another

2015-06-28 Thread Roberto Nibali
Hi I'm working on a project that involves the migration of existing PDFs (with filled forms) to the new template PDFs. The new templates should contain the same fully qualified field names, so basically my naive approach was to: 1. Scan the original PDF (input PDF) and put all found PDfield entri

Re: Re[2]: PDFBox 2.0 how to print certain page

2015-06-28 Thread John Hewson
> On 28 Jun 2015, at 09:05, Alex Sviridov wrote: > > Thank you for your help. I wrote new message to mailing list. I think that my > mailing service is also a little buggy :) > > I can't understand why it became so complicated? Maybe there are simpler ways? It certainly doesn't need to be so

Re[2]: PDFBox 2.0 how to print certain page

2015-06-28 Thread Alex Sviridov
Thank you for your help. I wrote new message to mailing list. I think that my mailing service is also a little buggy :) I can't understand why it became so complicated? Maybe there are simpler ways? Воскресенье, 28 июня 2015, 17:43 +02:00 от Tilman Hausherr : >Am 28.06.2015 um 16:02 schrie

Re[2]: PdfBox 2.0 scale to A4 while printing document

2015-06-28 Thread Alex Sviridov
The file I tested is here https://yadi.sk/i/iX-KJwlhhXMY2 I printed this pdf file with Adobe Reader in mode 100%. And as expected left and right margins are about 2cm. In comparison when I print using pdfbox left margin is 4.5cm, right about 3.5cm. The code I use : PrinterJob job = PrinterJob

Re: PDFBox 2.0 how to print certain page

2015-06-28 Thread Tilman Hausherr
Am 28.06.2015 um 16:02 schrieb Александр Свиридов: How can I print certain page using pdfbox 2.0? I don't do printing... I googled a bit and found this solution http://www.java2s.com/Code/Java/2D-Graphics-GUI/Printingofamultipagebook.htm that extends Printable, and limits the page in the

Re: PdfBox 2.0 scale to A4 while printing document

2015-06-28 Thread Tilman Hausherr
Hi, Something is indeed a bit tricky with your mailing software, your own comments are mixed with my comments. But I think I got them. Sorry for my "What else would you expect" comment, that was a failed attempt of being funny. I don't have LibreOffice installed, I don't know if the others d

Re[2]: PdfBox 2.0 scale to A4 while printing document

2015-06-28 Thread Александр Свиридов
Воскресенье, 28 июня 2015, 17:10 +02:00 от Tilman Hausherr : >Am 28.06.2015 um 16:43 schrieb Александр Свиридов: >> When I print pdf document it doesn't stretch to take normal A4 page area. >> I mean that margins are too big and document is smaller then it could be and >> is located in center

Re: PdfBox 2.0 scale to A4 while printing document

2015-06-28 Thread Tilman Hausherr
Am 28.06.2015 um 16:43 schrieb Александр Свиридов: When I print pdf document it doesn't stretch to take normal A4 page area. I mean that margins are too big and document is smaller then it could be and is located in center of the page. Yes it is centered. What else would you expect? Adjuste

PdfBox 2.0 scale to A4 while printing document

2015-06-28 Thread Александр Свиридов
When I print pdf document it doesn't stretch to take normal A4 page area. I mean that margins are too big and document is smaller then it could be and is located in center of the page. My code: PrinterJob job = PrinterJob.getPrinterJob(); Paper paper=new Paper(); paper.setSize(72d*8.267d, 72d*1

PdfBox 2.0 - printing using javafx printer job

2015-06-28 Thread Александр Свиридов
Is it possible to print pdf files using javafx.print.PrinterJob but not java.awt.print.PrinterJob?

PDFBox 2.0 how to print certain page

2015-06-28 Thread Александр Свиридов
How can I print certain page using pdfbox 2.0?

RE: features differences between PDFBox and ITEXT 5

2015-06-28 Thread Mark Bolduc
Thanks. Regards Mark Bolduc -Original Message- From: John Hewson [mailto:j...@jahewson.com] Sent: Sunday, June 28, 2015 12:13 AM To: users@pdfbox.apache.org Subject: Re: features differences between PDFBox and ITEXT 5 > On 26 Jun 2015, at 12:49, Mark Bolduc wrote: > > Hello folks, I

Re: PdfBox - extra symbols when converting pdf page to image

2015-06-28 Thread Tilman Hausherr
Already answered in https://stackoverflow.com/questions/31097691/extra-symbols-when-converting-pdf-to-image-with-pdfbox feel free to ask additional questions about the 2.0 version. See also https://pdfbox.apache.org/downloads.html#scm and https://pdfbox.apache.org/2.0/getting-started.html Tilman

PdfBox - extra symbols when converting pdf page to image

2015-06-28 Thread Александр Свиридов
I use apache pfdbox 1.8.9. I have one page pdf file which contains text and I want to convert this page to image. This pdf file I did via Libre Office. I use the following code: PDDocument document =PDDocument.loadNonSeq(newFile(filename),null); List pdPages = document.getDocumentCatalog().getAl