You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by John Lussmyer <Jo...@efi.com> on 2022/06/14 19:35:56 UTC
Possible bug with FunctionType3?
We are using PDFBox to render various PDF files in our product.
One customer is having issues due to PDFBox throwing a NullPointerException when certain files are rendered. (No, I don't have copies of the files - yet)
Any ideas on what could cause this?
java.lang.NullPointerException: null
at org.apache.pdfbox.pdmodel.common.function.PDFunctionType3.eval(PDFunctionType3.java:123) ~[pdfbox.jar:?]
at org.apache.pdfbox.pdmodel.graphics.shading.PDShading.evalFunction(PDShading.java:410) ~[pdfbox.jar:?]
at org.apache.pdfbox.pdmodel.graphics.shading.PDShading.evalFunction(PDShading.java:393) ~[pdfbox.jar:?]
at org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingContext.calcColorTable(AxialShadingContext.java:151) ~[pdfbox.jar:?]
at org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingContext.<init>(AxialShadingContext.java:128) ~[pdfbox.jar:?]
at org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingPaint.createContext(AxialShadingPaint.java:62) ~[pdfbox.jar:?]
at sun.java2d.pipe.AlphaPaintPipe.startSequence(Unknown Source) ~[?:?]
at sun.java2d.pipe.SpanShapeRenderer$Composite.startSequence(Unknown Source) ~[?:?]
at sun.java2d.pipe.SpanShapeRenderer.renderSpans(Unknown Source) ~[?:?]
at sun.java2d.pipe.SpanShapeRenderer.fill(Unknown Source) ~[?:?]
at sun.java2d.pipe.ValidatePipe.fill(Unknown Source) ~[?:?]
at sun.java2d.SunGraphics2D.fill(Unknown Source) ~[?:?]
at org.apache.pdfbox.rendering.PageDrawer.shadingFill(PageDrawer.java:1234) ~[pdfbox.jar:?]
....
I believe the version we are using is the 3.0.0-alpha2.
Confidentiality notice: This message may contain confidential information. It is intended only for the person to whom it is addressed. If you are not that person, you should not use this message. We request that you notify us by replying to this message, and then delete all copies including any contained in your reply. Thank you.
Re: Possible bug with FunctionType3?
Posted by John Lussmyer <Co...@CasaDelGato.com>.
I was able to get ahold of the customers PDF file - but it (of course) works just FINE for me on my system.
I have logs showing multiple identical failures for the customer - and lots of other files succeeding.
I'd really like to test your possible fix - but first I have to figure out how to reproduce the problem....
On Tue Jun 14 21:06:02 PDT 2022 THausherr@t-online.de said:
>Am 15.06.2022 um 05:42 schrieb Tilman Hausherr:
>> float[] functionResult = function.eval(functionValues);
>>
>> eval is an abstract method, but I don't see how any of its
>> implementation would return null :-( (but I just woke up)
>
>oops, the return of eval() is irrelevant here.
>
>Anyway, I fixed the possible bug below in
>https://issues.apache.org/jira/browse/PDFBOX-5459 , try a snapshot in an
>hour or two
>
>https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.0-SNAPSHOT/
--
Tigers prowl and Dragons soar in my dreams...
Re: Possible bug with FunctionType3?
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 15.06.2022 um 05:42 schrieb Tilman Hausherr:
> float[] functionResult = function.eval(functionValues);
>
> eval is an abstract method, but I don't see how any of its
> implementation would return null :-( (but I just woke up)
oops, the return of eval() is irrelevant here.
Anyway, I fixed the possible bug below in
https://issues.apache.org/jira/browse/PDFBOX-5459 , try a snapshot in an
hour or two
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.0-SNAPSHOT/
Tilman
>
> oh wait, there's this:
>
> if (functionsArray.length == 1)
> {
> // This doesn't make sense but it may happen ...
> function = functionsArray[0];
> PDRange encRange = getEncodeForParameter(0);
> x = interpolate(x, domain.getMin(), domain.getMax(),
> encRange.getMin(), encRange.getMax());
> }
>
> function has a null check, but in the else part only
>
> Tilman
>
> Am 14.06.2022 um 21:35 schrieb John Lussmyer:
>> We are using PDFBox to render various PDF files in our product.
>> One customer is having issues due to PDFBox throwing a
>> NullPointerException when certain files are rendered. (No, I don't
>> have copies of the files - yet)
>> Any ideas on what could cause this?
>>
>> java.lang.NullPointerException: null
>> at
>> org.apache.pdfbox.pdmodel.common.function.PDFunctionType3.eval(PDFunctionType3.java:123)
>> ~[pdfbox.jar:?]
>> at
>> org.apache.pdfbox.pdmodel.graphics.shading.PDShading.evalFunction(PDShading.java:410)
>> ~[pdfbox.jar:?]
>> at
>> org.apache.pdfbox.pdmodel.graphics.shading.PDShading.evalFunction(PDShading.java:393)
>> ~[pdfbox.jar:?]
>> at
>> org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingContext.calcColorTable(AxialShadingContext.java:151)
>> ~[pdfbox.jar:?]
>> at
>> org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingContext.<init>(AxialShadingContext.java:128)
>> ~[pdfbox.jar:?]
>> at
>> org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingPaint.createContext(AxialShadingPaint.java:62)
>> ~[pdfbox.jar:?]
>> at sun.java2d.pipe.AlphaPaintPipe.startSequence(Unknown Source)
>> ~[?:?]
>> at
>> sun.java2d.pipe.SpanShapeRenderer$Composite.startSequence(Unknown
>> Source) ~[?:?]
>> at sun.java2d.pipe.SpanShapeRenderer.renderSpans(Unknown Source)
>> ~[?:?]
>> at sun.java2d.pipe.SpanShapeRenderer.fill(Unknown Source) ~[?:?]
>> at sun.java2d.pipe.ValidatePipe.fill(Unknown Source) ~[?:?]
>> at sun.java2d.SunGraphics2D.fill(Unknown Source) ~[?:?]
>> at
>> org.apache.pdfbox.rendering.PageDrawer.shadingFill(PageDrawer.java:1234)
>> ~[pdfbox.jar:?]
>> ....
>>
>>
>> I believe the version we are using is the 3.0.0-alpha2.
>>
>> Confidentiality notice: This message may contain confidential
>> information. It is intended only for the person to whom it is
>> addressed. If you are not that person, you should not use this
>> message. We request that you notify us by replying to this message,
>> and then delete all copies including any contained in your reply.
>> Thank you.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Possible bug with FunctionType3?
Posted by Tilman Hausherr <TH...@t-online.de>.
float[] functionResult = function.eval(functionValues);
eval is an abstract method, but I don't see how any of its
implementation would return null :-( (but I just woke up)
oh wait, there's this:
if (functionsArray.length == 1)
{
// This doesn't make sense but it may happen ...
function = functionsArray[0];
PDRange encRange = getEncodeForParameter(0);
x = interpolate(x, domain.getMin(), domain.getMax(),
encRange.getMin(), encRange.getMax());
}
function has a null check, but in the else part only
Tilman
Am 14.06.2022 um 21:35 schrieb John Lussmyer:
> We are using PDFBox to render various PDF files in our product.
> One customer is having issues due to PDFBox throwing a NullPointerException when certain files are rendered. (No, I don't have copies of the files - yet)
> Any ideas on what could cause this?
>
> java.lang.NullPointerException: null
> at org.apache.pdfbox.pdmodel.common.function.PDFunctionType3.eval(PDFunctionType3.java:123) ~[pdfbox.jar:?]
> at org.apache.pdfbox.pdmodel.graphics.shading.PDShading.evalFunction(PDShading.java:410) ~[pdfbox.jar:?]
> at org.apache.pdfbox.pdmodel.graphics.shading.PDShading.evalFunction(PDShading.java:393) ~[pdfbox.jar:?]
> at org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingContext.calcColorTable(AxialShadingContext.java:151) ~[pdfbox.jar:?]
> at org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingContext.<init>(AxialShadingContext.java:128) ~[pdfbox.jar:?]
> at org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingPaint.createContext(AxialShadingPaint.java:62) ~[pdfbox.jar:?]
> at sun.java2d.pipe.AlphaPaintPipe.startSequence(Unknown Source) ~[?:?]
> at sun.java2d.pipe.SpanShapeRenderer$Composite.startSequence(Unknown Source) ~[?:?]
> at sun.java2d.pipe.SpanShapeRenderer.renderSpans(Unknown Source) ~[?:?]
> at sun.java2d.pipe.SpanShapeRenderer.fill(Unknown Source) ~[?:?]
> at sun.java2d.pipe.ValidatePipe.fill(Unknown Source) ~[?:?]
> at sun.java2d.SunGraphics2D.fill(Unknown Source) ~[?:?]
> at org.apache.pdfbox.rendering.PageDrawer.shadingFill(PageDrawer.java:1234) ~[pdfbox.jar:?]
> ....
>
>
> I believe the version we are using is the 3.0.0-alpha2.
>
> Confidentiality notice: This message may contain confidential information. It is intended only for the person to whom it is addressed. If you are not that person, you should not use this message. We request that you notify us by replying to this message, and then delete all copies including any contained in your reply. Thank you.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org