[jira] [Commented] (PDFBOX-1695) Improve pdfbox tests

2015-08-10 Thread Tilman Hausherr (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-1695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680353#comment-14680353
 ] 

Tilman Hausherr commented on PDFBOX-1695:
-

The only thing I'm unhappy with is that the timeout is hardcoded in 
ParallelParameterized.

 Improve pdfbox tests
 

 Key: PDFBOX-1695
 URL: https://issues.apache.org/jira/browse/PDFBOX-1695
 Project: PDFBox
  Issue Type: Improvement
Affects Versions: 1.8.2, 2.0.0
Reporter: Tilman Hausherr
Assignee: Tilman Hausherr
Priority: Minor
  Labels: tdd, test-driven, testing
 Fix For: 2.0.0

 Attachments: ccitt4.tif, jbig2test-01.png, jbig2test.pdf


 I'd like to improve the tests for rendering.
 org/apache/pdfbox/util/TestPDFToImage.java is disabled in pdfbox\pom.xml . 
 This has been disabled since 2009 ?! So I enabled it here.
 The subdir rendering is missing in pdfbox\target\test-output for these tests
 When a test fails because the rendered image is not identical, no detailed 
 message appears on the console. It appears only in pdfbox.log and not on the 
 console.
 this is because of the settings in
 pdfbox\src\test\resources\logging.properties
 If this is on purpose, please change the texts in 
 pdfbox\src\test\java\org\apache\pdfbox\util\*.java from
 One or more failures, see test log for details
 to
 One or more failures, see test logfile 'pdfbox.log' for details
 I wanted to attach a PDF with ccitt g4 compression and its rendering created 
 with the 1.8.2 version, but it doesn't work out, seems that CIB generates 
 files that can be rendered properly with 1.8.2. However I attach the TIFF g4 
 file, and a JBIG2 test file from it. I don't have access to a Xerox 
 WorkCentre (enter jbig2 in google news :-) ) so I used a free service, so 
 there's a watermark.
 It should be included into
 pdfbox\src\test\resources\input\rendering
 I have created the image myself and I give it into the public domain.
 If my suggestion is accepted, it would be nice if people could create files 
 that fail in current versions or have failed in old versions, and release 
 these files to the public domain, so that they can be added to the tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2917) PDF to Image, faint/dim Images

2015-08-10 Thread Tilman Hausherr (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680333#comment-14680333
 ] 

Tilman Hausherr commented on PDFBOX-2917:
-

Sadly not very successful either:
- immo-kurier_arsenal_93x62.pdf the barcode now has the wrong color
- Page 3 of PDFBOX-2348.pdf is too dark
- the Braun file is unchanged. This could be because your patch doesn't change 
standard CMYK images, which do also use an ICC colorspace.

 PDF to Image, faint/dim Images
 --

 Key: PDFBOX-2917
 URL: https://issues.apache.org/jira/browse/PDFBOX-2917
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 2.0.0
 Environment: Windows 8.1, jdk1.8.0_51, jre1.8.0_51
Reporter: Samuil Goranov
Priority: Trivial
  Labels: images, newbie
 Attachments: PDFBOX-2917-v2.patch, 
 PDFBOX-2917__Use_linear_RGB_for_image_color_conversion_to_workaround_JDK_bug.patch,
  saved0.png, screenshot-1.png, selection.pdf


 {code:title=pdftoimage.java|borderStyle=solid}
 PDDocument document = null;
 File file = new File(F:\\Projects\\java\\pdfbox\\complete.pdf);
 document = PDDocument.load( file );
 try {
 // retrieve image
 BufferedImage bi = new PDFRenderer(document).renderImageWithDPI( 
 0 , 150, ImageType.RGB );
 File outputfile = new File(saved0.png);
 ImageIO.write(bi, png, outputfile);
 } catch (IOException e) {
 }
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2893) Simplify COSStream encoding and decoding

2015-08-10 Thread Tilman Hausherr (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680341#comment-14680341
 ] 

Tilman Hausherr commented on PDFBOX-2893:
-

got it and I agree and will do in PDFBOX-1695.

 Simplify COSStream encoding and decoding
 

 Key: PDFBOX-2893
 URL: https://issues.apache.org/jira/browse/PDFBOX-2893
 Project: PDFBox
  Issue Type: Improvement
Affects Versions: 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Blocker
 Fix For: 2.0.0

 Attachments: PDFBOX-2893-2.patch


 Performance issues and memory usage issues surrounding streams are one of the 
 few things blocking the release of 2.0 (see  PDFBOX-2301, PDFBOX-2882, 
 PDFBOX-2883).
 Though we've managed to reduce some of the memory used by RandomAccessBuffer 
 and to take advantage of buffering of scratch files, we still have problems 
 with the amount of memory which COSStream holds onto. Changes introduced in 
 2.0 have resulted in COSStreams having a very complex relationship with 
 classes which hold a lot of memory in complex ways (e.g. the fields: 
 tempBuffer, filteredBuffer, unfilteredBuffer, filteredStream, 
 unFilteredStream, scratchFile). Access to scratch file pages in particular 
 does not seem to be well regulated, especially with regards to multithreading 
 (an avenue we'd at least like to leave open).
 Given recent flux, I'm doubtful that we can ship the current API for 
 COSStream w.r.t. RandomAccess without shipping performance issues or flaws 
 which will be unfixable without breaking changes.
 One of the recent changes to COSStream is that it now exposes a RandomAccess, 
 this is so that PDFStreamParser can parse content streams (as well as other 
 subclasses which handle xref and object streams). However, streams are 
 fundamentally not random access - stream filters are sequential. While the 
 consumer of a stream may wish to buffer the data (in memory or scratch) for 
 random access, COSStream itself does not need to expose such an elaborate API 
 - many pieces of gymnastics are performed inside COSStream to present this 
 illusion, at significant cost. We should remove that.
 But what about providing a RandomAccess for PDFStreamParser, 
 PDFObjectStreamParser, and PDFXrefStreamParser? It turns out that those 
 classes don't actually perform random I/O. They perform sequential I/O with a 
 buffer for peek/unread.
 We need to simplify to get 2.0 fast, lean, and maintainable. Here's what I 
 think we should do:
 1. Split the interfaces for sequential and random I/O
 - Introduce a new SequentialSource interface for sequential I/O, with thin 
 wrappers for RandomAccessRead and InputStream.
 - BaseParser will use SequentialSource rather than RandomAccessRead (this 
 will be inherited by PDFStreamParser, PDFObjectStreamParser, and 
 PDFXrefStreamParser).
 - COSParser will use RandomAccessRead and pass a SequentialSource wrapper to 
 it's superclass, BaseParser.
 2. Remove RandomAccess APIs from COSStream, expose only InputStream and 
 OutputStream, as we used to do. We can pass an InputStream to PDFStreamParser 
 using a wrapper which implements SequentialSource. This will remove 
 tempBuffer, filteredBuffer, and unfilteredBuffer from COSStream, all of which 
 hold memory.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-1695) Improve pdfbox tests

2015-08-10 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-1695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680345#comment-14680345
 ] 

ASF subversion and git services commented on PDFBOX-1695:
-

Commit 1695134 from [~tilman] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1695134 ]

PDFBOX-1695: use a parameterized test as suggested by John Hewson, remove 
unused stuff

 Improve pdfbox tests
 

 Key: PDFBOX-1695
 URL: https://issues.apache.org/jira/browse/PDFBOX-1695
 Project: PDFBox
  Issue Type: Improvement
Affects Versions: 1.8.2, 2.0.0
Reporter: Tilman Hausherr
Assignee: Tilman Hausherr
Priority: Minor
  Labels: tdd, test-driven, testing
 Fix For: 2.0.0

 Attachments: ccitt4.tif, jbig2test-01.png, jbig2test.pdf


 I'd like to improve the tests for rendering.
 org/apache/pdfbox/util/TestPDFToImage.java is disabled in pdfbox\pom.xml . 
 This has been disabled since 2009 ?! So I enabled it here.
 The subdir rendering is missing in pdfbox\target\test-output for these tests
 When a test fails because the rendered image is not identical, no detailed 
 message appears on the console. It appears only in pdfbox.log and not on the 
 console.
 this is because of the settings in
 pdfbox\src\test\resources\logging.properties
 If this is on purpose, please change the texts in 
 pdfbox\src\test\java\org\apache\pdfbox\util\*.java from
 One or more failures, see test log for details
 to
 One or more failures, see test logfile 'pdfbox.log' for details
 I wanted to attach a PDF with ccitt g4 compression and its rendering created 
 with the 1.8.2 version, but it doesn't work out, seems that CIB generates 
 files that can be rendered properly with 1.8.2. However I attach the TIFF g4 
 file, and a JBIG2 test file from it. I don't have access to a Xerox 
 WorkCentre (enter jbig2 in google news :-) ) so I used a free service, so 
 there's a watermark.
 It should be included into
 pdfbox\src\test\resources\input\rendering
 I have created the image myself and I give it into the public domain.
 If my suggestion is accepted, it would be nice if people could create files 
 that fail in current versions or have failed in old versions, and release 
 these files to the public domain, so that they can be added to the tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-1695) Improve pdfbox tests

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-1695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680473#comment-14680473
 ] 

John Hewson commented on PDFBOX-1695:
-

:)

 Improve pdfbox tests
 

 Key: PDFBOX-1695
 URL: https://issues.apache.org/jira/browse/PDFBOX-1695
 Project: PDFBox
  Issue Type: Improvement
Affects Versions: 1.8.2, 2.0.0
Reporter: Tilman Hausherr
Assignee: Tilman Hausherr
Priority: Minor
  Labels: tdd, test-driven, testing
 Fix For: 2.0.0

 Attachments: ccitt4.tif, jbig2test-01.png, jbig2test.pdf


 I'd like to improve the tests for rendering.
 org/apache/pdfbox/util/TestPDFToImage.java is disabled in pdfbox\pom.xml . 
 This has been disabled since 2009 ?! So I enabled it here.
 The subdir rendering is missing in pdfbox\target\test-output for these tests
 When a test fails because the rendered image is not identical, no detailed 
 message appears on the console. It appears only in pdfbox.log and not on the 
 console.
 this is because of the settings in
 pdfbox\src\test\resources\logging.properties
 If this is on purpose, please change the texts in 
 pdfbox\src\test\java\org\apache\pdfbox\util\*.java from
 One or more failures, see test log for details
 to
 One or more failures, see test logfile 'pdfbox.log' for details
 I wanted to attach a PDF with ccitt g4 compression and its rendering created 
 with the 1.8.2 version, but it doesn't work out, seems that CIB generates 
 files that can be rendered properly with 1.8.2. However I attach the TIFF g4 
 file, and a JBIG2 test file from it. I don't have access to a Xerox 
 WorkCentre (enter jbig2 in google news :-) ) so I used a free service, so 
 there's a watermark.
 It should be included into
 pdfbox\src\test\resources\input\rendering
 I have created the image myself and I give it into the public domain.
 If my suggestion is accepted, it would be nice if people could create files 
 that fail in current versions or have failed in old versions, and release 
 these files to the public domain, so that they can be added to the tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2923) CFFParser parser treats CIDFont's charset data as SID

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680452#comment-14680452
 ] 

John Hewson commented on PDFBOX-2923:
-

Yes, the widths in the Font dictionary actually override the widths in the Font 
program if they don't match.

 CFFParser parser treats CIDFont's charset data as SID
 -

 Key: PDFBOX-2923
 URL: https://issues.apache.org/jira/browse/PDFBOX-2923
 Project: PDFBox
  Issue Type: Bug
  Components: FontBox
