[jira] [Resolved] (PDFBOX-5587) NullPointerException in PDTrueTypeFont.java getPath( )

2023-04-13 Thread Tilman Hausherr (Jira)


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

Tilman Hausherr resolved PDFBOX-5587.
-
Fix Version/s: 2.0.29
   3.0.0 PDFBox
 Assignee: Tilman Hausherr
   Resolution: Fixed

> NullPointerException in PDTrueTypeFont.java getPath( )
> --
>
> Key: PDFBOX-5587
> URL: https://issues.apache.org/jira/browse/PDFBOX-5587
> Project: PDFBox
>  Issue Type: Bug
>  Components: Parsing
>Affects Versions: 2.0.25
> Environment: Linux server
>Reporter: Lonzak
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.29, 3.0.0 PDFBox
>
>
> Since April we get the following NPE in our software.
> PDFBox is used to convert PDFs to images.
>  
> {code:java}
> java.lang.NullPointerException: null
>     at 
> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.getPath(PDTrueTypeFont.java:470)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.TTFGlyph2D.getPathForGID(TTFGlyph2D.java:144) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.TTFGlyph2D.getPathForCharacterCode(TTFGlyph2D.java:93)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:514) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PageDrawer.showFontGlyph(PageDrawer.java:495) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:793)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:811)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:749)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showTextString(PDFStreamEngine.java:608)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.operator.text.ShowText.process(ShowText.java:56)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:939)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:514)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:492)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:282) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:355) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:272) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:258)
>  ~[pdfbox-2.0.25.jar:2.0.25]{code}
> This is a bit strange, since I thought that this bug was fixed with 
> PDFBOX-3488
> PdfBox is running on a linux server but when I tried to access the PDFs I 
> failed to find the right one (over 1 million docs on that server).
> On the other hand the fix linked in the ticket points to the following 
> implementation:
>  
> {code:java}
>  @Override
>  public GeneralPath getPath(int code) throws IOException{
>    if (ttf.getGlyph() == null){
>      throw new IOException("glyf table is missing in font " + getName());
>    } {code}
> which does not exist anymore in 2.0.3 or higher:
>  
> {code:java}
> @Override
>     public GeneralPath getPath(int code) throws IOException{
>         int gid = codeToGID(code);
>         GlyphData glyph = ttf.getGlyph().getGlyph(gid); {code}
> Any idea why an NPE might occur?
> `ttf` might be null or `getGlyph` returns null?
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Commented] (PDFBOX-5587) NullPointerException in PDTrueTypeFont.java getPath( )

2023-04-13 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-5587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17712010#comment-17712010
 ] 

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

Commit 1909123 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1909123 ]

PDFBOX-5587: avoid NullPointerException if glyf table is missing

> NullPointerException in PDTrueTypeFont.java getPath( )
> --
>
> Key: PDFBOX-5587
> URL: https://issues.apache.org/jira/browse/PDFBOX-5587
> Project: PDFBox
>  Issue Type: Bug
>  Components: Parsing
>Affects Versions: 2.0.25
> Environment: Linux server
>Reporter: Lonzak
>Priority: Major
>
> Since April we get the following NPE in our software.
> PDFBox is used to convert PDFs to images.
>  
> {code:java}
> java.lang.NullPointerException: null
>     at 
> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.getPath(PDTrueTypeFont.java:470)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.TTFGlyph2D.getPathForGID(TTFGlyph2D.java:144) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.TTFGlyph2D.getPathForCharacterCode(TTFGlyph2D.java:93)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:514) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PageDrawer.showFontGlyph(PageDrawer.java:495) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:793)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:811)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:749)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showTextString(PDFStreamEngine.java:608)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.operator.text.ShowText.process(ShowText.java:56)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:939)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:514)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:492)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:282) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:355) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:272) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:258)
>  ~[pdfbox-2.0.25.jar:2.0.25]{code}
> This is a bit strange, since I thought that this bug was fixed with 
> PDFBOX-3488
> PdfBox is running on a linux server but when I tried to access the PDFs I 
> failed to find the right one (over 1 million docs on that server).
> On the other hand the fix linked in the ticket points to the following 
> implementation:
>  
> {code:java}
>  @Override
>  public GeneralPath getPath(int code) throws IOException{
>    if (ttf.getGlyph() == null){
>      throw new IOException("glyf table is missing in font " + getName());
>    } {code}
> which does not exist anymore in 2.0.3 or higher:
>  
> {code:java}
> @Override
>     public GeneralPath getPath(int code) throws IOException{
>         int gid = codeToGID(code);
>         GlyphData glyph = ttf.getGlyph().getGlyph(gid); {code}
> Any idea why an NPE might occur?
> `ttf` might be null or `getGlyph` returns null?
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Commented] (PDFBOX-5587) NullPointerException in PDTrueTypeFont.java getPath( )

2023-04-13 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-5587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17712009#comment-17712009
 ] 

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

