ng2-pdf-viewer icon indicating copy to clipboard operation
ng2-pdf-viewer copied to clipboard

Rotation default value not working

Open daniela-alves opened this issue 2 years ago • 11 comments

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

When I define the rotation by default when I load the document is not applied.

Example: https://stackblitz.com/edit/ng2-pdf-viewer-qtq9ny?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.css

By default I defined 180. When the document is loaded the rotation is not applied and seems to be 0. If I click on the test button to set the rotation to 90, works.

daniela-alves avatar May 09 '23 23:05 daniela-alves

i think this is the same like #976

ftaffelt avatar May 10 '23 06:05 ftaffelt

Seems to be. Did you find a workaround until we have a fix?

daniela-alves avatar May 10 '23 07:05 daniela-alves

@ftaffelt yeah, probably is. The wquestion is: does someone know how to overcome that isssue?

marcelocerqueira69 avatar May 30 '23 11:05 marcelocerqueira69

@ftaffelt yeah, probably is. The wquestion is: does someone know how to overcome that isssue?

@marcelocerqueira69, I would like to have it resolved too or even a way to achieve that

Ricardo-Guia avatar May 31 '23 08:05 Ricardo-Guia

Same issue right here

helderdias15 avatar May 31 '23 08:05 helderdias15

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[bot] avatar Aug 07 '23 05:08 stale[bot]

I haven't found yet a solution. Can someone help me, please?

daniela-alves avatar Sep 29 '23 09:09 daniela-alves

Any news regarding this issue?

lcvalves avatar Oct 30 '23 09:10 lcvalves

Same problem here, very annoying because the first page of the document is not rotated at loading.. Any idea when it will be corrected? Thx for support

mediamix1950 avatar Oct 30 '23 09:10 mediamix1950

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[bot] avatar Jan 07 '24 11:01 stale[bot]

Seems there's an internal change detection issue with the library.

I overcame this by forcing the code which sets the new default rotation amount to be a macro task, delaying it's execution:

your-pdf-display.component.ts

...
rotation = 0;

ngOnInit(){
  setTimeout(() => {
    this.rotation = 90;
  }, 0);
}
...

your-pdf-display.component.html

...
<pdf-viewer
  ...
  [rotation]="rotation">
</pdf-viewer>
...

jarodsmk avatar Jan 25 '24 11:01 jarodsmk