Affects Versions: 1.8.10
Reporter: Petras
 Fix For: 1.8.11

 Attachments: MyriadPro-Regular.cff, Patch_to_fix_PDFBOX-2923.patch, 
 sample-a2b-acrosigned_B.pdf


 As stated in Compact Font File specification:
 {quote}
 The charset data, although in the same format as non-CIDFonts, will represent 
 CIDs rather than SIDs, i.e. charstrings are “named” by CIDs in a CIDFont.
 {quote}
 Unfortunately, {{CFFParser}} does not consider this specific and always treat 
 charset data as SID: is looking for SID referenced text in _String INDEX_ 
 structure. Since such SID-indexed string does not exist there, it sets the 
 name of the glyph to {{.ndef}}.
 Consequently, {{CFFParser}} fails to register correct charstrings, as it 
 associates glyph names to them using a map. As there can be several 
 charstrings, only the last charstring entry is retained.
 Then also {{CFFFont.getWidth()}} method fails to return correct width of the 
 given CID as correct link between CID and charstring is lost.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2921) Validation fails if FontValidationProcess is not used

2015-08-10 Thread Tilman Hausherr (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680742#comment-14680742
 ] 

Tilman Hausherr commented on PDFBOX-2921:
-

I don't know what dependencies exist, and that code isn't promoted for anything 
except as a whole for PDF/A-1b validation. If you have a useful javadoc change, 
feel free to attach a patch...

 Validation fails if FontValidationProcess is not used
 -

 Key: PDFBOX-2921
 URL: https://issues.apache.org/jira/browse/PDFBOX-2921
 Project: PDFBox
  Issue Type: Bug
  Components: Preflight
Affects Versions: 1.8.10
Reporter: Petras

 The list validation processes to be used during validation may be controlled 
 by removing some of it or providing own implementation in 
 {{PreflightConfiguration}}. Unfortunately, there exists some coupling among 
 them - if {{FontValidationProcess}} is removed from the processes list, 
 {{ContentStreamWrapper}} fails with {{ERROR_FONTS_UNKNOWN_FONT_REF}} error:
 {quote}
 Glyph error, MyriadPro-Regular is unknown wasn't found by the 
 FontHelperValdiator
 {quote}
 as it does not get {{FontContainer}} instance for given {{PDFont}} from the 
 {{PreflightContext}}. It appears that {{FontValidator}} adds them.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Comment Edited] (PDFBOX-2423) Page tree handling needs rewriting

2015-08-10 Thread Tilman Hausherr (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680828#comment-14680828
 ] 

Tilman Hausherr edited comment on PDFBOX-2423 at 8/10/15 9:52 PM:
--

[~jahewson] Any update on this? Your last change didn't fix all files, but it 
improved several while not worsening any of the correct files. So I'd suggest:
- you produce a new patch against the current code
- I test it again
- if the patch improves things without worsening anything, then it should be 
committed.
I am also attaching some new files which worked in rev 1633472 but don't work 
now. Maybe one of them has an additional clue...

The files are: gs-bugilla691763.pdf, gs-bugzilla688601.pdf, 
gs-bugzilla689518.pdf, gs-bugzilla693322.pdf, samsung_galaxy_s_4_um-p1.pdf.


was (Author: tilman):
[~jahewson] Any update on this? Your last change didn't fix all files, but it 
improved several while not degrading any of the correct files. So I'd suggest:
- you produce a new patch against the current code
- I test it again
- if the patch improves things without worsening anything, then it should be 
committed.
I am also attaching some new files which worked in rev 1633472 but don't work 
now. Maybe one of them has an additional clue...

The files are: gs-bugilla691763.pdf, gs-bugzilla688601.pdf, 
gs-bugzilla689518.pdf, gs-bugzilla693322.pdf, samsung_galaxy_s_4_um-p1.pdf.

 Page tree handling needs rewriting
 --

 Key: PDFBOX-2423
 URL: https://issues.apache.org/jira/browse/PDFBOX-2423
 Project: PDFBox
  Issue Type: Improvement
  Components: PDModel
Affects Versions: 1.8.7, 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Blocker
 Fix For: 2.0.0

 Attachments: 025957.pdf, 26101_Colors.ai-1.png, 
 26101_Colors.ai-1.png-diff.png, Basiswissen-Vorschriften.pdf-3.png, 
 Basiswissen-Vorschriften.pdf-3.png-diff.png, 
 Basiswissen-Vorschriften.pdf-4.png, 
 Basiswissen-Vorschriften.pdf-4.png-diff.png, PDFBOX-1058.pdf-1.png, 
 PDFBOX-1058.pdf-1.png-diff.png, PDFBOX-1058.pdf-4.png, 
 PDFBOX-1058.pdf-4.png-diff.png, PDFBOX-1094-tiling_pattern.pdf, 
 PDFBOX-1711-cmyk.pdf-1.png, PDFBOX-1711-cmyk.pdf-1.png-diff.png, 
 PDFBOX-1794-vattenfall.pdf-1.png, PDFBOX-1794-vattenfall.pdf-1.png-diff.png, 
 PDFBOX-1917.pdf-1.png, PDFBOX-1917.pdf-1.png-diff.png, 
 Transparency_group_rewrite3.patch, asy-functionshading.pdf-1.png, 
 asy-functionshading.pdf-1.png-diff.png, bugzilla869140.pdf, 
 example_026.pdf-1.png, gs-bugilla691763.pdf, gs-bugzilla688601.pdf, 
 gs-bugzilla689518.pdf, gs-bugzilla690467.pdf, gs-bugzilla693322.pdf, 
 gs-bugzilla694385.pdf, jagpdf_doc_patterns.pdf, samsung_galaxy_s_4_um-p1.pdf


 The way in which PDFBox handles the Page tree needs to be rewritten, 
 preferably from scratch. Currently the document catalog returns the raw 
 objects from the page tree, wrapped in either a PDPage or PDPageNode.
 We need to abstract over the page tree and get rid of PDPageNode, we should 
 provide methods which can add/remove PDPage objects *only*. The existing 
 low-level access to the page tree is not needed at the PD-level.
 Inheritance of page properties such as crop box, resources, and rotation 
 should be reimplemented to use whatever new page tree abstraction we invent. 
 We can finally remove the old broken methods which didn't look up the 
 inheritance tree when retrieving these values.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Created] (PDFBOX-2926) Unicode Support in PDFBox 1.8.10

2015-08-10 Thread Rakshit Ashtekar (JIRA)
Rakshit Ashtekar created PDFBOX-2926:


 Summary: Unicode Support in PDFBox 1.8.10
 Key: PDFBOX-2926
 URL: https://issues.apache.org/jira/browse/PDFBOX-2926
 Project: PDFBox
  Issue Type: New Feature
  Components: FontBox, PDModel
Affects Versions: 1.8.10
Reporter: Rakshit Ashtekar
Priority: Critical


As of PDFBox version 1.8.10, Unicode fonts are not supported in PDFBox. This is 
an important requirement for any PDF file. This feature can open up a lot of 
other languages which currently might not be supported due to its restrictions 
and limitations.

Opening this feature request ticket to see if there is any possibility of 
getting this feature into the current version. Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (PDFBOX-2423) Page tree handling needs rewriting

2015-08-10 Thread Tilman Hausherr (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr updated PDFBOX-2423:

Attachment: samsung_galaxy_s_4_um-p1.pdf
gs-bugzilla693322.pdf
gs-bugzilla689518.pdf
gs-bugzilla688601.pdf
gs-bugilla691763.pdf

 Page tree handling needs rewriting
 --

 Key: PDFBOX-2423
 URL: https://issues.apache.org/jira/browse/PDFBOX-2423
 Project: PDFBox
  Issue Type: Improvement
  Components: PDModel
Affects Versions: 1.8.7, 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Blocker
 Fix For: 2.0.0

 Attachments: 025957.pdf, 26101_Colors.ai-1.png, 
 26101_Colors.ai-1.png-diff.png, Basiswissen-Vorschriften.pdf-3.png, 
 Basiswissen-Vorschriften.pdf-3.png-diff.png, 
 Basiswissen-Vorschriften.pdf-4.png, 
 Basiswissen-Vorschriften.pdf-4.png-diff.png, PDFBOX-1058.pdf-1.png, 
 PDFBOX-1058.pdf-1.png-diff.png, PDFBOX-1058.pdf-4.png, 
 PDFBOX-1058.pdf-4.png-diff.png, PDFBOX-1094-tiling_pattern.pdf, 
 PDFBOX-1711-cmyk.pdf-1.png, PDFBOX-1711-cmyk.pdf-1.png-diff.png, 
 PDFBOX-1794-vattenfall.pdf-1.png, PDFBOX-1794-vattenfall.pdf-1.png-diff.png, 
 PDFBOX-1917.pdf-1.png, PDFBOX-1917.pdf-1.png-diff.png, 
 Transparency_group_rewrite3.patch, asy-functionshading.pdf-1.png, 
 asy-functionshading.pdf-1.png-diff.png, bugzilla869140.pdf, 
 example_026.pdf-1.png, gs-bugilla691763.pdf, gs-bugzilla688601.pdf, 
 gs-bugzilla689518.pdf, gs-bugzilla690467.pdf, gs-bugzilla693322.pdf, 
 gs-bugzilla694385.pdf, jagpdf_doc_patterns.pdf, samsung_galaxy_s_4_um-p1.pdf


 The way in which PDFBox handles the Page tree needs to be rewritten, 
 preferably from scratch. Currently the document catalog returns the raw 
 objects from the page tree, wrapped in either a PDPage or PDPageNode.
 We need to abstract over the page tree and get rid of PDPageNode, we should 
 provide methods which can add/remove PDPage objects *only*. The existing 
 low-level access to the page tree is not needed at the PD-level.
 Inheritance of page properties such as crop box, resources, and rotation 
 should be reimplemented to use whatever new page tree abstraction we invent. 
 We can finally remove the old broken methods which didn't look up the 
 inheritance tree when retrieving these values.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2423) Page tree handling needs rewriting

2015-08-10 Thread Tilman Hausherr (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680828#comment-14680828
 ] 

Tilman Hausherr commented on PDFBOX-2423:
-

[~jahewson] Any update on this? Your last change didn't fix all files, but it 
improved several while not degrading any of the correct files. So I'd suggest:
- you produce a new patch against the current code
- I test it again
- if the patch improves things without worsening anything, then it should be 
committed.
I am also attaching some new files which worked in rev 1633472 but don't work 
now. Maybe one of them has an additional clue...

The files are: gs-bugilla691763.pdf, gs-bugzilla688601.pdf, 
gs-bugzilla689518.pdf, gs-bugzilla693322.pdf, samsung_galaxy_s_4_um-p1.pdf.

 Page tree handling needs rewriting
 --

 Key: PDFBOX-2423
 URL: https://issues.apache.org/jira/browse/PDFBOX-2423
 Project: PDFBox
  Issue Type: Improvement
  Components: PDModel