Commit 1909122 from Tilman Hausherr in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1909122 ]

PDFBOX-5587: avoid NullPointerException if glyf table is missing

> NullPointerException in PDTrueTypeFont.java getPath( )
> --
>
> Key: PDFBOX-5587
> URL: https://issues.apache.org/jira/browse/PDFBOX-5587
> Project: PDFBox
>  Issue Type: Bug
>  Components: Parsing
>Affects Versions: 2.0.25
> Environment: Linux server
>Reporter: Lonzak
>Priority: Major
>
> Since April we get the following NPE in our software.
> PDFBox is used to convert PDFs to images.
>  
> {code:java}
> java.lang.NullPointerException: null
>     at 
> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.getPath(PDTrueTypeFont.java:470)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.TTFGlyph2D.getPathForGID(TTFGlyph2D.java:144) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.TTFGlyph2D.getPathForCharacterCode(TTFGlyph2D.java:93)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:514) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PageDrawer.showFontGlyph(PageDrawer.java:495) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:793)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:811)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:749)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showTextString(PDFStreamEngine.java:608)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.operator.text.ShowText.process(ShowText.java:56)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:939)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:514)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:492)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:282) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:355) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:272) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:258)
>  ~[pdfbox-2.0.25.jar:2.0.25]{code}
> This is a bit strange, since I thought that this bug was fixed with 
> PDFBOX-3488
> PdfBox is running on a linux server but when I tried to access the PDFs I 
> failed to find the right one (over 1 million docs on that server).
> On the other hand the fix linked in the ticket points to the following 
> implementation:
>  
> {code:java}
>  @Override
>  public GeneralPath getPath(int code) throws IOException{
>    if (ttf.getGlyph() == null){
>      throw new IOException("glyf table is missing in font " + getName());
>    } {code}
> which does not exist anymore in 2.0.3 or higher:
>  
> {code:java}
> @Override
>     public GeneralPath getPath(int code) throws IOException{
>         int gid = codeToGID(code);
>         GlyphData glyph = ttf.getGlyph().getGlyph(gid); {code}
> Any idea why an NPE might occur?
> `ttf` might be null or `getGlyph` returns null?
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Commented] (PDFBOX-2602) Enhance command line tools

2023-04-13 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-2602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17712006#comment-17712006
 ] 

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

Commit 1909121 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1909121 ]

PDFBOX-2602: update picocli

> Enhance command line tools
> --
>
> Key: PDFBOX-2602
> URL: https://issues.apache.org/jira/browse/PDFBOX-2602
> Project: PDFBox
>  Issue Type: Bug
>  Components: Utilities
>Affects Versions: 1.8.8, 2.0.0
>Reporter: Maruan Sahyoun
>Assignee: Maruan Sahyoun
>Priority: Minor
> Fix For: 3.0.0 PDFBox
>
>
> The command line tools shall be enhanced to have the same behavior across all 
> tools.
> From the discussion on the dev mailing list
> - add an -h option to print the usage
> - print the usage to System.err and use an exit code of 1 if there was an 
> invalid command line parameter
> - print messages on exceptions to System.err
> - rethrow the exception so java can handle it if it will terminate afterwards 
> anyway
> - use an exit code of 1if rethrowing doesn't make sense
> Additional input:
> https://clig.dev/



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Commented] (PDFBOX-5587) NullPointerException in PDTrueTypeFont.java getPath( )

2023-04-13 Thread Tilman Hausherr (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-5587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17712005#comment-17712005
 ] 

Tilman Hausherr commented on PDFBOX-5587:
-

Yes it was fixed in PDFBOX-3488 but also reverted. John wrote that this 
shouldn't happen because it should have been caught earlier and he made a 
change to catch it earlier. I'll put it back in the hope that somebody will 
submit a file with the problem and then we'll know why it happens.

