Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

show the html on pdf on one page only! #3208

Closed
enemijs1 opened this issue Nov 23, 2016 · 7 comments
Closed

show the html on pdf on one page only! #3208

enemijs1 opened this issue Nov 23, 2016 · 7 comments

Comments

@enemijs1
Copy link

enemijs1 commented Nov 23, 2016

I want to show the html in pdf only on one page. But it makes it on multiple pages.
I tried to add css modifications, but it didn't work eather. There are plently of options to choose, but cant find one that suits.

enable-smart-shrinking doesn't help eather, it stills shows it on multiple pages

php

$options = array(
        'no-outline',         // Make Chrome not complain
        'margin-top'    => 0,
        'margin-right'  => 0,
        'margin-bottom' => 0,
        'margin-left'   => 0,
        // Default page options
        'enable-smart-shrinking',
    );
@PhilterPaper
Copy link

So what is the original size? Are you talking about shrinking down a 5 page document to 1 US Letter (or A4) sheet, or is it just a few lines over 1 page? Have you tried reducing font sizes by some percentage? I'm not sure exactly how "smart shrinking" is supposed to handle it, but I'm sure it has limitations about how far it can go (before the text becomes illegibly small). Is there any content that wouldn't be reduced by a smaller font size, such as images, that would have to be adjusted separately?

If it is currently nearly two pages, you might consider printing to a two page document, and then rotating and printing 2-up for two 5.5" x 8.5" pages (or the equivalent from A4). The text might be more legible than reducing its size to fit a single standard page.

@ashkulz
Copy link
Member

ashkulz commented Nov 23, 2016

@PhilterPaper: Can you contact me via email (it's in my profile)?

@enemijs1
Copy link
Author

@PhilterPaper It's html email template converted to pdf. Height can differ, i need to show it only on one page. So it could be 5 pages, 10 pages long, but at the end it should show up in one page. The size of the result is not important, as we can zoom in to it.
Is it even posible with this software ?

@ashkulz
Copy link
Member

ashkulz commented Nov 24, 2016

Duplicate of #1627.

@PhilterPaper
Copy link

To be perfectly honest, the idea of shrinking down 10 pages of email (or Tolstoy's War and Peace, for that matter!) to one page (presumably A4 or Letter) and using zoom (magnify) to find your way around, rather than going through the pages of normal print is absurd to me, but if that's what you want, go for it. I am a bit curious about what this effort would produce that would be useful to anyone -- you're not going to print such a condensed page, are you? You would need a magnifying glass to read it! If a PDF reader is still in the equation, wouldn't it be easier to have the text of normal size (and thus readable), and be able to get around by full page? What are you trying to accomplish? If it's going to be printed, at some point the text will be too small to properly render, even with a magnifying glass.

@enemijs1
Copy link
Author

@PhilterPaper I never mentioned that i have to print. I found the solution which @ashkulz provided. Converting html to image, geting the height of it. And converting html to pdf providing the exact height for the pdf page.

@DylanYoung
Copy link

DylanYoung commented Oct 10, 2019

@PhilterPaper Personally? Trying to get around a (assumed) bug where 5 blank pages are output when setting width and height. Could this have been a regression in 0.12.5?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants