-
-
Notifications
You must be signed in to change notification settings - Fork 423
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
Styling issue when trying to putting pdf viewer to right of html content #422
Comments
This appears to be an issue with mozilla/pdf.js. I submitted my findings here: #10348. Your iframe solution is more stable, but if you really don't want to use an iframe you can use a different workaround. Change your first Example: <!-- app.component.html -->
<h2>PDF Viewer</h2>
<div>
<!-- Left content -->
<div class="percent-49">
<div class="content-example">
Content Goes Here
</div>
<div class="button-example">Continue</div>
<div class="button-example">Cancel</div>
</div>
<!-- Right content -->
<pdf-viewer class="col-6" [src]="src" [original-size]="false" [autoresize]="true"></pdf-viewer>
</div> // app.component.scss
// ...
.percent-49 {
width: 49%;
float: left;
}
// ... This works because then the left offset is less than the width of the |
@ColinT Brilliant, amazing work! Thanks for your help and will keep an eye on the issue you've raised on Mozilla/pdf.js. Will be sticking with the iframe in the meantime. Thank you again 😃 |
I found a stable way to make this work without an iframe, using <!-- app.component.html -->
<h2>PDF Viewer</h2>
<div>
<!-- Left content -->
<div class="col-6">
<div class="content-example">
Content Goes Here
</div>
<div class="button-example">Continue</div>
<div class="button-example">Cancel</div>
</div>
<!-- Right content -->
<div class="col-6" style="position:relative;">
<pdf-viewer [src]="src" [original-size]="false" [autoresize]="true" style="display: block"></pdf-viewer>
</div>
</div> This works because Without the parent container, Here is a stackblitz: https://stackblitz.com/edit/ng2-pdf-viewer-xqbb7v?file=app/app.component.html |
@ColinT Thanks a lot. Your solution and explanation is really great.. |
We use the latest version of typescript 2. This library 6.0.0 onwards only support typescript 3. @ColinT solution is only fixed if you stuck under version 5. |
Hey bug returned in version 7.0.1 when i back to 6.4.1 everything i ok :) |
Bug Report or Feature Request (mark with an
x
)So I'm trying to implement the pdf viewer into an existing angular project. However, for the time being I'm going to simply have to use an iframe to fit my needs. As currently in the pdf viewer there seems to be a styling issue - whether this is a simple fix I don't know as my styling knowledge isn't great.
The issue itself basically does not seem to visually load the pdf and is not visible whatsoever and has a spinner stuck on each page of the pdf.
I have reproduced this issue over in stackblitz. So if anyone gets a chance to take a look at this issue, I would much appreciate it.
https://stackblitz.com/edit/ng2-pdf-viewer-qdfyem
Thank you 😄
The text was updated successfully, but these errors were encountered: