Skip to content
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

Incorrect height is returned for certain pdf document #532

Open
jifang opened this issue Sep 17, 2024 · 0 comments
Open

Incorrect height is returned for certain pdf document #532

jifang opened this issue Sep 17, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jifang
Copy link

jifang commented Sep 17, 2024

Describe the bug
When loading some pdf file (see attached), its size is supposed to be a 595.25 x 409. However, the page height of 841.875 is returned. The page width is correct.

example.pdf

To Reproduce
Steps to reproduce the behavior:

  1. Load the attached pdf file
      final document = await pdfx.PdfDocument.openFile('${tempDir.path}/example.pdf');
      final page = await document.getPage(0);
      debugPrint('### page width: ${page.width}, height: ${page.height}');

Expected behavior
We are expecting 595.25 x 409 is returned. However the output is 595.25 x 841.875

flutter: ### page width: 595.275, height: 841.875

Screenshots
N/A

Smartphone (please complete the following information):

  • Device: Macbook Pro M1
  • OS: 14.6.1
  • Version:
    2.6.0

Additional context
Here is the pdfinfo output

pdfinfo /Users/ji/Downloads/default.pdf                                                                                                                                          (base) 
Title:           Document
Producer:        openhtmltopdf.com
CreationDate:    Wed Aug 28 13:45:52 2024 CST
Custom Metadata: yes
Metadata Stream: no
Tagged:          no
UserProperties:  no
Suspects:        no
Form:            none
JavaScript:      no
Pages:           1
Encrypted:       no
Page size:       595.275 x 409 pts
Page rot:        0
File size:       75143 bytes
Optimized:       no
PDF version:     1.7
@jifang jifang added the bug Something isn't working label Sep 17, 2024
@jifang jifang changed the title The page width & height seems to be reverted for certain pdf document Incorrect height is returned for certain pdf document Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants