I'm using PDFBox > PDFRenderer.renderPageToGraphics to create an SVG from a PDF page and i was getting a NullPointerException every time, then, after a long backtrace i found this: drawImage(img, null, null) on their code, and i'm not really sure if the problem is in your code but this is what i found on the Java Specification:
If an AffineTransform is passed to drawImage(Image, AffineTransform, ImageObserver), the AffineTransform is used to transform the bounding box from image space to user space. If no AffineTransform is supplied, the bounding box is treated as if it is already in user space.
I'm guessing you need to do a null check on that method.
I'm using PDFBox > PDFRenderer.renderPageToGraphics to create an SVG from a PDF page and i was getting a NullPointerException every time, then, after a long backtrace i found this: drawImage(img, null, null) on their code, and i'm not really sure if the problem is in your code but this is what i found on the Java Specification:
(https://docs.oracle.com/javase/8/docs/api/java/awt/Graphics2D.html)
I'm guessing you need to do a null check on that method.
Thanks.