• Resolved rlbeors

    (@rlbeors)


    Hello dear creators of the wonderful plugin =)
    I have a question for you, how can you make sure that when scaling the account, it does not increase – the font decreases and the scale changes in proportion to the page. It so happens that the bill for 2 pages turned out, 1 page is 80% full, and on the second page of the bill there is only 1 line. When scaling, the font and the order itself simply increase or decrease, that is, it is impossible to reduce it by 1 page. A screenshot is attached. thanks

    screenshot

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Ewout

    (@pomegranate)

    Your screenshot is a bit puzzling – are you already applying code to scale the PDF? If so, can you share this with us? Normally if you make the content smaller it should automatically adjust to he space on the page.

    Thread Starter rlbeors

    (@rlbeors)

    Hello, no, I am not applying the scaling code. This is all standard without code changes. The pdf file itself when printing – additionally – scaling, scales as in the screenshot. Not entirely correct.

    Plugin Author Ewout

    (@pomegranate)

    I see. The scaling you apply in your print dialog does not merge any pages automatically. This is no different than any other PDF document. If you want to scale the contents of the page you’d have to make the font smaller using CSS. But this has to happen before the PDF is generated, it’s not something you can adjust in the printer dialog.

    Thread Starter rlbeors

    (@rlbeors)

    strange. On another site I am using a different plugin to print an invoice. And there the scaling renders correctly without changing the font size.

    Thread Starter rlbeors

    (@rlbeors)

    why the text itself is reduced when scaling, and the second page with one line remains? after all, the second page should be deleted when scaling and be 1 page.

    Plugin Author Ewout

    (@pomegranate)

    On another site I am using a different plugin to print an invoice. And there the scaling renders correctly without changing the font size.

    That can’t be a PDF then. I’m assuming that plugin outputs to HTML instead of PDF?

    why the text itself is reduced when scaling, and the second page with one line remains? after all, the second page should be deleted when scaling and be 1 page.

    This is a result of how PDF files work. Try any other PDF file you have on your computer (or this random PDF file from adobe.com) and you’ll see the same behavior. This is because PDF is designed to keep the same output regardless of the medium it is shown on. So if the author put an image on the second page, it should not suddenly show on the first page when you scale the print.

    This is different from printing HTML, because HTML does not have a concept of paging (everything is a on a single ‘page’), so when you print HTML and change the print scaling, your browser adjusts the page breaks accordingly.

    Thread Starter rlbeors

    (@rlbeors)

    tried) and not at all. When scaling, the file does not decrease diagonally as in the screenshot, but vertically, that is, if a file of 2 pages, when scaling is reduced, becomes 1 page since everything fit into 1 page. but in this plugin how not to scale all the same 2 pages

    Plugin Author Ewout

    (@pomegranate)

    @rlbeors it looks like the first part of your previous message was cut off, can you add it again?

    Thread Starter rlbeors

    (@rlbeors)

    The bottom line is this. It happens that the bill is for 2 pages, on the second page there is only 1 line with the price. Is it possible to do something when scaling, for example, 90% instead of 100% so that the entire account fits on 1 page. And it turns out I print 2 pages, on the second page 1 line – and nothing else!

    Thread Starter rlbeors

    (@rlbeors)

    tried to explain on the screen in more detail
    screen

    Plugin Author Ewout

    (@pomegranate)

    You can apply scaling only if you make for example the font size in the PDF itself smaller. You cannot control this from the print dialog. Due to the fact that it’s a PDF. I tried to explain this in my previous post (here)

    I’ll try again:

    1. Download this PDF from Adobe.com. Open the print dialog and you’ll see the same behavior. This is because in a PDF file, a single page is a single page.
    2. If you do the same with an HTML file (for example this page with Shakespeare’s MacBeth), you’ll see a different behavior, because it’s a single page (or rather: no specific page breaks have been defined) and the browser applies the page breaks for you.

    If you want to be able to scale the document in the print dialog, you’ll need to use a plugin that outputs to HTML instead of PDF.

    If you want to change the font size you can do so using the following code snippet:

    
    add_action( 'wpo_wcpdf_custom_styles', function ( $document_type, $document ) {
        ?>
        body { font-size: 8pt !important; }
        <?php
    }, 10, 2 );
    

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

    • This reply was modified 2 months, 1 week ago by Ewout. Reason: added example CSS to change the font size
    Thread Starter rlbeors

    (@rlbeors)

    but you can make it so that in the plugin WooCommerce PDF Invoices & Packing Slips, not a PDF but an HTML account is displayed, and which plugin can do this.
    Thanks for your understanding and sorry for my bad english.

    Thread Starter rlbeors

    (@rlbeors)

    thanks a lot, figured out the pdf to html conversion settings

    Thread Starter rlbeors

    (@rlbeors)

    Hello, I have a small problem with HTML invoices. As you can see in the screenshot, the total price is shifted over the order.

    screenshot

    Plugin Author Ewout

    (@pomegranate)

    Yes, the HTML output is meant for developing and not for actual use. You will need to adapt the contents of the template (both the HTML and CSS) to make it work for HTML printing.
    Perhaps this plugin is better suitable for your needs.

Viewing 15 replies - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.