Affects Versions: 1.8.7, 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Blocker
 Fix For: 2.0.0

 Attachments: 025957.pdf, 26101_Colors.ai-1.png, 
 26101_Colors.ai-1.png-diff.png, Basiswissen-Vorschriften.pdf-3.png, 
 Basiswissen-Vorschriften.pdf-3.png-diff.png, 
 Basiswissen-Vorschriften.pdf-4.png, 
 Basiswissen-Vorschriften.pdf-4.png-diff.png, PDFBOX-1058.pdf-1.png, 
 PDFBOX-1058.pdf-1.png-diff.png, PDFBOX-1058.pdf-4.png, 
 PDFBOX-1058.pdf-4.png-diff.png, PDFBOX-1094-tiling_pattern.pdf, 
 PDFBOX-1711-cmyk.pdf-1.png, PDFBOX-1711-cmyk.pdf-1.png-diff.png, 
 PDFBOX-1794-vattenfall.pdf-1.png, PDFBOX-1794-vattenfall.pdf-1.png-diff.png, 
 PDFBOX-1917.pdf-1.png, PDFBOX-1917.pdf-1.png-diff.png, 
 Transparency_group_rewrite3.patch, asy-functionshading.pdf-1.png, 
 asy-functionshading.pdf-1.png-diff.png, bugzilla869140.pdf, 
 example_026.pdf-1.png, gs-bugzilla690467.pdf, gs-bugzilla694385.pdf, 
 jagpdf_doc_patterns.pdf


 The way in which PDFBox handles the Page tree needs to be rewritten, 
 preferably from scratch. Currently the document catalog returns the raw 
 objects from the page tree, wrapped in either a PDPage or PDPageNode.
 We need to abstract over the page tree and get rid of PDPageNode, we should 
 provide methods which can add/remove PDPage objects *only*. The existing 
 low-level access to the page tree is not needed at the PD-level.
 Inheritance of page properties such as crop box, resources, and rotation 
 should be reimplemented to use whatever new page tree abstraction we invent. 
 We can finally remove the old broken methods which didn't look up the 
 inheritance tree when retrieving these values.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Closed] (PDFBOX-2926) Unicode Support in PDFBox 1.8.10

2015-08-10 Thread Tilman Hausherr (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr closed PDFBOX-2926.
---
Resolution: Won't Fix

Sorry, this won't happen. 2.0 was very much redesigned, so it isn't possible to 
use these changes in 1.8. Creating an issue and giving it highest priority and 
flagging it as important won't change that. See also my answer to you in the 
user mailing list.

 Unicode Support in PDFBox 1.8.10
 

 Key: PDFBOX-2926
 URL: https://issues.apache.org/jira/browse/PDFBOX-2926
 Project: PDFBox
  Issue Type: New Feature
  Components: FontBox, PDModel
Affects Versions: 1.8.10
Reporter: Rakshit Ashtekar
Priority: Critical
  Labels: features

 As of PDFBox version 1.8.10, Unicode fonts are not supported in PDFBox. This 
 is an important requirement for any PDF file. This feature can open up a lot 
 of other languages which currently might not be supported due to its 
 restrictions and limitations.
 Opening this feature request ticket to see if there is any possibility of 
 getting this feature into the current version. Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2922) Make PDFPrintable and PDFPageable extandable

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680905#comment-14680905
 ] 

John Hewson commented on PDFBOX-2922:
-

The behaviour which you were encountering was a bug. The orientation code for 
PDFPageable was working fine for portrait pages, or rotated portrait pages but 
it didn't work for landscape pages, i.e. pages where the MediaBox width  
height. Java doesn't seem to like landscape paper and unhelpfully corrects 
the imageable area which PDFPageable provided by cropping it down to portrait 
size, even though the paper is sized as landscape. This happens regardless of 
whether the PageFormat's orientation is portrait or landscape, so I suspect it 
is a JDK bug.

I've come up with a workaround where we normalise the paper size to be 
portrait, then set the PageFormat's orientation flag to represent the original 
orientation. This produces the expected results.

 Make PDFPrintable and PDFPageable extandable
 

 Key: PDFBOX-2922
 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Pei-Tang Huang
Assignee: John Hewson
 Attachments: landscape.pdf, rotated_cropping_failed.jpg, success.jpg


 Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
 {{PDFPageable}} so that one can extending those classes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (PDFBOX-2922) Printing issues with landscape pages

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson updated PDFBOX-2922:

Summary: Printing issues with landscape pages  (was: Make PDFPrintable and 
PDFPageable extandable)

 Printing issues with landscape pages
 

 Key: PDFBOX-2922
 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Pei-Tang Huang
Assignee: John Hewson
 Attachments: landscape.pdf, rotated_cropping_failed.jpg, success.jpg


 Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
 {{PDFPageable}} so that one can extending those classes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2926) Unicode Support in PDFBox 1.8.10

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680925#comment-14680925
 ] 

John Hewson commented on PDFBOX-2926:
-

This is impossible without huge breaking changes.

 Unicode Support in PDFBox 1.8.10
 

 Key: PDFBOX-2926
 URL: https://issues.apache.org/jira/browse/PDFBOX-2926
 Project: PDFBox
  Issue Type: New Feature
  Components: FontBox, PDModel
Affects Versions: 1.8.10
Reporter: Rakshit Ashtekar
Priority: Critical
  Labels: features

 As of PDFBox version 1.8.10, Unicode fonts are not supported in PDFBox. This 
 is an important requirement for any PDF file. This feature can open up a lot 
 of other languages which currently might not be supported due to its 
 restrictions and limitations.
 Opening this feature request ticket to see if there is any possibility of 
 getting this feature into the current version. Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Comment Edited] (PDFBOX-2922) Printing issues with landscape pages

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680905#comment-14680905
 ] 

John Hewson edited comment on PDFBOX-2922 at 8/10/15 11:06 PM:
---

The behaviour which you were encountering was a bug. The orientation code for 
PDFPageable was working fine for portrait pages, or rotated portrait pages but 
it didn't work for landscape pages, i.e. pages where the MediaBox width  
height. Java doesn't seem to like landscape paper and unhelpfully corrects 
the imageable area which PDFPageable provided by cropping it down to portrait 
size, even though the paper is sized as landscape. This happens regardless of 
whether the PageFormat's orientation is portrait or landscape, so I suspect it 
is a JDK bug.

I've come up with a workaround where we normalise the paper size to be 
portrait, then set the PageFormat's orientation flag to represent the original 
orientation. This produces the expected results.

You should now be able to simply print this file using Orientation.AUTO and 
everything should work. Please let me know if it works for you.


was (Author: jahewson):
The behaviour which you were encountering was a bug. The orientation code for 
PDFPageable was working fine for portrait pages, or rotated portrait pages but 
it didn't work for landscape pages, i.e. pages where the MediaBox width  
height. Java doesn't seem to like landscape paper and unhelpfully corrects 
the imageable area which PDFPageable provided by cropping it down to portrait 
size, even though the paper is sized as landscape. This happens regardless of 
whether the PageFormat's orientation is portrait or landscape, so I suspect it 
is a JDK bug.

I've come up with a workaround where we normalise the paper size to be 
portrait, then set the PageFormat's orientation flag to represent the original 
orientation. This produces the expected results.

You should now be able to simply print this file using Orientation.AUTO and 
everything should work.

 Printing issues with landscape pages
 

 Key: PDFBOX-2922
 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Pei-Tang Huang
Assignee: John Hewson
 Attachments: landscape.pdf, rotated_cropping_failed.jpg, success.jpg


 Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
 {{PDFPageable}} so that one can extending those classes.
 UPDATE: I've modified the original title of this issue to reflect the 
 underlying bug, rather than the user wanting to have final removed for 
 these classes and fix the bug themselves.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Comment Edited] (PDFBOX-2917) PDF to Image, faint/dim Images

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680986#comment-14680986
 ] 

John Hewson edited comment on PDFBOX-2917 at 8/11/15 12:09 AM:
---

Well, I'm out of ideas. We could fall back to using getRGB(x,y) in a loop for 
embedded CMYK profiles? It's a shame to lose the performance but I don't see 
what else we can do.


was (Author: jahewson):
Well, I'm out of ideas. We could fall back to using getRGB(x,y) in a loop for 
embedded CMYK profiles?

 PDF to Image, faint/dim Images
 --

 Key: PDFBOX-2917
 URL: https://issues.apache.org/jira/browse/PDFBOX-2917
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 2.0.0
 Environment: Windows 8.1, jdk1.8.0_51, jre1.8.0_51
Reporter: Samuil Goranov
Priority: Trivial
  Labels: images, newbie
 Attachments: PDFBOX-2917-v2.patch, 
 PDFBOX-2917__Use_linear_RGB_for_image_color_conversion_to_workaround_JDK_bug.patch,
  saved0.png, screenshot-1.png, selection.pdf


 {code:title=pdftoimage.java|borderStyle=solid}
 PDDocument document = null;
 File file = new File(F:\\Projects\\java\\pdfbox\\complete.pdf);
 document = PDDocument.load( file );
 try {
 // retrieve image
 BufferedImage bi = new PDFRenderer(document).renderImageWithDPI( 
 0 , 150, ImageType.RGB );
 File outputfile = new File(saved0.png);
 ImageIO.write(bi, png, outputfile);
 } catch (IOException e) {
 }
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2922) Printing issues with landscape pages

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680918#comment-14680918
 ] 

John Hewson commented on PDFBOX-2922:
-

That's the correct behaviour, the purpose of a Pageable is to return the 
original page sizes in the source document. If you want to override the page 
sizes, use a Book instead of a PDFPageable. See our 
[printWithPaper()|https://github.com/apache/pdfbox/blob/trunk/examples/src/main/java/org/apache/pdfbox/examples/printing/Printing.java]
 example.

However, I think you're having issues due to a bug, which I've fixed below, so 
it shouldn't matter.

 Printing issues with landscape pages
 

 Key: PDFBOX-2922
 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Pei-Tang Huang
Assignee: John Hewson
 Attachments: landscape.pdf, rotated_cropping_failed.jpg, success.jpg


 Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
 {{PDFPageable}} so that one can extending those classes.
 UPDATE: I've modified the original title of this issue to reflect the 
 underlying bug, rather than the user wanting to have final removed for 
 these classes and fix the bug themselves.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2423) Page tree handling needs rewriting

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680932#comment-14680932
 ] 

John Hewson commented on PDFBOX-2423:
-

Sorry, progress has kind of stalled on this. The issue is that there are really 
two causes of regressions, the first is due to bugs in my new code, those are 
easy for me to figure out and fix. The second is due to incorrect assumptions 
in existing code which cause failures when integrated with my new 
(theoretically) correct code. These are very hard to fix, because I have no 
idea where in the code these problems are occurring or what subtle assumption 
is the cause of the problem.

 Page tree handling needs rewriting
 --

 Key: PDFBOX-2423
 URL: https://issues.apache.org/jira/browse/PDFBOX-2423
 Project: PDFBox
  Issue Type: Improvement
  Components: PDModel