> NullPointerException in PDTrueTypeFont.java getPath( )
> --
>
> Key: PDFBOX-5587
> URL: https://issues.apache.org/jira/browse/PDFBOX-5587
> Project: PDFBox
>  Issue Type: Bug
>  Components: Parsing
>Affects Versions: 2.0.25
> Environment: Linux server
>Reporter: Lonzak
>Priority: Major
>
> Since April we get the following NPE in our software.
> PDFBox is used to convert PDFs to images.
>  
> {code:java}
> java.lang.NullPointerException: null
>     at 
> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.getPath(PDTrueTypeFont.java:470)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.TTFGlyph2D.getPathForGID(TTFGlyph2D.java:144) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.TTFGlyph2D.getPathForCharacterCode(TTFGlyph2D.java:93)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:514) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PageDrawer.showFontGlyph(PageDrawer.java:495) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:793)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:811)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:749)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.showTextString(PDFStreamEngine.java:608)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.operator.text.ShowText.process(ShowText.java:56)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:939)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:514)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:492)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
>  ~[pdfbox-2.0.25.jar:2.0.25]
>     at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:282) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:355) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:272) 
> ~[pdfbox-2.0.25.jar:2.0.25]
>     at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:258)
>  ~[pdfbox-2.0.25.jar:2.0.25]{code}
> This is a bit strange, since I thought that this bug was fixed with 
> PDFBOX-3488
> PdfBox is running on a linux server but when I tried to access the PDFs I 
> failed to find the right one (over 1 million docs on that server).
> On the other hand the fix linked in the ticket points to the following 
> implementation:
>  
> {code:java}
>  @Override
>  public GeneralPath getPath(int code) throws IOException{
>    if (ttf.getGlyph() == null){
>      throw new IOException("glyf table is missing in font " + getName());
>    } {code}
> which does not exist anymore in 2.0.3 or higher:
>  
> {code:java}
> @Override
>     public GeneralPath getPath(int code) throws IOException{
>         int gid = codeToGID(code);
>         GlyphData glyph = ttf.getGlyph().getGlyph(gid); {code}
> Any idea why an NPE might occur?
> `ttf` might be null or `getGlyph` returns null?
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Updated] (PDFBOX-5587) NullPointerException in PDTrueTypeFont.java getPath( )

2023-04-13 Thread Lonzak (Jira)


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

Lonzak updated PDFBOX-5587:
---
Description: 
Since April we get the following NPE in our software.

PDFBox is used to convert PDFs to images.

 
{code:java}
java.lang.NullPointerException: null
    at 
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.getPath(PDTrueTypeFont.java:470) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.TTFGlyph2D.getPathForGID(TTFGlyph2D.java:144) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.TTFGlyph2D.getPathForCharacterCode(TTFGlyph2D.java:93)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:514) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.PageDrawer.showFontGlyph(PageDrawer.java:495) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:793)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:811)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:749)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showTextString(PDFStreamEngine.java:608)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.operator.text.ShowText.process(ShowText.java:56)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:939)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:514)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:492)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:282) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:355) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:272) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:258)
 ~[pdfbox-2.0.25.jar:2.0.25]{code}
This is a bit strange, since I thought that this bug was fixed with PDFBOX-3488

PdfBox is running on a linux server but when I tried to access the PDFs I 
failed to find the right one (over 1 million docs on that server).

On the other hand the fix linked in the ticket points to the following 
implementation:

 
{code:java}
 @Override
 public GeneralPath getPath(int code) throws IOException{
   if (ttf.getGlyph() == null){
     throw new IOException("glyf table is missing in font " + getName());
   } {code}
which does not exist anymore in 2.0.3 or higher:

 
{code:java}
@Override
    public GeneralPath getPath(int code) throws IOException{
        int gid = codeToGID(code);
        GlyphData glyph = ttf.getGlyph().getGlyph(gid); {code}
Any idea why an NPE might occur?

`ttf` might be null or `getGlyph` returns null?

 

  was:
*Since some time we get the following Nullpointer when using PdfBox:*

 

 
{code:java}
java.lang.NullPointerException: null
    at 
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.getPath(PDTrueTypeFont.java:470) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.TTFGlyph2D.getPathForGID(TTFGlyph2D.java:144) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.TTFGlyph2D.getPathForCharacterCode(TTFGlyph2D.java:93)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:514) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.PageDrawer.showFontGlyph(PageDrawer.java:495) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:793)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:811)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:749)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showTextString(PDFStreamEngine.java:608)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.operator.text.ShowText.process(ShowText.java:56)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:939)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:514)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:492)
 

