Git Product home page Git Product logo

Comments (10)

tobwen avatar tobwen commented on July 20, 2024 1

under512byte.pdf

Ah, I can upload it by drag'n'drop. Here it is.

from pdfcpu.

hhrutter avatar hhrutter commented on July 20, 2024 1

There are a lot of things that can go wrong just during the initial process of detecting xref sections, xref streams and such, because PDFWriters mess up. That's why.

from pdfcpu.

hhrutter avatar hhrutter commented on July 20, 2024 1

This is fixed with the latest commit!

from pdfcpu.

tobwen avatar tobwen commented on July 20, 2024

Hell... I figured it out. The PDF needs to have a minimum size of 512 byte to get recognized by pdfcpu!

%PDF-1.0
%äöüß

1 0 obj
<<
    /Type
    /Catalog
    /Pages 2 0 R
>>
endobj

2 0 obj
<<
    /Type
    /Pages
    /Count 1
    /Kids [ 3 0 R ]
    /MediaBox [ 0 0 5 5 ]
>>
endobj

3 0 obj
<<
    /Type
    /Page
    /Parent 2 0 R
>>
endobj

xref
0 4
0000000000 65535 f 
0000000016 00000 n 
0000000078 00000 n 
0000000180 00000 n 

trailer
<<
    /Root 1 0 R
    /Size 4
>>

%We need padding to reach a minimum filesize of 512 bytes.
%We need padding to reach a minimum filesize of 512 bytes.

startxref
240
%%EOF

from pdfcpu.

hhrutter avatar hhrutter commented on July 20, 2024

Can you do me a favor and share this file for analysis?
Thank you!

from pdfcpu.

tobwen avatar tobwen commented on July 20, 2024

Can you do me a favor and share this file for analysis?

Hm? I did. Just copy the code into a file and save it as PDF.

However, the error would have to be renamed. The problem was not my PDF, but that the minimum size in pdfcpu must be 512 bytes - as far as I know, this does not have to be the case.

from pdfcpu.

hhrutter avatar hhrutter commented on July 20, 2024

Nope that's not really how it works.
Many times the issue is how the file was saved, specific offsets and such,
A real file needs to be the starting point for analysis.

from pdfcpu.

tobwen avatar tobwen commented on July 20, 2024

Nope that's not really how it works.

Interesting view. This is the first time I've heard that someone prefers a binary file

Many times the issue is how the file was saved, specific offsets and such,

I've been working with handcrafted PDFs for many years and never ran into such issues. But okay...

from pdfcpu.

tobwen avatar tobwen commented on July 20, 2024

This is fixed with the latest commit!

Thank you! I'll test it later. The error totally confused me because I couldn't find anywhere that the PDF file had to have at least 512 bytes and all other interpreters could handle it :-)

from pdfcpu.

hhrutter avatar hhrutter commented on July 20, 2024

Well, thx for discovering this!

from pdfcpu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.