Re: How to set the appearance stream entry for a PDAnnotation?

2015-08-14 Thread Maruan Sahyoun
Hi,

 Am 14.08.2015 um 01:07 schrieb Sameer Kalburgi sam...@fieldwire.com:
 
 As mentioned here: https://issues.apache.org/jira/browse/PDFBOX-2019, I'm
 trying to generate an appearance stream so viewers beyond Adobe Acrobat
 will correctly display annotations.
 
 What exactly is supposed to go into the appearance dictionary for a
 PDAnnotationPolyline or PDAnnotationPolygon?

the details of the content of the appearance stream for annotations - as 
Acrobat creates them - are not part of the PDF specification. What I've done 
when looking at doing the same for form fields is have some sample files 
created with Acrobat, inspecting the content using the PDFDebugger and 
replicate that.

BR
Maruan


 
 Ref:
 http://pdfbox.apache.org/docs/1.8.9/javadocs/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.html#setAppearance(org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary)


-
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



Re: Something weird with PDFMergerUtility?

2015-08-14 Thread Magnus Evensberget
files are here: https://github.com/magnusev/PdfBoxMergeProblem

I use the newest version of the 2.0.0-SNAPSHOT

hope you can help :)


On Thu, 13 Aug 2015 at 22:56 Tilman Hausherr thaush...@t-online.de wrote:

 Hi,

 Can you tell what version you are using? And can you upload these files
 somewhere?

 Tilman

 Am 13.08.2015 um 21:10 schrieb Magnus Evensberget:
  I have the following example:
 
  PDDocument document = new PDDocument();
  PDDocument d = PDDocument.load(documentBytes.get());
 
  PDFMergerUtility merger = new PDFMergerUtility();
  merger.appendDocument(document, d);
  merger.appendDocument(document, d);
 
  document.save(c:/test/blankDocWithFields.pdf);
 
  the document has one textfield
 
  The PDF saved has both pages, but the page content is gone, leaving only
  the textfields to write in on both pages.
 
  It worked before I went on Holiday but when I came back one week later it
  did not work.
 


 -
 To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
 For additional commands, e-mail: users-h...@pdfbox.apache.org




Re: Something weird with PDFMergerUtility?

2015-08-14 Thread Tilman Hausherr

Am 14.08.2015 um 12:03 schrieb Andreas Lehmkühler:



Magnus Evensberget magnus.evensber...@gmail.com hat am 14. August 2015 um
10:21 geschrieben:


Rolled back to the commit c343a3f and then it works.

We are working with svn and I guess you are referring to the PDFBox github
mirror, aren't you? That git commit refers to rev 1693855.


Oh-oh. The next one is the huge COSStream change. (1694004)

Tilman



BR
Andreas


On Fri, 14 Aug 2015 at 09:04 Magnus Evensberget 
magnus.evensber...@gmail.com wrote:


files are here: https://github.com/magnusev/PdfBoxMergeProblem

I use the newest version of the 2.0.0-SNAPSHOT

hope you can help :)


On Thu, 13 Aug 2015 at 22:56 Tilman Hausherr thaush...@t-online.de
wrote:


Hi,

Can you tell what version you are using? And can you upload these files
somewhere?

Tilman

Am 13.08.2015 um 21:10 schrieb Magnus Evensberget:

I have the following example:

PDDocument document = new PDDocument();
PDDocument d = PDDocument.load(documentBytes.get());

PDFMergerUtility merger = new PDFMergerUtility();
merger.appendDocument(document, d);
merger.appendDocument(document, d);

document.save(c:/test/blankDocWithFields.pdf);

the document has one textfield

The PDF saved has both pages, but the page content is gone, leaving only
the textfields to write in on both pages.

It worked before I went on Holiday but when I came back one week later

it

did not work.



-
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



Re: Something weird with PDFMergerUtility?

2015-08-14 Thread Magnus Evensberget
Rolled back to the commit c343a3f and then it works.