[jira] [Created] (PDFBOX-5587) NullPointerException in PDTrueTypeFont.java getPath( )

2023-04-13 Thread Lonzak (Jira)
Lonzak created PDFBOX-5587:
--

 Summary: NullPointerException in PDTrueTypeFont.java getPath( )
 Key: PDFBOX-5587
 URL: https://issues.apache.org/jira/browse/PDFBOX-5587
 Project: PDFBox
  Issue Type: Bug
  Components: Parsing
Affects Versions: 2.0.25
 Environment: Linux server
Reporter: Lonzak


*Since some time we get the following Nullpointer when using PdfBox:*

 

 
{code:java}
java.lang.NullPointerException: null
    at 
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.getPath(PDTrueTypeFont.java:470) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.TTFGlyph2D.getPathForGID(TTFGlyph2D.java:144) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.TTFGlyph2D.getPathForCharacterCode(TTFGlyph2D.java:93)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:514) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.PageDrawer.showFontGlyph(PageDrawer.java:495) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:793)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:811)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:749)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showTextString(PDFStreamEngine.java:608)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.operator.text.ShowText.process(ShowText.java:56)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:939)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:514)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:492)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
 ~[pdfbox-2.0.25.jar:2.0.25]
    at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:282) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:355) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:272) 
~[pdfbox-2.0.25.jar:2.0.25]
    at 
org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:258)
 ~[pdfbox-2.0.25.jar:2.0.25]{code}
