question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[7.0.1] width of pdf page exceed the maximum width and got trimmed from the right side

See original GitHub issue
Bug Report or Feature Request (mark with an x)
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [x] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request

I have an issue with a pdf exceeding the width from style max-width which is mentioned in the docs, but seems that does not work, that issue happened with the latest changes (version 7.0.1).

image

I was using it as simple as:

<pdf-viewer [original-size]="false" [render-text]="false" [src]="pdfUrl" style="display: block; max-width: 1200px; margin: 0 auto;"></pdf-viewer>

Which was working, and tried:

<pdf-viewer [original-size]="false" [zoom-scale]="'page-width'" [fit-to-page]="true"  [autoresize]="true" [render-text]="false" [src]="pdfUrl"
              style="display: block; max-width: 1200px; margin: 0 auto;"></pdf-viewer>

Nothing worked, but when I changed .ng2-pdf-viewer-container to be position: relative it is worked fine.

image

So the change that I can say is behind this issue is this: https://github.com/VadimDez/ng2-pdf-viewer/commit/8d4f8ad25107a98e920ab18e32b828c2e5597e54#diff-c0a5f3426a537629a18cbeb63abc55b7ce727f267c2e85acf84c88ddd96e4cb1R3

The problem solved only runtime, but if I do something like:

pdf-viewer {
  ::ng-deep {
    .ng2-pdf-viewer-container {
      position: relative;
    }
  }
}

I get only blank screen.

The workaround for this is to make the style inside pdf-viewer tag:

pdf-viewer {
  ::ng-deep {
    .ng2-pdf-viewer-container {
      max-width: 1200px;
    }
  }
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
almothafarcommented, Oct 19, 2021

The issue still exists, don’t close it.

1reaction
almothafarcommented, Aug 20, 2021

Well, author is not replying 😕 that’s why no activity

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the size of a PDF page? - Adobe Support
Now enter the page measurements in the Scale pages section: Short edge: Width; Long edge: Height. The Edit fixup dialog box. Now click...
Read more >
PDF Page Size Limitations - CADzation
In PDF Version 1.4 (Acrobat 5.0) and 1.5 (Acrobat 6.0) the maximum PDF page size was 200"x200". In PDF Version 1.6 (Acrobat 7.0)...
Read more >
How to Change PDF Page Size Easily and Quickly
Is there a way to change page size of PDF? Open a PDF file in PDFelement, click the Page>Page Boxes button to resize...
Read more >
UNICORN 7.0 Evaluation Manual
Click the small cross in the top right-hand corner of the navigator. ... the largest width of the identified narrower peaks, and must...
Read more >
SoftMax Pro Data Acquisition and Analysis Software User Guide
To print to a .pdf file, select the Molecular Devices (PDF ... To import data from more than one Plate section in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found