On Fri, 14 Aug 2015 at 09:04 Magnus Evensberget 
magnus.evensber...@gmail.com wrote:

 files are here: https://github.com/magnusev/PdfBoxMergeProblem

 I use the newest version of the 2.0.0-SNAPSHOT

 hope you can help :)


 On Thu, 13 Aug 2015 at 22:56 Tilman Hausherr thaush...@t-online.de
 wrote:

 Hi,

 Can you tell what version you are using? And can you upload these files
 somewhere?

 Tilman

 Am 13.08.2015 um 21:10 schrieb Magnus Evensberget:
  I have the following example:
 
  PDDocument document = new PDDocument();
  PDDocument d = PDDocument.load(documentBytes.get());
 
  PDFMergerUtility merger = new PDFMergerUtility();
  merger.appendDocument(document, d);
  merger.appendDocument(document, d);
 
  document.save(c:/test/blankDocWithFields.pdf);
 
  the document has one textfield
 
  The PDF saved has both pages, but the page content is gone, leaving only
  the textfields to write in on both pages.
 
  It worked before I went on Holiday but when I came back one week later
 it
  did not work.
 


 -
 To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
 For additional commands, e-mail: users-h...@pdfbox.apache.org




Re: Something weird with PDFMergerUtility?

2015-08-14 Thread Tilman Hausherr

Am 14.08.2015 um 16:00 schrieb Tilman Hausherr:

Am 14.08.2015 um 12:03 schrieb Andreas Lehmkühler:


Magnus Evensberget magnus.evensber...@gmail.com hat am 14. August 
2015 um

10:21 geschrieben:


Rolled back to the commit c343a3f and then it works.
We are working with svn and I guess you are referring to the PDFBox 
github

mirror, aren't you? That git commit refers to rev 1693855.


Oh-oh. The next one is the huge COSStream change. (1694004)


It is definitely a regression in
https://issues.apache.org/jira/browse/PDFBOX-2893 ,
I have reopened it.

Tilman

-
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



Problems Using PDFBox To Manually Track TextPosition

2015-08-14 Thread John Walker
Hello,

 

I'm using PDFBox to parse the contentstream for a page in a PDF.   Based on
the list of operations, there are two lines of text that I expect to be in
very different places on the page vertically.  However, when the page is
displayed in Sumatra or Acrobat, this text is vertically aligned.

 

The method I'm using to predict text position has been accurate in the past.
I'm not sure if the method is faulty, or if I'm mis-understanding the
operation list I'm getting from PDFBox.

 

Here is the list of operations, with annotations explaining how I think they
should impact vertical position of text cursor: 

 

http://pastebin.com/GUWWX3Kv

 

As you can see, I'm basically only moving my model of the cursor in reaction
to Tm's and Td's.  (TJ's aren't relevant because text is horizontal and the
y position is the one I'm tracking.)   I also ignored the cm, because
there's a Tm right after it.

 

Am I mis-interpreting the PDF Operators (as I suspect)?  Is there any
potential that this is a PDFBox issue?  

 

Thanks in advance!

 

-John 



Re: Something weird with PDFMergerUtility?

2015-08-14 Thread Tilman Hausherr

Am 14.08.2015 um 09:04 schrieb Magnus Evensberget:

files are here: https://github.com/magnusev/PdfBoxMergeProblem

I use the newest version of the 2.0.0-SNAPSHOT

hope you can help :)


Please try again, I fixed the regression. (hopefully!!!)
See near the bottom at
https://issues.apache.org/jira/browse/PDFBOX-2893

Tilman






On Thu, 13 Aug 2015 at 22:56 Tilman Hausherr thaush...@t-online.de wrote:


Hi,

Can you tell what version you are using? And can you upload these files
somewhere?

Tilman

Am 13.08.2015 um 21:10 schrieb Magnus Evensberget:

I have the following example:

PDDocument document = new PDDocument();
PDDocument d = PDDocument.load(documentBytes.get());