This is a bit strange since I thought that this bug was fixed with 
[PDFBOX-3488|https://issues.apache.org/jira/browse/PDFBOX-3488]

PdfBox is running on a linux server but when I tried to access the PDFs I 
failed to find the right one (over 1 million docs on that server).

On the other hand the fix linked in the ticket points to the following 
implementation:

 
{code:java}
 @Override
 public GeneralPath getPath(int code) throws IOException{
   if (ttf.getGlyph() == null){
     throw new IOException("glyf table is missing in font " + getName());
   } {code}
which does not exist anymore in 2.0.3 or higher:

 
{code:java}
@Override
    public GeneralPath getPath(int code) throws IOException{
        int gid = codeToGID(code);
        GlyphData glyph = ttf.getGlyph().getGlyph(gid); {code}
Any idea why an NPE might occur?

 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[ANNOUNCE] Apache PDFBox 2.0.28 released

2023-04-13 Thread Andreas Lehmkuehler

The Apache PDFBox community is pleased to announce the release of
Apache PDFBox version 2.0.28. The release is available for download at:

https://pdfbox.apache.org/download.html

See the full release notes below for details about this release.

Release Notes -- Apache PDFBox -- Version 2.0.28

Introduction


The Apache PDFBox library is an open source Java tool for working with PDF 
documents.


This is an incremental bugfix release based on the earlier 2.0.27 release. It 
contains a couple of fixes and small improvements.


For more details on these changes and all the other fixes and improvements
included in this release, please refer to the following issues on the
PDFBox issue tracker at https://issues.apache.org/jira/browse/PDFBOX.

Bug

[PDFBOX-4531] - Extraction of Arabic PDF has incorrect ordering of normalized 
ligatures

[PDFBOX-5178] - Parsing differences between 2.0.23 and 2.0.24/3.0
[PDFBOX-5521] - Signing tries to set byteRange of old signature
[PDFBOX-5523] - Bug in 
org/apache/pdfbox/multipdf/Overlay#overlay(specificPageOverlayFile)

[PDFBOX-5524] - Inactive OCGs shown when not top level
[PDFBOX-5525] - Null pointer exception in PDFASchemaType.getNamespaceURI()
[PDFBOX-5540] - export:text creates jibberish / malformed output
[PDFBOX-5552] - ArrayIndexOutOfBounds in SampledImageReader.fromAny()
[PDFBOX-5553] - PDFRenderer resulting image has black background
[PDFBOX-] - NPE due to a malformed rectangle
[PDFBOX-5557] - Fix meta markup in HTML generation
[PDFBOX-5562] - ArrayIndexOutOfBoundsException in CFFCIDFont class
[PDFBOX-5563] - Can't open PDF with PDFBox: java.awt.color.CMMException: LCMS 
error 13: Couldn't link the profiles

[PDFBOX-5566] - ClassCastException in ShadingFill.process()
[PDFBOX-5567] - Font gets smaller for each rendered page
[PDFBOX-5572] - fix some logging inconsistencies
[PDFBOX-5577] - NPE in PDFMergerUtility.acroFormLegacyMode()
[PDFBOX-5582] - Avoid OOME when parsing an malformed pdf with a corrupted object 
stream


Improvement

[PDFBOX-5526] - Apply subsampling and region to masks
[PDFBOX-5534] - Remove finalize from ScratchFileBuffer
[PDFBOX-5549] - Invisible signature field is not referenced from /Annots 
dictionary of a Page

[PDFBOX-5554] - Support charset parameter in TextToPDF
[PDFBOX-5560] - Add a method to get the components of a composite glyph
[PDFBOX-5564] - PDResource font cache improvement
[PDFBOX-5565] - RFE: Comb flag warning
[PDFBOX-5573] - fix unnecessary boxing/unboxing
[PDFBOX-5575] - optimize LZWFilter
[PDFBOX-5581] - renderer.setSubsamplingAllowed(true) causing the picture to blur

Task

[PDFBOX-5535] - Remove Travis build

Release Contents


This release consists of a single source archive packaged as a zip file.
The archive can be unpacked with the jar tool from your JDK installation.
See the README.txt file for instructions on how to build this release.

The source archive is accompanied by a SHA512 checksum and a PGP signature
that you can use to verify the authenticity of your download.
The public key used for the PGP signature can be found at
https://www.apache.org/dist/pdfbox/KEYS.

About Apache PDFBox
---

Apache PDFBox is an open source Java library for working with PDF documents.
This project allows creation of new PDF documents, manipulation of existing
documents and the ability to extract content from documents. Apache PDFBox
also includes several command line utilities. Apache PDFBox is published
under the Apache License, Version 2.0.

For more information, visit https://pdfbox.apache.org/

About The Apache Software Foundation


Established in 1999, The Apache Software Foundation provides organizational,
legal, and financial support for more than 100 freely-available,
collaboratively-developed Open Source projects. The pragmatic Apache License
enables individual and commercial users to easily deploy Apache software;
the Foundation's intellectual property framework limits the legal exposure
of its 2,500+ contributors.

For more information, visit https://www.apache.org/

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



[RESULT][VOTE] Release Apache PDFBox 2.0.28

2023-04-13 Thread Andreas Lehmkuehler

Am 10.04.23 um 12:15 schrieb Andreas Lehmkuehler:

Please vote on releasing this package as Apache PDFBox 2.0.28.


   +1 Tilman Hausherr
   +1 Maruan Sahyoun
   +1 Tim Allison
   +1 Andreas Lehmkühler

Thanks for your support and help!! I'm going to push the release out.

Andreas



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



Jenkins build is back to stable : PDFBox » PDFBox-sonar2 #1008

2023-04-13 Thread Apache Jenkins Server
See 



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



Jenkins build is back to stable : PDFBox » PDFBox-sonar2 » Apache PDFBox examples #1008

2023-04-13 Thread Apache Jenkins Server
See 



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



[jira] [Resolved] (PDFBOX-5586) NullPointerException when closing RandomAccessReadMemoryMappedFile more than once

2023-04-13 Thread Jira


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

Andreas Lehmkühler resolved PDFBOX-5586.

Resolution: Fixed

I've added two null checks based on Matts proposal

> NullPointerException when closing RandomAccessReadMemoryMappedFile more than 
> once
> -
>
> Key: PDFBOX-5586
> URL: https://issues.apache.org/jira/browse/PDFBOX-5586
> Project: PDFBox
>  Issue Type: Bug
>  Components: IO
>Affects Versions: 3.0.0 PDFBox
>Reporter: Andreas Lehmkühler
>Assignee: Andreas Lehmkühler
>Priority: Major
> Fix For: 3.0.0 PDFBox
>
>
> Matt Bamberger posted an error on users@pdfbox.a.o
> {quote}
> I'm using pdfbox 3.0.0-alpha3
> When I use a RandomAccessReadMemoryMappedFile to load a PDDocument, I get a 
> NullPointerException when I close it after the PDDocument is closed:
> {code}
> try (RandomAccessReadMemoryMappedFile reader = new 
> RandomAccessReadMemoryMappedFile(file)) {
>   try (PDDocument doc = Loader.loadPDF(reader, null, null, null, null)) {
> // ...
>   }
> }
> {code}
> I found that it's because this.mappedByteBuffer is already null the second 
> time around, so I think you can just wrap in a not-null check:
> {code}
> public void close() throws IOException {
>   if (this.fileChannel != null) {
> this.fileChannel.close();
>   }
>   if (this.mappedByteBuffer != null) { // add this
> Optional.ofNullable(this.unmapper).ifPresent((u) -> {
>   u.accept(this.mappedByteBuffer); // exception is thrown in here
> });
> this.mappedByteBuffer = null;
>   }
> }
> {code}
> {quote}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Commented] (PDFBOX-5586) NullPointerException when closing RandomAccessReadMemoryMappedFile more than once

2023-04-13 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-5586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17711704#comment-17711704
 ] 

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

Commit 1909115 from le...@apache.org in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1909115 ]

