Code Monkey home page Code Monkey logo

Comments (12)

khatrizeeshan avatar khatrizeeshan commented on August 19, 2024

We have added the following script you mentioned regarding bootstrap in style.scss but did not work in a blank project.

 @media screen {
    @import './../node_modules/bootstrap/scss/bootstrap';
}
´´´

from ngx-extended-pdf-viewer.

stephanrauh avatar stephanrauh commented on August 19, 2024

"Blank project" meaning a demo project using both Bootstrap and ngx-extended-pdf-viewer, I assume? Can you share the project with me, so I can have a look myself?

from ngx-extended-pdf-viewer.

stephanrauh avatar stephanrauh commented on August 19, 2024

At the moment I can't recall the details, and I don't have access to my old source code. What I recall from memory is that somewhere in the Bootstrap library, there's a statement reducing the font size. Or the general zoom level. As a result, everything is rendered a little smaller. You won't mind on a web page, but you'll notice immediately when printing a page.

To solve the problem, you have to find the CSS statement downscaling everything.

That proved to be a bit tedious, so I simply deactivated Bootstrap when printing a page. That's what the @media screen query does. It imports Bootstrap if and only if you're viewing the page on a screen.

Alternatively, you can add a media query acting as a counter-poison like so:

@media print {
  font-size: 133%;
}

Does this help you? If so, please report back so I know when I can close the ticket.

Thanks in advance,
Stephan

from ngx-extended-pdf-viewer.

khatrizeeshan avatar khatrizeeshan commented on August 19, 2024

from ngx-extended-pdf-viewer.

stephanrauh avatar stephanrauh commented on August 19, 2024

I believe I've managed to reproduce your bug. However, it looks more like a 85% reduction (or rather, a reduction by 15% :) ). Does it look similar to my screenshot on your machine?

image

from ngx-extended-pdf-viewer.

khatrizeeshan avatar khatrizeeshan commented on August 19, 2024

from ngx-extended-pdf-viewer.

stephanrauh avatar stephanrauh commented on August 19, 2024

Oops - it turned out to be simple. I guess I should improve my documentation. :)

Adding the media query to the global styles.css replaces the import in the Angular.jsonfile:

           "styles": [
              "node_modules/bootstrap/dist/css/bootstrap.css",  <<< remove this line!
              "src/styles.scss"
          ],

from ngx-extended-pdf-viewer.

stephanrauh avatar stephanrauh commented on August 19, 2024

improved documentation published with version 0.9.17 just a minute ago

from ngx-extended-pdf-viewer.

jos1337 avatar jos1337 commented on August 19, 2024

the suggested solution:
@media screen {
@import './../node_modules/bootstrap/scss/bootstrap';
}
is causing an scss error:
You may not @extend selectors across media queries.

Is there a workaround for this?

from ngx-extended-pdf-viewer.

BGBRWR avatar BGBRWR commented on August 19, 2024

Instead of this

@media screen {
    @import './../node_modules/bootstrap/scss/bootstrap';
}

You can use this

@media print {
  body {
    min-width: auto !important;
  }
}

from ngx-extended-pdf-viewer.

stephanrauh avatar stephanrauh commented on August 19, 2024

Whow, is it really that simple? I've added it to the documentation. Thanks for the hint!

Best regards,
Stephan

from ngx-extended-pdf-viewer.

stephanrauh avatar stephanrauh commented on August 19, 2024

I've went over the print CSS again. When you update to version 9.0.0, I don't know what happens to your bugfix. I hope you won't need it, but I can't predict this.

from ngx-extended-pdf-viewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.