Affects Versions: 1.8.7, 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Blocker
 Fix For: 2.0.0

 Attachments: 025957.pdf, 26101_Colors.ai-1.png, 
 26101_Colors.ai-1.png-diff.png, Basiswissen-Vorschriften.pdf-3.png, 
 Basiswissen-Vorschriften.pdf-3.png-diff.png, 
 Basiswissen-Vorschriften.pdf-4.png, 
 Basiswissen-Vorschriften.pdf-4.png-diff.png, PDFBOX-1058.pdf-1.png, 
 PDFBOX-1058.pdf-1.png-diff.png, PDFBOX-1058.pdf-4.png, 
 PDFBOX-1058.pdf-4.png-diff.png, PDFBOX-1094-tiling_pattern.pdf, 
 PDFBOX-1711-cmyk.pdf-1.png, PDFBOX-1711-cmyk.pdf-1.png-diff.png, 
 PDFBOX-1794-vattenfall.pdf-1.png, PDFBOX-1794-vattenfall.pdf-1.png-diff.png, 
 PDFBOX-1917.pdf-1.png, PDFBOX-1917.pdf-1.png-diff.png, 
 Transparency_group_rewrite3.patch, asy-functionshading.pdf-1.png, 
 asy-functionshading.pdf-1.png-diff.png, bugzilla869140.pdf, 
 example_026.pdf-1.png, gs-bugilla691763.pdf, gs-bugzilla688601.pdf, 
 gs-bugzilla689518.pdf, gs-bugzilla690467.pdf, gs-bugzilla693322.pdf, 
 gs-bugzilla694385.pdf, jagpdf_doc_patterns.pdf, samsung_galaxy_s_4_um-p1.pdf


 The way in which PDFBox handles the Page tree needs to be rewritten, 
 preferably from scratch. Currently the document catalog returns the raw 
 objects from the page tree, wrapped in either a PDPage or PDPageNode.
 We need to abstract over the page tree and get rid of PDPageNode, we should 
 provide methods which can add/remove PDPage objects *only*. The existing 
 low-level access to the page tree is not needed at the PD-level.
 Inheritance of page properties such as crop box, resources, and rotation 
 should be reimplemented to use whatever new page tree abstraction we invent. 
 We can finally remove the old broken methods which didn't look up the 
 inheritance tree when retrieving these values.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2917) PDF to Image, faint/dim Images

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680986#comment-14680986
 ] 

John Hewson commented on PDFBOX-2917:
-

Well, I'm out of ideas. We could fall back to using getRGB(x,y) in a loop for 
embedded CMYK profiles?

 PDF to Image, faint/dim Images
 --

 Key: PDFBOX-2917
 URL: https://issues.apache.org/jira/browse/PDFBOX-2917
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 2.0.0
 Environment: Windows 8.1, jdk1.8.0_51, jre1.8.0_51
Reporter: Samuil Goranov
Priority: Trivial
  Labels: images, newbie
 Attachments: PDFBOX-2917-v2.patch, 
 PDFBOX-2917__Use_linear_RGB_for_image_color_conversion_to_workaround_JDK_bug.patch,
  saved0.png, screenshot-1.png, selection.pdf


 {code:title=pdftoimage.java|borderStyle=solid}
 PDDocument document = null;
 File file = new File(F:\\Projects\\java\\pdfbox\\complete.pdf);
 document = PDDocument.load( file );
 try {
 // retrieve image
 BufferedImage bi = new PDFRenderer(document).renderImageWithDPI( 
 0 , 150, ImageType.RGB );
 File outputfile = new File(saved0.png);
 ImageIO.write(bi, png, outputfile);
 } catch (IOException e) {
 }
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2922) Make PDFPrintable and PDFPageable extandable

2015-08-10 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680901#comment-14680901
 ] 

ASF subversion and git services commented on PDFBOX-2922:
-

Commit 1695180 from [~jahewson] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1695180 ]

PDFBOX-2922: Correct printing of landscape pages with landscape-sized paper

 Make PDFPrintable and PDFPageable extandable
 

 Key: PDFBOX-2922
 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Pei-Tang Huang
Assignee: John Hewson
 Attachments: landscape.pdf, rotated_cropping_failed.jpg, success.jpg


 Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
 {{PDFPageable}} so that one can extending those classes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (PDFBOX-2922) Printing issues with landscape pages

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson updated PDFBOX-2922:

Description: 
Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
{{PDFPageable}} so that one can extending those classes.

UPDATE: I've modified the original title of this issue to reflect the 
underlying bug, rather than the user wanting to have final removed for these 
classes and fix the bug themselves.

  was:Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
{{PDFPageable}} so that one can extending those classes.


 Printing issues with landscape pages
 

 Key: PDFBOX-2922
 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Pei-Tang Huang
Assignee: John Hewson
 Attachments: landscape.pdf, rotated_cropping_failed.jpg, success.jpg


 Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
 {{PDFPageable}} so that one can extending those classes.
 UPDATE: I've modified the original title of this issue to reflect the 
 underlying bug, rather than the user wanting to have final removed for 
 these classes and fix the bug themselves.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Comment Edited] (PDFBOX-2922) Printing issues with landscape pages

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680905#comment-14680905
 ] 

John Hewson edited comment on PDFBOX-2922 at 8/10/15 11:06 PM:
---

The behaviour which you were encountering was a bug. The orientation code for 
PDFPageable was working fine for portrait pages, or rotated portrait pages but 
it didn't work for landscape pages, i.e. pages where the MediaBox width  
height. Java doesn't seem to like landscape paper and unhelpfully corrects 
the imageable area which PDFPageable provided by cropping it down to portrait 
size, even though the paper is sized as landscape. This happens regardless of 
whether the PageFormat's orientation is portrait or landscape, so I suspect it 
is a JDK bug.

I've come up with a workaround where we normalise the paper size to be 
portrait, then set the PageFormat's orientation flag to represent the original 
orientation. This produces the expected results.

You should now be able to simply print this file using Orientation.AUTO and 
everything should work.


was (Author: jahewson):
The behaviour which you were encountering was a bug. The orientation code for 
PDFPageable was working fine for portrait pages, or rotated portrait pages but 
it didn't work for landscape pages, i.e. pages where the MediaBox width  
height. Java doesn't seem to like landscape paper and unhelpfully corrects 
the imageable area which PDFPageable provided by cropping it down to portrait 
size, even though the paper is sized as landscape. This happens regardless of 
whether the PageFormat's orientation is portrait or landscape, so I suspect it 
is a JDK bug.

I've come up with a workaround where we normalise the paper size to be 
portrait, then set the PageFormat's orientation flag to represent the original 
orientation. This produces the expected results.

 Printing issues with landscape pages
 

 Key: PDFBOX-2922
 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Pei-Tang Huang
Assignee: John Hewson
 Attachments: landscape.pdf, rotated_cropping_failed.jpg, success.jpg


 Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
 {{PDFPageable}} so that one can extending those classes.
 UPDATE: I've modified the original title of this issue to reflect the 
 underlying bug, rather than the user wanting to have final removed for 
 these classes and fix the bug themselves.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2917) PDF to Image, faint/dim Images

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680974#comment-14680974
 ] 

John Hewson commented on PDFBOX-2917:
-

Looking at selection.pdf and immo-kurier_arsenal_93x62.pdf, the former appears 
correctly with my patch, while the latter doesn't. Both these files contain ICC 
profiles whose class is output, space is cmyk, version is 2.4.0, and 
connection space is lab. The only difference is that the rendering intent is 
perceptual for the profile from selection.pdf, while the other profile's 
rendering intent is relative.

 PDF to Image, faint/dim Images
 --

 Key: PDFBOX-2917
 URL: https://issues.apache.org/jira/browse/PDFBOX-2917
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 2.0.0
 Environment: Windows 8.1, jdk1.8.0_51, jre1.8.0_51
Reporter: Samuil Goranov
Priority: Trivial
  Labels: images, newbie
 Attachments: PDFBOX-2917-v2.patch, 
 PDFBOX-2917__Use_linear_RGB_for_image_color_conversion_to_workaround_JDK_bug.patch,
  saved0.png, screenshot-1.png, selection.pdf


 {code:title=pdftoimage.java|borderStyle=solid}
 PDDocument document = null;
 File file = new File(F:\\Projects\\java\\pdfbox\\complete.pdf);
 document = PDDocument.load( file );
 try {
 // retrieve image
 BufferedImage bi = new PDFRenderer(document).renderImageWithDPI( 
 0 , 150, ImageType.RGB );
 File outputfile = new File(saved0.png);
 ImageIO.write(bi, png, outputfile);
 } catch (IOException e) {
 }
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Comment Edited] (PDFBOX-2917) PDF to Image, faint/dim Images

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680974#comment-14680974
 ] 

John Hewson edited comment on PDFBOX-2917 at 8/11/15 12:05 AM:
---

Looking at selection.pdf and immo-kurier_arsenal_93x62.pdf, the former appears 
correctly with my patch, while the latter doesn't. Both these files contain ICC 
profiles whose class is output, space is cmyk, version is 2.4.0, and 
connection space is lab. The only difference is that the rendering intent is 
perceptual for the profile from selection.pdf, while the other profile's 
rendering intent is relative.

Update: Actually Apple's ColorSync claims that the arsenal profile is 
relative but Java reads it as perceptual, looking at the profile data, the 
header does specific that the profile is perceptual. I don't know what's going 
on there.


was (Author: jahewson):
Looking at selection.pdf and immo-kurier_arsenal_93x62.pdf, the former appears 
correctly with my patch, while the latter doesn't. Both these files contain ICC 
profiles whose class is output, space is cmyk, version is 2.4.0, and 
connection space is lab. The only difference is that the rendering intent is 
perceptual for the profile from selection.pdf, while the other profile's 
rendering intent is relative.

 PDF to Image, faint/dim Images
 --

 Key: PDFBOX-2917
 URL: https://issues.apache.org/jira/browse/PDFBOX-2917
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 2.0.0
 Environment: Windows 8.1, jdk1.8.0_51, jre1.8.0_51
Reporter: Samuil Goranov
Priority: Trivial
  Labels: images, newbie
 Attachments: PDFBOX-2917-v2.patch, 
 PDFBOX-2917__Use_linear_RGB_for_image_color_conversion_to_workaround_JDK_bug.patch,
  saved0.png, screenshot-1.png, selection.pdf


 {code:title=pdftoimage.java|borderStyle=solid}
 PDDocument document = null;
 File file = new File(F:\\Projects\\java\\pdfbox\\complete.pdf);
 document = PDDocument.load( file );
 try {
 // retrieve image
 BufferedImage bi = new PDFRenderer(document).renderImageWithDPI( 
 0 , 150, ImageType.RGB );
 File outputfile = new File(saved0.png);
 ImageIO.write(bi, png, outputfile);
 } catch (IOException e) {
 }
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2204) java.lang.ArrayIndexOutOfBoundsException in SampledImageReader.from8bit

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14681163#comment-14681163
 ] 

John Hewson commented on PDFBOX-2204:
-

Looking again at this, the PDF spec says:

{quote}
In addition, the image’s colour space may serve as the foundation for a palette 
of colours that are selected using samples
coming from the image’s data channels: the equivalent of an Indexed colour 
space in PDF.
{quote}

So it appears the Indexed color spaces are supported. I've made the change I 
mentioned above in to the BPC calculation in JPXFilter, so that we're measuring 
the size of the samples going in, not the samples coming out.

 java.lang.ArrayIndexOutOfBoundsException in SampledImageReader.from8bit
 ---

 Key: PDFBOX-2204
 URL: https://issues.apache.org/jira/browse/PDFBOX-2204
 Project: PDFBox
  Issue Type: Bug
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Tilman Hausherr
Assignee: John Hewson
  Labels: JPEG2000, JPXDecode, JPXFilter
 Fix For: 2.1.0

 Attachments: PDFBOX-2204-012411.pdf, pdfbox-2204-012411.pdf-11.png


 I get this with the attached file on page 11:
 {code}
 java.lang.ArrayIndexOutOfBoundsException: 8296
   at 
 org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.from8bit(SampledImageReader.java:253)
   at 
 org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.getRGBImage(SampledImageReader.java:146)
   at 
 org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.getImage(PDImageXObject.java:188)
   at 
 org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:80)
 {code}
 The problem is in JPXFilter. Per the spec, we must ignore the 
 BITS_PER_COMPONENT value from the PDF and use the one from the image. We set 
 BITS_PER_COMPONENT to 8 because colorModel.getComponentSize(0) is 8. 
 colorModel.getPixelSize() is 4. In normal images, the sum of the 
 colorModel.getComponentSize() values equals colorModel.getPixelSize().
 I'm not sure what to do. I am using this code locally:
 {code}
 ColorModel colorModel = image.getColorModel();
 int pixelSize = colorModel.getPixelSize();
 int[] componentSize = colorModel.getComponentSize();
 if (pixelSize  componentSize[0])
 {
 LOG.warn(componentSize[0] of image ignored, because 
 pixelSize  componentSize[0]);
 LOG.warn(pixelSize:  + pixelSize);
 LOG.warn(componentSize.length  + componentSize.length);
 for (int i = 0; i  componentSize.length; ++i)
 {
 LOG.warn(componentSize[ + i + ]:  + componentSize[i]);
 }
 }
 else
 {
 parameters.setInt(COSName.BITS_PER_COMPONENT, 
 componentSize[0]);
 }
 {code}
 and now the PDF renders properly and the image at the bottom right is almost 
 correct. (A circle on the left is missing)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2204) java.lang.ArrayIndexOutOfBoundsException in SampledImageReader.from8bit

