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

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

Closed
almothafar opened this issue Jun 20, 2021 · 7 comments
Milestone

Comments

@almothafar
Copy link

almothafar commented Jun 20, 2021

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: 8d4f8ad#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;
    }
  }
}
@almothafar
Copy link
Author

@VadimDez please check this out.

@stale
Copy link

stale bot commented Aug 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 19, 2021
@almothafar
Copy link
Author

Well, author is not replying :/ that's why no activity

@stale
Copy link

stale bot commented Oct 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 19, 2021
@almothafar
Copy link
Author

The issue still exists, don't close it.

@stale stale bot removed the stale label Oct 19, 2021
@JakeFromIBM
Copy link

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

Thank you @almothafar, this work-around did the job perfectly

@VadimDez VadimDez added this to the 7.0.2 milestone Nov 15, 2021
@VadimDez
Copy link
Owner

Checkout 7.0.2 release, should be better now, I've also included breaking change note.

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

No branches or pull requests

3 participants