PDFMergerUtility merger = new PDFMergerUtility();
merger.appendDocument(document, d);
merger.appendDocument(document, d);

document.save(c:/test/blankDocWithFields.pdf);

the document has one textfield

The PDF saved has both pages, but the page content is gone, leaving only
the textfields to write in on both pages.

It worked before I went on Holiday but when I came back one week later it
did not work.



-
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



Re: Something weird with PDFMergerUtility?

2015-08-14 Thread Andreas Lehmkühler


 Magnus Evensberget magnus.evensber...@gmail.com hat am 14. August 2015 um
 10:21 geschrieben:
 
 
 Rolled back to the commit c343a3f and then it works.
We are working with svn and I guess you are referring to the PDFBox github
mirror, aren't you? That git commit refers to rev 1693855.

BR
Andreas

 
 On Fri, 14 Aug 2015 at 09:04 Magnus Evensberget 
 magnus.evensber...@gmail.com wrote:
 
  files are here: https://github.com/magnusev/PdfBoxMergeProblem
 
  I use the newest version of the 2.0.0-SNAPSHOT
 
  hope you can help :)
 
 
  On Thu, 13 Aug 2015 at 22:56 Tilman Hausherr thaush...@t-online.de
  wrote:
 
  Hi,
 
  Can you tell what version you are using? And can you upload these files
  somewhere?
 
  Tilman
 
  Am 13.08.2015 um 21:10 schrieb Magnus Evensberget:
   I have the following example:
  
   PDDocument document = new PDDocument();
   PDDocument d = PDDocument.load(documentBytes.get());
  
   PDFMergerUtility merger = new PDFMergerUtility();
   merger.appendDocument(document, d);
   merger.appendDocument(document, d);
  
   document.save(c:/test/blankDocWithFields.pdf);
  
   the document has one textfield
  
   The PDF saved has both pages, but the page content is gone, leaving only
   the textfields to write in on both pages.
  
   It worked before I went on Holiday but when I came back one week later
  it
   did not work.
  
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
  For additional commands, e-mail: users-h...@pdfbox.apache.org
 
 

-
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



Re: Something weird with PDFMergerUtility?

2015-08-14 Thread Magnus Evensberget
That is correct.

On Fri, 14 Aug 2015 at 12:04 Andreas Lehmkühler andr...@lehmi.de wrote:



  Magnus Evensberget magnus.evensber...@gmail.com hat am 14. August
 2015 um
  10:21 geschrieben:
 
 
  Rolled back to the commit c343a3f and then it works.
 We are working with svn and I guess you are referring to the PDFBox github
 mirror, aren't you? That git commit refers to rev 1693855.

 BR
 Andreas

 
  On Fri, 14 Aug 2015 at 09:04 Magnus Evensberget 
  magnus.evensber...@gmail.com wrote:
 
   files are here: https://github.com/magnusev/PdfBoxMergeProblem
  
   I use the newest version of the 2.0.0-SNAPSHOT
  
   hope you can help :)
  
  
   On Thu, 13 Aug 2015 at 22:56 Tilman Hausherr thaush...@t-online.de
   wrote:
  
   Hi,
  
   Can you tell what version you are using? And can you upload these
 files
   somewhere?
  
   Tilman
  
   Am 13.08.2015 um 21:10 schrieb Magnus Evensberget:
I have the following example:
   
PDDocument document = new PDDocument();
PDDocument d = PDDocument.load(documentBytes.get());
   
PDFMergerUtility merger = new PDFMergerUtility();
merger.appendDocument(document, d);
merger.appendDocument(document, d);
   
document.save(c:/test/blankDocWithFields.pdf);
   
the document has one textfield
   
The PDF saved has both pages, but the page content is gone, leaving
 only
the textfields to write in on both pages.
   
It worked before I went on Holiday but when I came back one week
 later
   it
did not work.
   
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
   For additional commands, e-mail: users-h...@pdfbox.apache.org
  
  

 -
 To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
 For additional commands, e-mail: users-h...@pdfbox.apache.org