2015-08-10 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14681164#comment-14681164
 ] 

ASF subversion and git services commented on PDFBOX-2204:
-

Commit 1695202 from [~jahewson] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1695202 ]

PDFBOX-2204: Support for Indexed color spaces in JPX

 java.lang.ArrayIndexOutOfBoundsException in SampledImageReader.from8bit
 ---

 Key: PDFBOX-2204
 URL: https://issues.apache.org/jira/browse/PDFBOX-2204
 Project: PDFBox
  Issue Type: Bug
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Tilman Hausherr
Assignee: John Hewson
  Labels: JPEG2000, JPXDecode, JPXFilter
 Fix For: 2.1.0

 Attachments: PDFBOX-2204-012411.pdf, pdfbox-2204-012411.pdf-11.png


 I get this with the attached file on page 11:
 {code}
 java.lang.ArrayIndexOutOfBoundsException: 8296
   at 
 org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.from8bit(SampledImageReader.java:253)
   at 
 org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.getRGBImage(SampledImageReader.java:146)
   at 
 org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.getImage(PDImageXObject.java:188)
   at 
 org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:80)
 {code}
 The problem is in JPXFilter. Per the spec, we must ignore the 
 BITS_PER_COMPONENT value from the PDF and use the one from the image. We set 
 BITS_PER_COMPONENT to 8 because colorModel.getComponentSize(0) is 8. 
 colorModel.getPixelSize() is 4. In normal images, the sum of the 
 colorModel.getComponentSize() values equals colorModel.getPixelSize().
 I'm not sure what to do. I am using this code locally:
 {code}
 ColorModel colorModel = image.getColorModel();
 int pixelSize = colorModel.getPixelSize();
 int[] componentSize = colorModel.getComponentSize();
 if (pixelSize  componentSize[0])
 {
 LOG.warn(componentSize[0] of image ignored, because 
 pixelSize  componentSize[0]);
 LOG.warn(pixelSize:  + pixelSize);
 LOG.warn(componentSize.length  + componentSize.length);
 for (int i = 0; i  componentSize.length; ++i)
 {
 LOG.warn(componentSize[ + i + ]:  + componentSize[i]);
 }
 }
 else
 {
 parameters.setInt(COSName.BITS_PER_COMPONENT, 
 componentSize[0]);
 }
 {code}
 and now the PDF renders properly and the image at the bottom right is almost 
 correct. (A circle on the left is missing)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (PDFBOX-2204) Indexed color space in JPX

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson updated PDFBOX-2204:

Summary: Indexed color space in JPX  (was: 
java.lang.ArrayIndexOutOfBoundsException in SampledImageReader.from8bit)

 Indexed color space in JPX
 --

 Key: PDFBOX-2204
 URL: https://issues.apache.org/jira/browse/PDFBOX-2204
 Project: PDFBox
  Issue Type: Bug
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Tilman Hausherr
Assignee: John Hewson
  Labels: JPEG2000, JPXDecode, JPXFilter
 Fix For: 2.0.0

 Attachments: PDFBOX-2204-012411.pdf, pdfbox-2204-012411.pdf-11.png


 I get this with the attached file on page 11:
 {code}
 java.lang.ArrayIndexOutOfBoundsException: 8296
   at 
 org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.from8bit(SampledImageReader.java:253)
   at 
 org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.getRGBImage(SampledImageReader.java:146)
   at 
 org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.getImage(PDImageXObject.java:188)
   at 
 org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:80)
 {code}
 The problem is in JPXFilter. Per the spec, we must ignore the 
 BITS_PER_COMPONENT value from the PDF and use the one from the image. We set 
 BITS_PER_COMPONENT to 8 because colorModel.getComponentSize(0) is 8. 
 colorModel.getPixelSize() is 4. In normal images, the sum of the 
 colorModel.getComponentSize() values equals colorModel.getPixelSize().
 I'm not sure what to do. I am using this code locally:
 {code}
 ColorModel colorModel = image.getColorModel();
 int pixelSize = colorModel.getPixelSize();
 int[] componentSize = colorModel.getComponentSize();
 if (pixelSize  componentSize[0])
 {
 LOG.warn(componentSize[0] of image ignored, because 
 pixelSize  componentSize[0]);
 LOG.warn(pixelSize:  + pixelSize);
 LOG.warn(componentSize.length  + componentSize.length);
 for (int i = 0; i  componentSize.length; ++i)
 {
 LOG.warn(componentSize[ + i + ]:  + componentSize[i]);
 }
 }
 else
 {
 parameters.setInt(COSName.BITS_PER_COMPONENT, 
 componentSize[0]);
 }
 {code}
 and now the PDF renders properly and the image at the bottom right is almost 
 correct. (A circle on the left is missing)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2487) ArrayIndexOutOfBoundsException in Type1CharString

2015-08-10 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14681137#comment-14681137
 ] 

ASF subversion and git services commented on PDFBOX-2487:
-

Commit 1695198 from [~jahewson] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1695198 ]

PDFBOX-2487: Guard against invalid charstrings

 ArrayIndexOutOfBoundsException in Type1CharString
 -

 Key: PDFBOX-2487
 URL: https://issues.apache.org/jira/browse/PDFBOX-2487
 Project: PDFBox
  Issue Type: Bug
  Components: FontBox
Affects Versions: 2.0.0
Reporter: Tilman Hausherr
Assignee: John Hewson
 Fix For: 2.0.0

 Attachments: 009013.pdf


 I get this with the attached file:
 {code}
 java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 3
   at java.util.Vector.get(Vector.java:744)
   at 
 org.apache.fontbox.cff.Type1CharString.handleCommand(Type1CharString.java:204)
   at 
 org.apache.fontbox.cff.Type1CharString.access$000(Type1CharString.java:39)
   at 
 org.apache.fontbox.cff.Type1CharString$1.handleCommand(Type1CharString.java:143)
   at 
 org.apache.fontbox.cff.CharStringHandler.handleSequence(CharStringHandler.java:45)
   at 
 org.apache.fontbox.cff.Type1CharString.render(Type1CharString.java:146)
   at 
 org.apache.fontbox.cff.Type1CharString.getWidth(Type1CharString.java:105)
   at org.apache.fontbox.type1.Type1Font.getWidth(Type1Font.java:159)
   at 
 org.apache.pdfbox.pdmodel.font.PDType1Font.getWidthFromFont(PDType1Font.java:286)
   at 
 org.apache.pdfbox.preflight.font.container.FontContainer.checkGlyphWidth(FontContainer.java:129)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.validText(PreflightContentStream.java:340)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.validStringDefinition(PreflightContentStream.java:243)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.checkShowTextOperators(PreflightContentStream.java:183)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.processOperator(PreflightContentStream.java:153)
   at 
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:461)
   at 
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:425)
   at 
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:398)
   at 
 org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:164)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.validPageContentStream(PreflightContentStream.java:72)
   at 
 org.apache.pdfbox.preflight.process.reflect.SinglePageValidationProcess.validateContent(SinglePageValidationProcess.java:182)
   at 
 org.apache.pdfbox.preflight.process.reflect.SinglePageValidationProcess.validate(SinglePageValidationProcess.java:87)
   at 
 org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:73)
   at 
 org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:52)
   at 
 org.apache.pdfbox.preflight.process.PageTreeValidationProcess.validatePage(PageTreeValidationProcess.java:56)
   at 
 org.apache.pdfbox.preflight.process.PageTreeValidationProcess.validate(PageTreeValidationProcess.java:45)
   at 
 org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:73)
   at 
 org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:88)
   at 
 org.apache.pdfbox.preflight.PreflightDocument.validate(PreflightDocument.java:168)
   at pdfboxpageimageextraction.PreflightTest.main(PreflightTest.java:41)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Resolved] (PDFBOX-2487) ArrayIndexOutOfBoundsException in Type1CharString

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson resolved PDFBOX-2487.
-
Resolution: Fixed

 ArrayIndexOutOfBoundsException in Type1CharString
 -

 Key: PDFBOX-2487
 URL: https://issues.apache.org/jira/browse/PDFBOX-2487
 Project: PDFBox
  Issue Type: Bug
  Components: FontBox
Affects Versions: 2.0.0
Reporter: Tilman Hausherr
Assignee: John Hewson
 Fix For: 2.0.0

 Attachments: 009013.pdf


 I get this with the attached file:
 {code}
 java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 3
   at java.util.Vector.get(Vector.java:744)
   at 
 org.apache.fontbox.cff.Type1CharString.handleCommand(Type1CharString.java:204)
   at 
 org.apache.fontbox.cff.Type1CharString.access$000(Type1CharString.java:39)
   at 
 org.apache.fontbox.cff.Type1CharString$1.handleCommand(Type1CharString.java:143)
   at 
 org.apache.fontbox.cff.CharStringHandler.handleSequence(CharStringHandler.java:45)
   at 
 org.apache.fontbox.cff.Type1CharString.render(Type1CharString.java:146)
   at 
 org.apache.fontbox.cff.Type1CharString.getWidth(Type1CharString.java:105)
   at org.apache.fontbox.type1.Type1Font.getWidth(Type1Font.java:159)
   at 
 org.apache.pdfbox.pdmodel.font.PDType1Font.getWidthFromFont(PDType1Font.java:286)
   at 
 org.apache.pdfbox.preflight.font.container.FontContainer.checkGlyphWidth(FontContainer.java:129)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.validText(PreflightContentStream.java:340)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.validStringDefinition(PreflightContentStream.java:243)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.checkShowTextOperators(PreflightContentStream.java:183)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.processOperator(PreflightContentStream.java:153)
   at 
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:461)
   at 
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:425)
   at 
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:398)
   at 
 org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:164)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.validPageContentStream(PreflightContentStream.java:72)
   at 
 org.apache.pdfbox.preflight.process.reflect.SinglePageValidationProcess.validateContent(SinglePageValidationProcess.java:182)
   at 
 org.apache.pdfbox.preflight.process.reflect.SinglePageValidationProcess.validate(SinglePageValidationProcess.java:87)
   at 
 org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:73)
   at 
 org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:52)
   at 
 org.apache.pdfbox.preflight.process.PageTreeValidationProcess.validatePage(PageTreeValidationProcess.java:56)
   at 
 org.apache.pdfbox.preflight.process.PageTreeValidationProcess.validate(PageTreeValidationProcess.java:45)
   at 
 org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:73)
   at 
 org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:88)
   at 
 org.apache.pdfbox.preflight.PreflightDocument.validate(PreflightDocument.java:168)
   at pdfboxpageimageextraction.PreflightTest.main(PreflightTest.java:41)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2487) ArrayIndexOutOfBoundsException in Type1CharString

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14681138#comment-14681138
 ] 

