PDF and Print Formatting

rss

Posted by Jimmy Daresta - Aug 2 ’16 at 09:54

I want when one prints or exports to PDF that the form(s) will be formatted differently. I have figured on the printing how to hide elements, but not on the PDF.

 

Also when I do print the form the font prints out much smaller than expected which I believe is due to the page not fitting size wise ont he page. How can I adjust the style of the print so the form fits on the page?

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 8 years 2 months 20 days
    #1 by Dmitry Kozlov Aug 3 ’16 at 08:25

    Hi Jimmy,

    Currently, you cannot handle exporting to PDF except using JavaScript:

    // hide elements you do not want to export
    $('.to-hide').hide();
    
    //export to PDF
    fd.saveAsPDF('form.pdf')
        .then(function() {
        
            // show hidden elements
            $('.to-hide').show();
        });
    

    As for printing, you can use CSS-styles applicable to printing forms only:

    @media print {
        // your CSS here
    }
    

    http://www.w3schools.com/css/css3_mediaqueries.asp

  • Jimmy Daresta
    Jimmy Daresta
    Member
    Member for: 5 years 4 months 8 days
    #2 by Jimmy Daresta Aug 3 ’16 at 08:49

    To clarify, I would need to add my own PDF export button? The one that shows in the ribbon would not work? I was hoping there was an onPDF() or a way to override the button action on the ribbon so I could then hide elements before rendering.

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 8 years 2 months 20 days
    #3 by Dmitry Kozlov Aug 4 ’16 at 01:00

    [#2]: If you want to use the ribbon button, you can override fd.saveAsPDF:

    var saveAsPDFOrig = fd.saveAsPDF;
    fd.saveAsPDF = function(filename) {
        // hide elements
        return saveAsPDFOrig(filename)
            .then(function() {
                //show elements
            });
    }
    
  • Jimmy Daresta
    Jimmy Daresta
    Member
    Member for: 5 years 4 months 8 days
    #4 by Jimmy Daresta Aug 4 ’16 at 07:09

    Perfect! Thank you!

  • underbellie
    Member
    Member for: 7 months 15 days
    #5 by underbellie Apr 25 ’21 at 07:55

    Formatting of every document and file is necessary. As it makes the document more attractive and presentable and it's easir to visit at td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}http://pdf-to-ppt.cocodoc.com to convert pdf to ppt files. Learn the complete formatting that will makes your file perfect through this blog.td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}

  • jonathantrott13
    Member
    Member for: 7 months 4 days
    #6 by jonathantrott13 May 6 ’21 at 03:10

    You can print a multipage document as a booklet. Acrobat or Reader lays out the pages two per sheet. interior demolition

Displaying 1 to 6 of 6 messages