PDFBOX-5586: added null checks based on a proposal by Matt Bamberger

> NullPointerException when closing RandomAccessReadMemoryMappedFile more than 
> once
> -
>
> Key: PDFBOX-5586
> URL: https://issues.apache.org/jira/browse/PDFBOX-5586
> Project: PDFBox
>  Issue Type: Bug
>  Components: IO
>Affects Versions: 3.0.0 PDFBox
>Reporter: Andreas Lehmkühler
>Assignee: Andreas Lehmkühler
>Priority: Major
> Fix For: 3.0.0 PDFBox
>
>
> Matt Bamberger posted an error on users@pdfbox.a.o
> {quote}
> I'm using pdfbox 3.0.0-alpha3
> When I use a RandomAccessReadMemoryMappedFile to load a PDDocument, I get a 
> NullPointerException when I close it after the PDDocument is closed:
> {code}
> try (RandomAccessReadMemoryMappedFile reader = new 
> RandomAccessReadMemoryMappedFile(file)) {
>   try (PDDocument doc = Loader.loadPDF(reader, null, null, null, null)) {
> // ...
>   }
> }
> {code}
> I found that it's because this.mappedByteBuffer is already null the second 
> time around, so I think you can just wrap in a not-null check:
> {code}
> public void close() throws IOException {
>   if (this.fileChannel != null) {
> this.fileChannel.close();
>   }
>   if (this.mappedByteBuffer != null) { // add this
> Optional.ofNullable(this.unmapper).ifPresent((u) -> {
>   u.accept(this.mappedByteBuffer); // exception is thrown in here
> });
> this.mappedByteBuffer = null;
>   }
> }
> {code}
> {quote}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Created] (PDFBOX-5586) NullPointerException when closing RandomAccessReadMemoryMappedFile more than once

2023-04-13 Thread Jira
Andreas Lehmkühler created PDFBOX-5586:
--

 Summary: NullPointerException when closing 
RandomAccessReadMemoryMappedFile more than once
 Key: PDFBOX-5586
 URL: https://issues.apache.org/jira/browse/PDFBOX-5586
 Project: PDFBox
  Issue Type: Bug
  Components: IO
Affects Versions: 3.0.0 PDFBox
Reporter: Andreas Lehmkühler
Assignee: Andreas Lehmkühler
 Fix For: 3.0.0 PDFBox


Matt Bamberger posted an error on users@pdfbox.a.o
{quote}
I'm using pdfbox 3.0.0-alpha3
When I use a RandomAccessReadMemoryMappedFile to load a PDDocument, I get a 
NullPointerException when I close it after the PDDocument is closed:

{code}
try (RandomAccessReadMemoryMappedFile reader = new 
RandomAccessReadMemoryMappedFile(file)) {
  try (PDDocument doc = Loader.loadPDF(reader, null, null, null, null)) {
// ...
  }
}
{code}

I found that it's because this.mappedByteBuffer is already null the second time 
around, so I think you can just wrap in a not-null check:

{code}
public void close() throws IOException {
  if (this.fileChannel != null) {
this.fileChannel.close();
  }

  if (this.mappedByteBuffer != null) { // add this
Optional.ofNullable(this.unmapper).ifPresent((u) -> {
  u.accept(this.mappedByteBuffer); // exception is thrown in here
});
this.mappedByteBuffer = null;
  }
}
{code}
{quote}




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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