John Hewson commented on PDFBOX-2487:
-

This file contains a PFB font with invalid charstrings. The charstrings are 
completely invalid, essentially nonsense.

 ArrayIndexOutOfBoundsException in Type1CharString
 -

 Key: PDFBOX-2487
 URL: https://issues.apache.org/jira/browse/PDFBOX-2487
 Project: PDFBox
  Issue Type: Bug
  Components: FontBox
Affects Versions: 2.0.0
Reporter: Tilman Hausherr
Assignee: John Hewson
 Fix For: 2.0.0

 Attachments: 009013.pdf


 I get this with the attached file:
 {code}
 java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 3
   at java.util.Vector.get(Vector.java:744)
   at 
 org.apache.fontbox.cff.Type1CharString.handleCommand(Type1CharString.java:204)
   at 
 org.apache.fontbox.cff.Type1CharString.access$000(Type1CharString.java:39)
   at 
 org.apache.fontbox.cff.Type1CharString$1.handleCommand(Type1CharString.java:143)
   at 
 org.apache.fontbox.cff.CharStringHandler.handleSequence(CharStringHandler.java:45)
   at 
 org.apache.fontbox.cff.Type1CharString.render(Type1CharString.java:146)
   at 
 org.apache.fontbox.cff.Type1CharString.getWidth(Type1CharString.java:105)
   at org.apache.fontbox.type1.Type1Font.getWidth(Type1Font.java:159)
   at 
 org.apache.pdfbox.pdmodel.font.PDType1Font.getWidthFromFont(PDType1Font.java:286)
   at 
 org.apache.pdfbox.preflight.font.container.FontContainer.checkGlyphWidth(FontContainer.java:129)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.validText(PreflightContentStream.java:340)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.validStringDefinition(PreflightContentStream.java:243)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.checkShowTextOperators(PreflightContentStream.java:183)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.processOperator(PreflightContentStream.java:153)
   at 
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:461)
   at 
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:425)
   at 
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:398)
   at 
 org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:164)
   at 
 org.apache.pdfbox.preflight.content.PreflightContentStream.validPageContentStream(PreflightContentStream.java:72)
   at 
 org.apache.pdfbox.preflight.process.reflect.SinglePageValidationProcess.validateContent(SinglePageValidationProcess.java:182)
   at 
 org.apache.pdfbox.preflight.process.reflect.SinglePageValidationProcess.validate(SinglePageValidationProcess.java:87)
   at 
 org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:73)
   at 
 org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:52)
   at 
 org.apache.pdfbox.preflight.process.PageTreeValidationProcess.validatePage(PageTreeValidationProcess.java:56)
   at 
 org.apache.pdfbox.preflight.process.PageTreeValidationProcess.validate(PageTreeValidationProcess.java:45)
   at 
 org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:73)
   at 
 org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:88)
   at 
 org.apache.pdfbox.preflight.PreflightDocument.validate(PreflightDocument.java:168)
   at pdfboxpageimageextraction.PreflightTest.main(PreflightTest.java:41)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2184) CMMException: Invalid profile data

2015-08-10 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14681000#comment-14681000
 ] 

ASF subversion and git services commented on PDFBOX-2184:
-

Commit 1695184 from [~jahewson] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1695184 ]

PDFBOX-2184: Lazy setting of the AWT color space for RGB

 CMMException: Invalid profile data
 --

 Key: PDFBOX-2184
 URL: https://issues.apache.org/jira/browse/PDFBOX-2184
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Blocker
 Fix For: 2.0.0


 Jenkins builds are intermittently failing with the error:
 {code}
 java.awt.color.CMMException: Invalid profile data
   at sun.awt.color.CMM.checkStatus(CMM.java:131)
   at sun.awt.color.ICC_Transform.init(ICC_Transform.java:88)
   at java.awt.color.ICC_ColorSpace.toRGB(ICC_ColorSpace.java:144)
   at 
 org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB.toRGB(PDDeviceRGB.java:79)
   at 
 org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.toPaint(PDColorSpace.java:255)
   at 
 org.apache.pdfbox.rendering.PageDrawer.getNonStrokingPaint(PageDrawer.java:666)
   at org.apache.pdfbox.rendering.PageDrawer.fillPath(PageDrawer.java:739)
   at 
 org.apache.pdfbox.util.operator.pagedrawer.FillNonZeroRule.process(FillNonZeroRule.java:37)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:488)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:254)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:221)
   at 
 org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:130)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:488)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:254)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:221)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:197)
   at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:183)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:228)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:160)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:83)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:70)
   at org.apache.pdfbox.util.TestRendering.render(TestRendering.java:78)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (PDFBOX-1848) Time Stamp Document Level Sigature

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-1848?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson updated PDFBOX-1848:

Assignee: (was: John Hewson)

 Time Stamp Document Level Sigature
 --

 Key: PDFBOX-1848
 URL: https://issues.apache.org/jira/browse/PDFBOX-1848
 Project: PDFBox
  Issue Type: Improvement
  Components: Signing
Affects Versions: 2.0.0
Reporter: vakhtang koroghlishvili
 Fix For: 2.0.0

 Attachments: CreateTSASignature.java.patch, 
 TSA-SIG-LOOKS-LIKE-THIS.png


 We need TSA Document Level signature modulo too!
 At the moment we sign document with our certificate. But... sometimes we need 
 to sign document with TSA too. This is important part of signing. Sometimes 
 this is very very very important- for instance when we will implement PAdES 4 
 profile this module will be essential. without that Document Secure Store 
 will not work :)
 I'm working on this improvement. I'will finish this soon. It's almost done. I 
 only must add some java docs, and might be I change architect design and etc..
 So, please assign this it to me :) I will upload patch as soon as possible :)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2437) PDFont isSymbolic() has unexpected return value

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14681021#comment-14681021
 ] 

John Hewson commented on PDFBOX-2437:
-

Fortunately it appears that the comment was incorrect.

 PDFont isSymbolic() has unexpected return value
 ---

 Key: PDFBOX-2437
 URL: https://issues.apache.org/jira/browse/PDFBOX-2437
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Minor
 Fix For: 2.0.0


 From the mailing list:
 {quote}
 Hello,
 I believe the following lines should fallback to false instead of true.
 https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java#L401-L402
 {
// unless we can prove that the font is symbolic, we assume that it is
 not
isSymbolic = true;
 }
 Thought to let you know.
 Best Regards,
 Hisham
 {quote}
 Either the comment or the return value is wrong, but this code is very 
 brittle so we'll need to do lots of regression testing if any changes are 
 made.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2437) PDFont isSymbolic() has unexpected return value

2015-08-10 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14681018#comment-14681018
 ] 

ASF subversion and git services commented on PDFBOX-2437:
-

Commit 1695185 from [~jahewson] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1695185 ]

PDFBOX-2437: Fix comment

 PDFont isSymbolic() has unexpected return value
 ---

 Key: PDFBOX-2437
 URL: https://issues.apache.org/jira/browse/PDFBOX-2437
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Minor
 Fix For: 2.0.0


 From the mailing list:
 {quote}
 Hello,
 I believe the following lines should fallback to false instead of true.
 https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java#L401-L402
 {
// unless we can prove that the font is symbolic, we assume that it is
 not
isSymbolic = true;
 }
 Thought to let you know.
 Best Regards,
 Hisham
 {quote}
 Either the comment or the return value is wrong, but this code is very 
 brittle so we'll need to do lots of regression testing if any changes are 
 made.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (PDFBOX-2400) Add insertPage() method

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson updated PDFBOX-2400:

Assignee: (was: John Hewson)

 Add insertPage() method
 ---

 Key: PDFBOX-2400
 URL: https://issues.apache.org/jira/browse/PDFBOX-2400
 Project: PDFBox
  Issue Type: New Feature
  Components: PDModel
Affects Versions: 1.8.7, 2.0.0
Reporter: Patrick Tucker
Priority: Minor
 Fix For: 2.0.0


 It would be nice if PDDocument had an insertPage function similar to addPage, 
 but takes a number to indicate where to add the new page in the current set 
 of pages.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (PDFBOX-2400) Add insertPage() method

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson updated PDFBOX-2400:

Fix Version/s: (was: 2.0.0)
   2.1.0

 Add insertPage() method
 ---

 Key: PDFBOX-2400
 URL: https://issues.apache.org/jira/browse/PDFBOX-2400
 Project: PDFBox
  Issue Type: New Feature
  Components: PDModel
Affects Versions: 1.8.7, 2.0.0
Reporter: Patrick Tucker
Priority: Minor
 Fix For: 2.1.0


 It would be nice if PDDocument had an insertPage function similar to addPage, 
 but takes a number to indicate where to add the new page in the current set 
 of pages.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (PDFBOX-2578) Fuzzy matching of base 14 fonts

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson updated PDFBOX-2578:

Fix Version/s: (was: 2.0.0)
   2.1.0

 Fuzzy matching of base 14 fonts
 ---

 Key: PDFBOX-2578
 URL: https://issues.apache.org/jira/browse/PDFBOX-2578
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: John Hewson
Assignee: John Hewson
 Fix For: 2.1.0


 The file from PDFBOX-2573 has a font Helvetica~1d3 which Adobe Reader 
 recognises as a base 14 Helvetica. We should implement a similarly 
 forgiving font-matching mechanism for cases where there is no FontDescriptor.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (PDFBOX-994) Rendering issues with colors and transparency

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson updated PDFBOX-994:
---
Assignee: (was: John Hewson)

 Rendering issues with colors and transparency
 -

 Key: PDFBOX-994
 URL: https://issues.apache.org/jira/browse/PDFBOX-994
 Project: PDFBox
  Issue Type: Bug
  Components: Rendering
Affects Versions: 1.1.0, 1.5.0, 1.6.0, 2.0.0
 Environment: Debian Squeeze
