Skip to content

JFIF APP0 must be first marker after SOI #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4,892 commits into
base: trunk
Choose a base branch
from
Open

JFIF APP0 must be first marker after SOI #104

wants to merge 4,892 commits into from

Conversation

zengquan
Copy link

@zengquan zengquan commented Feb 5, 2021

i'm insert a picture into my template.pdf
`PDImageXObject image = PDImageXObject.createFromFile(“C:/tmp/db20dacea96841098d8b34635c8aec1e.jpg”, document);
PDPageContentStream contentStream = new PDPageContentStream(document, document.getPage(0), PDPageContentStream.AppendMode.APPEND, true);
contentStream.drawImage(image, x , y,width, height);

javax.imageio.IIOException: JFIF APP0 must be first marker after SOI
at com.sun.imageio.plugins.jpeg.JPEGMetadata.(JPEGMetadata.java:224) ~[na:1.8.0_121]
at com.sun.imageio.plugins.jpeg.JPEGImageReader.getImageMetadata(JPEGImageReader.java:1023) ~[na:1.8.0_121]
at org.apache.pdfbox.pdmodel.graphics.image.JPEGFactory.getNumComponentsFromImageMetadata(JPEGFactory.java:213) [pdfbox-app-2.0.22.jar:2.0.22]
at org.apache.pdfbox.pdmodel.graphics.image.JPEGFactory.retrieveDimensions(JPEGFactory.java:182) [pdfbox-app-2.0.22.jar:2.0.22]
at org.apache.pdfbox.pdmodel.graphics.image.JPEGFactory.createFromByteArray(JPEGFactory.java:103) [pdfbox-app-2.0.22.jar:2.0.22]
at org.apache.pdfbox.pdmodel.graphics.image.JPEGFactory.createFromStream(JPEGFactory.java:85) [pdfbox-app-2.0.22.jar:2.0.22]
at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.createFromFileByExtension(PDImageXObject.java:241) [pdfbox-app-2.0.22.jar:2.0.22]
at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.createFromFile(PDImageXObject.java:202) [pdfbox-app-2.0.22.jar:2.0.22]`

THausherr and others added 30 commits September 12, 2024 14:35
THausherr and others added 30 commits May 5, 2025 12:09
…ke a list of it for postprocessing

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/branches/2.0@1925614 13f79535-47bb-0310-9956-ffa450edef68
…have a /Pg entry itself or in the parent

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/branches/2.0@1925781 13f79535-47bb-0310-9956-ffa450edef68
…ake a list of it for postprocessing

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/branches/2.0@1925812 13f79535-47bb-0310-9956-ffa450edef68
…y because source had the wrong /Pg entry

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/branches/2.0@1925815 13f79535-47bb-0310-9956-ffa450edef68
…e whitespace at the beginning of an inline image

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/branches/2.0@1926036 13f79535-47bb-0310-9956-ffa450edef68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants