Print a heading on every page when printing form

  • menstrom
    Asked on October 6, 2017 at 9:50 AM

    I have a form that needs to be printed after it is completed, and there must be a heading at the top of each printed page when it prints.  There is skip logic in the form, so there is no way to know precisely where each page will end when printed.

    I put in page breaks on the form, and put the heading at the top of each page on the form, but found that, when the form was printed, it didn't page break at the same places that the form had page breaks, so the headings were all over the place.

    Is it possible to insert a heading at the top of each printed page?

    Thanks,

    Marilyn

  • Marvih
    Replied on October 6, 2017 at 10:55 AM

    Hi in your form submission did you try checking "Show Headers and Texts"

    Print a heading on every page when printing form Image 1 Screenshot 20

  • menstrom
    Replied on October 6, 2017 at 11:52 AM

    This is not a form that the user submits and we print.  This is a form that the user will print and send to us.  I need the header to print at the top of every page when the user clicks the "Print" button at the bottom of the form.

    Thanks,

    Marilyn

  • David JotForm Support
    Replied on October 6, 2017 at 1:06 PM

    Since the page breaks do not work the same like page break on preview, you need to specify the break manually and to do that you can follow this guide from my colleague: 

    https://www.jotform.com/answers/587441-Page-Breaks-on-printed-PDF-form

    The screenshots are slightly outdated but the functionality is the same. 

    You can then insert your header directly below each print page break.

    Other than that, there is no way to automatically insert the header at the top of each page while printing.


  • menstrom
    Replied on October 6, 2017 at 3:01 PM

    I followed the instructions and it worked to insert the page break, but it is inserting a blank page rather than just starting again on the next page.  So I have page 1, then a blank page, than page 2, then a blank page, then page 3, etc.  You can see what it is doing at my URL:  https://form.jotform.com/WheatonCollegeForms/dep_fed_verif_form.

    Thanks,

    Marilyn

  • Welvin Support Team Lead
    Replied on October 6, 2017 at 5:02 PM

    I'm looking for a workaround now. I'll let you know if it works. Basically trying to get the spaces out by Print Media CSS query. 

  • Welvin Support Team Lead
    Replied on October 6, 2017 at 5:13 PM

    Using my colleague's method, I got it to work using the following custom CSS codes:

    @media print {

    .form-field-hidden {

    page-break-inside: avoid;

    }

    }

    Inject the codes in the form, remove the other one. That should do it, see example:

    Print a heading on every page when printing form Image 1 Screenshot 20

    Here's a cloned version of your form showing the changes: https://www.jotform.com/72786077857980

  • menstrom
    Replied on October 8, 2017 at 5:07 PM

    Thanks for trying, but your cloned version doesn't work, either.  Page two doesn't skip a page because I didn't have a page break there.  Your cloned version actually is not page breaking when printed at all (it is just printing three straight pages).

    Just to clarify, when I send the form to a printer by clicking the "Print Form" button at the end, I need the form to send the printer a command to make a page break before each instance of the line that shows "Student's Name" and "Student's ID Number".

    FYI, I have revised my form to have five pages rather than four, because page one was spilling over to two.  So I need the form to send a page break command to the printer after each "Next" button (or before each "Student's Name" and "Student's ID Number" line, whichever makes more sense).  If I can't force the printer to start a new page with the student's name and ID number at the top of each printed page, then I can't use this tool for this form.  I'm getting the feeling that is going to be the answer (that I can't use JotForm for this form).  But I'm still hopeful that there's another option out there.

    Thanks!

    Marilyn

  • jonathan
    Replied on October 8, 2017 at 6:58 PM

    Thank you for the clarification and explaining more on the problem. I was able to understand and see the issue as well.

    Print a heading on every page when printing form Image 1 Screenshot 20


    As mentioned already, the page break on the form does not equate to a print-out page break when printing the form itself. So positioning those page break on the forms will not result to the same positioning when you trigger Print command.

    The other thread suggested by our colleague David here https://www.jotform.com/answers/587441-Page-Breaks-on-printed-PDF-form was actually for the PDF printout of the submission data. This will only work after form was submitted already and data exist. 

    I hope this explains the resolutions suggested much clearer now. Let us know how we can be of further assistance.




  • menstrom
    Replied on October 9, 2017 at 1:08 PM

    Well, now it isn't working at all.  Whatever happened to it when I put Welvin's suggested code change in made it so that now it ignores anything else I put in there.  I put the things back to the way David had suggested, which wasn't working correctly but at least was page breaking when I printed the form, and now it won't page break on printing at all.  So I have no idea what to do at this point.

    What I want to do is what David suggested.  I want to have page breaks on the PDF printout of the submission data.  I want it to work after the form has been submitted and the data already exists.  I used David's suggested workaround and it did page break when the form was printed, just like David said it would.  However, it would insert a blank page at every page break that I didn't want.  So I was asking how to get rid of the blank page that was coming out at every page break when the form was printed.

    When it was "working" with David's suggestion, when it printed, it did the following:

    Printed page 1 where I have the page break that David suggested

    Printed a blank page

    Printed page 2 where I have the page break that David suggested

    Printed a blank page

    Printed page 3 where I have the page break that David suggested

    Printed a blank page

    Printed page 4 where I have the page break that David suggested

    Printed a blank page

    Printed page 5 where I have the page break that David suggested

    Now, it won't obey the command at all and won't page break when printed, even though I reset the commands back to the way David suggested, so now I can't even get it to print and page break with a blank page in between.

    Can anyone figure out how to make the document page break when printed and there is data on the form without having a blank page in between that prints with nothing showing?  And figure out why my form isn't responding to David's suggested fix at all anymore?

    David, can you help me since I am trying to use your coding?

    Thanks!

    Marilyn

  • Nik_C
    Replied on October 9, 2017 at 3:24 PM

    I'll check this issue a bit more and get back to you once I finish some tests.

    Thank you for your patience.


  • Nik_C
    Replied on October 10, 2017 at 12:51 PM

    Thank you for your patience.

    I'm afraid that this will just not work with submitted data exported to PDF.

    The above solution provided by David will work if you fill the form and decide to print it as it is from the Browser. Since the code, you added (in the above example), will work in HTML version of the form (which is the preview of the form for example). When you submit the form and create a PDF of it, the rules are not the same.

    With that said, I'm afraid that the only way to have the breaks by using the above code is to print the filled form. You can test my example: https://form.jotform.com/72824450451958

    There is a print button at the end of the form that will show the printout with breaks that I inserted in each page.

    Please check and let us know your thoughts.

    Thank you!


  • menstrom
    Replied on October 10, 2017 at 2:44 PM

    Nik,

    So your example is doing the same thing I described.  When printing your form, a blank page prints in between each printed page.  So when I print your three page form, I get five pages:

    Page 1 with data

    Page 2 that is blank

    Page 3 with data

    Page 4 that is blank

    Page 5 with data

    So at least you were able to recreate the problem!  Now I just need a solution that eliminates those two blank pages.

    Thanks,

    Marilyn

  • jonathan
    Replied on October 10, 2017 at 3:56 PM

    Thank you for the explanation and further clarification. I will ask our colleague Nik to follow up on this since he provided a better resolution already.

    We will notify you on this thread for updates.

    Regards,

  • Nik_C
    Replied on October 11, 2017 at 1:19 AM

    Thank you for your patience.

    I checked your form and the issue was in the position of the Text field. The Text field shouldn't be at the beginning of the page, it should be at the end.

    So it shouldn't be like this:

    1507698995Screen Shot 2017 10 11 at 7 Screenshot 10 

    It should be like this:

    1507699024Screen Shot 2017 10 11 at 7 Screenshot 21

    Right before the end of the page.

    Just move it up on every page and it will work fine.

    You can check my cloned version as well: https://form.jotform.com/72830481651961

    Let us know how it worked.

    Thank you!