Reporter: Andreas Romeyke
 Fix For: 2.0.0

 Attachments: PDFBOX994-Test_PDFBox1.png, Test_PDFBox.pdf, 
 Test_PDFBox.png, r1636079.jpg


 Hello,
 I am calling convertToImage() with a multicolored, standard PDF-file and the 
 resulting image does not contain the content of some colored stuff.
 An example of such a PDF-file (v1.4) could be sent...
 The same problem occurs in 1.5/1.4 and previous..., I 've also used the 
 bleeding edge from repository (2011-04-04), the problem still exists.
 Additionally, the following trace will be printed:
 04.04.2011 15:35:07 org.apache.pdfbox.util.PDFStreamEngine processOperator
 WARNUNG: java.lang.ClassCastException: org.apache.pdfbox.cos.COSFloat cannot 
 be cast to org.apache.pdfbox.cos.COSInteger
 java.lang.ClassCastException: org.apache.pdfbox.cos.COSFloat cannot be cast 
 to org.apache.pdfbox.cos.COSInteger
   at 
 org.apache.pdfbox.pdmodel.common.function.PDFunctionType2.eval(PDFunctionType2.java:81)
   at 
 org.apache.pdfbox.pdmodel.graphics.color.PDSeparation.calculateColorValues(PDSeparation.java:238)
   at 
 org.apache.pdfbox.util.operator.SetNonStrokingSeparation.process(SetNonStrokingSeparation.java:68)
   at 
 org.apache.pdfbox.util.operator.SetNonStrokingColor.process(SetNonStrokingColor.java:93)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:551)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:274)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
   at 
 org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:130)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:551)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:274)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:225)
   at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:107)
   at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:722)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Resolved] (PDFBOX-2753) Improve rendering of filled thin lines

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson resolved PDFBOX-2753.
-
Resolution: Fixed

 Improve rendering of filled thin lines
 --

 Key: PDFBOX-2753
 URL: https://issues.apache.org/jira/browse/PDFBOX-2753
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: John Hewson
Assignee: John Hewson
 Fix For: 2.0.0

 Attachments: bugzilla867751.pdf-3-nice.png, 
 bugzilla867751.pdf-3-not-so-nice.png


 While working on PDFBOX-1658 I noticed that the file also contains some thin 
 lines which disappear when rendering at lower resolutions. The problem is due 
 to the PDF having filled paths with a width  1px being used, rather than 
 using stroked paths. Because these paths are rectangular, they're triggering 
 our heuristic gradient detector which disables anti-aliasing.
 The solution is to increase the threshold for disabling anti-aliasing to 
 paths with a width and height  1, and this file now renders perfectly, even 
 at 72 dpi.
 See the discussion in PDFBOX-1658 for further information.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Resolved] (PDFBOX-2184) CMMException: Invalid profile data

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson resolved PDFBOX-2184.
-
Resolution: Fixed

 CMMException: Invalid profile data
 --

 Key: PDFBOX-2184
 URL: https://issues.apache.org/jira/browse/PDFBOX-2184
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Blocker
 Fix For: 2.0.0


 Jenkins builds are intermittently failing with the error:
 {code}
 java.awt.color.CMMException: Invalid profile data
   at sun.awt.color.CMM.checkStatus(CMM.java:131)
   at sun.awt.color.ICC_Transform.init(ICC_Transform.java:88)
   at java.awt.color.ICC_ColorSpace.toRGB(ICC_ColorSpace.java:144)
   at 
 org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB.toRGB(PDDeviceRGB.java:79)
   at 
 org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.toPaint(PDColorSpace.java:255)
   at 
 org.apache.pdfbox.rendering.PageDrawer.getNonStrokingPaint(PageDrawer.java:666)
   at org.apache.pdfbox.rendering.PageDrawer.fillPath(PageDrawer.java:739)
   at 
 org.apache.pdfbox.util.operator.pagedrawer.FillNonZeroRule.process(FillNonZeroRule.java:37)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:488)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:254)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:221)
   at 
 org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:130)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:488)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:254)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:221)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:197)
   at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:183)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:228)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:160)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:83)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:70)
   at org.apache.pdfbox.util.TestRendering.render(TestRendering.java:78)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2184) CMMException: Invalid profile data

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14681002#comment-14681002
 ] 

John Hewson commented on PDFBOX-2184:
-

Ported above mentioned PDDeviceCMYK change.

 CMMException: Invalid profile data
 --

 Key: PDFBOX-2184
 URL: https://issues.apache.org/jira/browse/PDFBOX-2184
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Blocker
 Fix For: 2.0.0


 Jenkins builds are intermittently failing with the error:
 {code}
 java.awt.color.CMMException: Invalid profile data
   at sun.awt.color.CMM.checkStatus(CMM.java:131)
   at sun.awt.color.ICC_Transform.init(ICC_Transform.java:88)
   at java.awt.color.ICC_ColorSpace.toRGB(ICC_ColorSpace.java:144)
   at 
 org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB.toRGB(PDDeviceRGB.java:79)
   at 
 org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.toPaint(PDColorSpace.java:255)
   at 
 org.apache.pdfbox.rendering.PageDrawer.getNonStrokingPaint(PageDrawer.java:666)
   at org.apache.pdfbox.rendering.PageDrawer.fillPath(PageDrawer.java:739)
   at 
 org.apache.pdfbox.util.operator.pagedrawer.FillNonZeroRule.process(FillNonZeroRule.java:37)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:488)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:254)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:221)
   at 
 org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:130)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:488)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:254)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:221)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:197)
   at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:183)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:228)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:160)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:83)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:70)
   at org.apache.pdfbox.util.TestRendering.render(TestRendering.java:78)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2184) CMMException: Invalid profile data

2015-08-10 Thread John Hewson (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14681001#comment-14681001
 ] 

John Hewson commented on PDFBOX-2184:
-

I have now!

 CMMException: Invalid profile data
 --

 Key: PDFBOX-2184
 URL: https://issues.apache.org/jira/browse/PDFBOX-2184
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Blocker
 Fix For: 2.0.0


 Jenkins builds are intermittently failing with the error:
 {code}
 java.awt.color.CMMException: Invalid profile data
   at sun.awt.color.CMM.checkStatus(CMM.java:131)
   at sun.awt.color.ICC_Transform.init(ICC_Transform.java:88)
   at java.awt.color.ICC_ColorSpace.toRGB(ICC_ColorSpace.java:144)
   at 
 org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB.toRGB(PDDeviceRGB.java:79)
   at 
 org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.toPaint(PDColorSpace.java:255)
   at 
 org.apache.pdfbox.rendering.PageDrawer.getNonStrokingPaint(PageDrawer.java:666)
   at org.apache.pdfbox.rendering.PageDrawer.fillPath(PageDrawer.java:739)
   at 
 org.apache.pdfbox.util.operator.pagedrawer.FillNonZeroRule.process(FillNonZeroRule.java:37)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:488)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:254)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:221)
   at 
 org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:130)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:488)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:254)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:221)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:197)
   at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:183)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:228)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:160)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:83)
   at 
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:70)
   at org.apache.pdfbox.util.TestRendering.render(TestRendering.java:78)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (PDFBOX-1848) Time Stamp Document Level Sigature

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-1848?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson updated PDFBOX-1848:

Fix Version/s: (was: 2.0.0)
   2.1.0

 Time Stamp Document Level Sigature
 --

 Key: PDFBOX-1848
 URL: https://issues.apache.org/jira/browse/PDFBOX-1848
 Project: PDFBox
  Issue Type: Improvement
  Components: Signing
Affects Versions: 2.0.0
Reporter: vakhtang koroghlishvili
 Fix For: 2.1.0

 Attachments: CreateTSASignature.java.patch, 
 TSA-SIG-LOOKS-LIKE-THIS.png


 We need TSA Document Level signature modulo too!
 At the moment we sign document with our certificate. But... sometimes we need 
 to sign document with TSA too. This is important part of signing. Sometimes 
 this is very very very important- for instance when we will implement PAdES 4 
 profile this module will be essential. without that Document Secure Store 
 will not work :)
 I'm working on this improvement. I'will finish this soon. It's almost done. I 
 only must add some java docs, and might be I change architect design and etc..
 So, please assign this it to me :) I will upload patch as soon as possible :)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Resolved] (PDFBOX-2366) Improve high-level font APIs

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson resolved PDFBOX-2366.
-
Resolution: Fixed

 Improve high-level font APIs
 

 Key: PDFBOX-2366
 URL: https://issues.apache.org/jira/browse/PDFBOX-2366
 Project: PDFBox
  Issue Type: Improvement
  Components: PDModel
Affects Versions: 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Minor
 Fix For: 2.0.0


 The PDFont and Type1Equivalent APIs could expose some higher-level details, 
 such as a consistent way to get names and Type1Equivalent instances.
 Some of the other font formats could also do with APIs exposing some specific 
 useful internals such as GIDs. I'm going to add these as I find that I have a 
 need for them during development and debugging.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Resolved] (PDFBOX-2437) PDFont isSymbolic() has unexpected return value

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2437?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson resolved PDFBOX-2437.
-
Resolution: Fixed

 PDFont isSymbolic() has unexpected return value
 ---

 Key: PDFBOX-2437
 URL: https://issues.apache.org/jira/browse/PDFBOX-2437
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Minor
 Fix For: 2.0.0


 From the mailing list:
 {quote}
 Hello,
 I believe the following lines should fallback to false instead of true.
 https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java#L401-L402
 {
// unless we can prove that the font is symbolic, we assume that it is
 not
isSymbolic = true;
 }
 Thought to let you know.
 Best Regards,
 Hisham
 {quote}
 Either the comment or the return value is wrong, but this code is very 
 brittle so we'll need to do lots of regression testing if any changes are 
 made.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2921) Validation fails if FontValidationProcess is not used

2015-08-10 Thread Petras (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14679757#comment-14679757
 ] 

Petras commented on PDFBOX-2921:


Oh, I see. I thought the design of these processes and their inclusion 
mechanism in {{PreflightConfiguration}} meant them being kind of validation 
features, which could be turned off to disable some validations. As neither 
{{ValidationProcess}} interface, nor its implementations' JavaDocs do not 
indicate such dependency, I made this assumption by reading 
{{PreflightConfiguration}} sources. Your post says I was wrong. Then It would 
be helpful if somewhere (in  {{PreflightConfiguration}} or 
{{ValidationProcess}} implementations) indicate on which processes the whole 
validation procedure depends and cannot be excluded.

 Validation fails if FontValidationProcess is not used
 -

 Key: PDFBOX-2921
 URL: https://issues.apache.org/jira/browse/PDFBOX-2921
 Project: PDFBox
  Issue Type: Bug
  Components: Preflight
Affects Versions: 1.8.10
Reporter: Petras

 The list validation processes to be used during validation may be controlled 
 by removing some of it or providing own implementation in 
 {{PreflightConfiguration}}. Unfortunately, there exists some coupling among 
 them - if {{FontValidationProcess}} is removed from the processes list, 
 {{ContentStreamWrapper}} fails with {{ERROR_FONTS_UNKNOWN_FONT_REF}} error:
 {quote}
 Glyph error, MyriadPro-Regular is unknown wasn't found by the 
 FontHelperValdiator
 {quote}
 as it does not get {{FontContainer}} instance for given {{PDFont}} from the 
 {{PreflightContext}}. It appears that {{FontValidator}} adds them.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Comment Edited] (PDFBOX-2923) CFFParser parser treats CIDFont's charset data as SID

2015-08-10 Thread Petras (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14679802#comment-14679802
 ] 

Petras edited comment on PDFBOX-2923 at 8/10/15 8:42 AM:
-

Yes, I think so. As ISO 32000-1 notes on Glyph Positioning and Metrics:
{quote}Storing this \[Width] information in the font dictionary, although 
redundant, enables a conforming reader to determine glyph positioning without 
having to look inside the font program.{quote}

Thus I guess most renderers generally rely on information in Font dictionary, 
not in Font program.


was (Author: abyss):
Yes, I think so. As ISO 32000-1 notes:
{quote}Storing this \[Width] information in the font dictionary, although 
redundant, enables a conforming reader to determine glyph positioning without 
having to look inside the font program.{quote}

Thus I guess most renderers generally rely on information in Font dictionary, 
not in Font program.

 CFFParser parser treats CIDFont's charset data as SID
 -

 Key: PDFBOX-2923
 URL: https://issues.apache.org/jira/browse/PDFBOX-2923
 Project: PDFBox
  Issue Type: Bug
  Components: FontBox
Affects Versions: 1.8.10
Reporter: Petras
 Fix For: 1.8.11

 Attachments: MyriadPro-Regular.cff, Patch_to_fix_PDFBOX-2923.patch, 
 sample-a2b-acrosigned_B.pdf


 As stated in Compact Font File specification:
 {quote}
 The charset data, although in the same format as non-CIDFonts, will represent 
 CIDs rather than SIDs, i.e. charstrings are “named” by CIDs in a CIDFont.
 {quote}
 Unfortunately, {{CFFParser}} does not consider this specific and always treat 
 charset data as SID: is looking for SID referenced text in _String INDEX_ 
 structure. Since such SID-indexed string does not exist there, it sets the 
 name of the glyph to {{.ndef}}.
 Consequently, {{CFFParser}} fails to register correct charstrings, as it 
 associates glyph names to them using a map. As there can be several 
 charstrings, only the last charstring entry is retained.
 Then also {{CFFFont.getWidth()}} method fails to return correct width of the 
 given CID as correct link between CID and charstring is lost.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2923) CFFParser parser treats CIDFont's charset data as SID

2015-08-10 Thread Petras (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14679802#comment-14679802
 ] 

Petras commented on PDFBOX-2923:


Yes, I think so. As ISO 32000-1 notes:
{quote}Storing this \[Width] information in the font dictionary, although 
redundant, enables a conforming reader to determine glyph positioning without 
having to look inside the font program.{quote}

Thus I guess most renderers generally rely on information in Font dictionary, 
not in Font program.

 CFFParser parser treats CIDFont's charset data as SID
 -

 Key: PDFBOX-2923
 URL: https://issues.apache.org/jira/browse/PDFBOX-2923
 Project: PDFBox
  Issue Type: Bug
  Components: FontBox
Affects Versions: 1.8.10
Reporter: Petras
 Fix For: 1.8.11

 Attachments: MyriadPro-Regular.cff, Patch_to_fix_PDFBOX-2923.patch, 
 sample-a2b-acrosigned_B.pdf


 As stated in Compact Font File specification:
 {quote}
 The charset data, although in the same format as non-CIDFonts, will represent 
 CIDs rather than SIDs, i.e. charstrings are “named” by CIDs in a CIDFont.
 {quote}
 Unfortunately, {{CFFParser}} does not consider this specific and always treat 
 charset data as SID: is looking for SID referenced text in _String INDEX_ 
 structure. Since such SID-indexed string does not exist there, it sets the 
 name of the glyph to {{.ndef}}.
 Consequently, {{CFFParser}} fails to register correct charstrings, as it 
 associates glyph names to them using a map. As there can be several 
 charstrings, only the last charstring entry is retained.
 Then also {{CFFFont.getWidth()}} method fails to return correct width of the 
 given CID as correct link between CID and charstring is lost.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2922) Make PDFPrintable and PDFPageable extandable

2015-08-10 Thread Pei-Tang Huang (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14679801#comment-14679801
 ] 

Pei-Tang Huang commented on PDFBOX-2922:


I tried `printWithPaper()` too, combination matrix as following:

|| No. || Scaling || PaperSize || PageFormat.orientation || Result (rotation) 
|| Result (not cropped) || Result (scale 1:1) ||
| 1 | SHRINK_TO_FIT | 210x297mm | default | x | *v* | x |
| 2 | SHRINK_TO_FIT | 297x210mm | default | x | x | x |
| 3 | ACTUAL_SIZE | 210x297mm | default | x | x | *v* |
| 4 | ACTUAL_SIZE | 297x210mm | default | x | x  | *v* |
| 5 | ACTUAL_SIZE | 210x297mm | LANDSCAPE | *v* | *v* | *v* |
| 6 | ACTUAL_SIZE | 297x210mm | LANDSCAPE | *v* | x | *v* |

Only the 5th combination is ok on my printer, and the pageFormat received in 
{{PDFPrintable.print}} was:

{code:none}
pageFormat = {PageFormat@2137} 
 mPaper = {Paper@2203} 
  mHeight = 841.8897399902344
  mWidth = 595.2755813598633
  mImageableArea = {Rectangle2D$Double@2204} 
java.awt.geom.Rectangle2D$Double[x=0.0,y=0.0,w=595.2755813598633,h=841.8897399902344]
 mOrientation = 0
{code}

Does it mean I can write my own {{PDFPageable}} which will also rotate paper 
size when modifying the orientation?

 Make PDFPrintable and PDFPageable extandable
 

 Key: PDFBOX-2922
 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Pei-Tang Huang
Assignee: John Hewson
 Attachments: landscape.pdf, rotated_cropping_failed.jpg, success.jpg


 Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
 {{PDFPageable}} so that one can extending those classes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2922) Make PDFPrintable and PDFPageable extandable

2015-08-10 Thread Pei-Tang Huang (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14679828#comment-14679828
 ] 

Pei-Tang Huang commented on PDFBOX-2922:


I think I finally find out what's happened in PDFBOX-2844, the original version 
of {{PDFPageable}} retrieving format using {{printerJob.defaultPage();}} and 
never modify {{paper}} since then, the paper in tray was PORTRAIT (height  
width), so the orientation rotation works fine here.

But since 
https://github.com/apache/pdfbox/commit/ecf69cccfa8a30e7884c56ed0d1c91b828824412
 , the {{paper}} was created from document itself, and the PDFPageable try to 
set paper size (in orientation) different from those paper loaded in tray, and 
produced wrong printing.


 Make PDFPrintable and PDFPageable extandable
 

 Key: PDFBOX-2922
 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Pei-Tang Huang
Assignee: John Hewson
 Attachments: landscape.pdf, rotated_cropping_failed.jpg, success.jpg


 Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
 {{PDFPageable}} so that one can extending those classes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (PDFBOX-2922) Make PDFPrintable and PDFPageable extandable

2015-08-10 Thread Pei-Tang Huang (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pei-Tang Huang updated PDFBOX-2922:
---
Attachment: success.jpg

success rotated using PDFPrintable and set OrientationRequestd = LANDSCAPE

 Make PDFPrintable and PDFPageable extandable
 

 Key: PDFBOX-2922
 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Pei-Tang Huang
Assignee: John Hewson
 Attachments: landscape.pdf, rotated_cropping_failed.jpg, success.jpg


 Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
 {{PDFPageable}} so that one can extending those classes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (PDFBOX-2922) Make PDFPrintable and PDFPageable extandable

2015-08-10 Thread Pei-Tang Huang (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pei-Tang Huang updated PDFBOX-2922:
---
Attachment: rotated_cropping_failed.jpg

Failed on rotating and/or cropping

 Make PDFPrintable and PDFPageable extandable
 

 Key: PDFBOX-2922
 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Pei-Tang Huang
Assignee: John Hewson
 Attachments: landscape.pdf, rotated_cropping_failed.jpg, success.jpg


 Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
 {{PDFPageable}} so that one can extending those classes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Resolved] (PDFBOX-2893) Simplify COSStream encoding and decoding

2015-08-10 Thread John Hewson (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2893?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson resolved PDFBOX-2893.
-
Resolution: Fixed

 Simplify COSStream encoding and decoding
 

 Key: PDFBOX-2893
 URL: https://issues.apache.org/jira/browse/PDFBOX-2893
 Project: PDFBox
  Issue Type: Improvement
Affects Versions: 2.0.0
Reporter: John Hewson
Assignee: John Hewson
Priority: Blocker
 Fix For: 2.0.0

 Attachments: PDFBOX-2893-2.patch


 Performance issues and memory usage issues surrounding streams are one of the 
 few things blocking the release of 2.0 (see  PDFBOX-2301, PDFBOX-2882, 
 PDFBOX-2883).
 Though we've managed to reduce some of the memory used by RandomAccessBuffer 
 and to take advantage of buffering of scratch files, we still have problems 
 with the amount of memory which COSStream holds onto. Changes introduced in 
 2.0 have resulted in COSStreams having a very complex relationship with 
 classes which hold a lot of memory in complex ways (e.g. the fields: 
 tempBuffer, filteredBuffer, unfilteredBuffer, filteredStream, 
 unFilteredStream, scratchFile). Access to scratch file pages in particular 
 does not seem to be well regulated, especially with regards to multithreading 
 (an avenue we'd at least like to leave open).
 Given recent flux, I'm doubtful that we can ship the current API for 
 COSStream w.r.t. RandomAccess without shipping performance issues or flaws 
 which will be unfixable without breaking changes.
 One of the recent changes to COSStream is that it now exposes a RandomAccess, 
 this is so that PDFStreamParser can parse content streams (as well as other 
 subclasses which handle xref and object streams). However, streams are 
 fundamentally not random access - stream filters are sequential. While the 
 consumer of a stream may wish to buffer the data (in memory or scratch) for 
 random access, COSStream itself does not need to expose such an elaborate API 
 - many pieces of gymnastics are performed inside COSStream to present this 
 illusion, at significant cost. We should remove that.
 But what about providing a RandomAccess for PDFStreamParser, 
 PDFObjectStreamParser, and PDFXrefStreamParser? It turns out that those 
 classes don't actually perform random I/O. They perform sequential I/O with a 
 buffer for peek/unread.
 We need to simplify to get 2.0 fast, lean, and maintainable. Here's what I 
 think we should do:
 1. Split the interfaces for sequential and random I/O
 - Introduce a new SequentialSource interface for sequential I/O, with thin 
 wrappers for RandomAccessRead and InputStream.
 - BaseParser will use SequentialSource rather than RandomAccessRead (this 
 will be inherited by PDFStreamParser, PDFObjectStreamParser, and 
 PDFXrefStreamParser).
 - COSParser will use RandomAccessRead and pass a SequentialSource wrapper to 
 it's superclass, BaseParser.
 2. Remove RandomAccess APIs from COSStream, expose only InputStream and 
 OutputStream, as we used to do. We can pass an InputStream to PDFStreamParser 
 using a wrapper which implements SequentialSource. This will remove 
 tempBuffer, filteredBuffer, and unfilteredBuffer from COSStream, all of which 
 hold memory.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (PDFBOX-2922) Make PDFPrintable and PDFPageable extandable

2015-08-10 Thread Pei-Tang Huang (JIRA)

 [ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pei-Tang Huang updated PDFBOX-2922:
---
Attachment: landscape.pdf

landscape document sample

 Make PDFPrintable and PDFPageable extandable
 

 Key: PDFBOX-2922
 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Pei-Tang Huang
Assignee: John Hewson
 Attachments: landscape.pdf


 Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
 {{PDFPageable}} so that one can extending those classes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-2922) Make PDFPrintable and PDFPageable extandable

2015-08-10 Thread Pei-Tang Huang (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14679712#comment-14679712
 ] 

Pei-Tang Huang commented on PDFBOX-2922:


1. The orientation problem we encountered is on printing landscape documents, 
the document [^landscape.pdf] is in A4 landscape format, the paper loaded in 
printer is A4 portrait, we update our code to align to the change made in 
PDFBOX-2844. However, the landscape document won't print correctly after then. 
I tried several combination of PDFPrintable/PDFPageable attributes and 
PrintRequestAttributes. Only {{PDFPrintable}} with 
{{PrintRequestAttribute[OrientationRequest] = LANDSCAPE}} printed out as 
desired as following:

!success.jpg|width=800,height=600!

and all other combination all failed like:

!rotated_cropping_failed.jpg|width=800,height=600!

2. *set the graphics origin to the origin of the imageable area (i.e the 
margins)* and *center on page* may not work on paper with *pre printed* 
materials, in those case, every millimeter matters.

 Make PDFPrintable and PDFPageable extandable
 

 Key: PDFBOX-2922
 URL: https://issues.apache.org/jira/browse/PDFBOX-2922
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 2.0.0
Reporter: Pei-Tang Huang
Assignee: John Hewson
 Attachments: landscape.pdf, rotated_cropping_failed.jpg, success.jpg


 Would you please remove the {{final}} modifier from {{PDFPrintable}} and 
 {{PDFPageable}} so that one can extending those classes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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