You are viewing limited content. For full access, please sign in.

Question

Question

Set page breaks in saved form

asked on May 9, 2023 Show version history

Is there a way to choose where page breaks happen when saving a form to a repository, or any way to remove the page breaks entirely?

I have seen several answers for this but most say to say to look in the pagination for "remove page breaks from saved form", but it doesn't appear to be there in the cloud version.

I've also tried a couple of answers' css suggestions to force a break after a section, but none have worked so far.

0 0

Answer

SELECTED ANSWER
replied on May 9, 2023

This is the CSS I have on forms that have specific page breaks. You can switch it up to be before, after, etc.

Like Matthew mentioned, testing is a pain and I jumped through a lot of hoops to try and get an idea of what the actual HTML for the saved copies looked like but I haven't had any issues with this since then.

Basically, I use the pageBreak class on sections/fields where I want a page break, and the keepTogether class on items that I don't want to split between pages unless absolutely necessary due to the length.

 

.pageBreak {
  page-break-before:always;
}

.keepTogether,
.cf-table-block,
.form-q {
  page-break-inside: avoid;
}

 

6 0

Replies

replied on May 9, 2023 Show version history

Are you using the Forms Layout Designer (new designer) or the Forms Classic Designer?

Here's some CSS for the Forms Layout Designer that will force a page break in the archival version of the form.  This is based on pagination being enabled. 

/*Force page breaks when archiving to repository*/
.form-pages-container div.Page { 
  page-break-after: always; 
}

 

The Forms Classic Designer doesn't need the CSS because it has an option that can be enabled/disabled as desired with the pagination.

2 0
replied on May 9, 2023

I do not have the pagination enabled on the form as there should only be 1 page while the form is being worked on.

I already have page breaks when archiving to repository, I want to control specifically where they occur or remove them entirely.

0 0
replied on May 9, 2023

I don't think you'll be able to remove them entirely.  But you should be able to control where they are occurring.

Similar to that CSS I posted that puts the page breaks after each page with pagination enabled, we should be able to get some CSS that puts the breaks after certain items, such as after sections, or after custom HTML elements, or after items with certain CSS Class Names.

Are you using the Forms Layout Designer (new designer) or the Forms Classic Designer?  And where do you want the page breaks to occur?

1 0
replied on May 9, 2023

That would be perfect, I've been trying to style my sections to do that to no avail.

I'm on the Forms Layout Designer, either before or after a section would be great.

0 0
replied on May 9, 2023

This is proving to be more difficult than I expected.

The original CSS code I shared was provided by a Laserfiche employee (see this post), and that does work with the pagination.  However, no matter how I edit it to try to work with the sections, I can only get it to work when printing from the User Task and not when archiving to the repository.

The problem here is that there is nowhere within Forms that we can preview the version of the form that will be archived, so we can examine the structure of the form and what we need to change to alter how it appears when archived.  We can see the active version of the form, and make changes that impact that, but the archival version is structured a little different, so the changes are not impacting it the same way.

This is the CSS that I have working on the active form - but it is not working on the version of the form that archives to the repository: 

/*Force page breaks after each section when archiving to repository*/
.fl-section { 
  page-break-after: always; 
}

I can get the page breaks to work after the sections when printing from the active user task, but I can't get it to work with the archival.

1 0
replied on May 9, 2023

Is it possible to print a pdf or some other version from the user task, then save that to the repository somehow?

0 0
replied on May 9, 2023

Oh, I examined the print option from the user task and can see that won't be an option.

0 0
replied on May 9, 2023 Show version history

Unless someone else weighs in (such as a Laserfiche employee), who has experience with how the sections are structured when archived to the repository, I'm stumped on how to get it to work.  I'm sorry.

And just like that, it's @████████ to the rescue!

 

1 0
SELECTED ANSWER
replied on May 9, 2023

This is the CSS I have on forms that have specific page breaks. You can switch it up to be before, after, etc.

Like Matthew mentioned, testing is a pain and I jumped through a lot of hoops to try and get an idea of what the actual HTML for the saved copies looked like but I haven't had any issues with this since then.

Basically, I use the pageBreak class on sections/fields where I want a page break, and the keepTogether class on items that I don't want to split between pages unless absolutely necessary due to the length.

 

.pageBreak {
  page-break-before:always;
}

.keepTogether,
.cf-table-block,
.form-q {
  page-break-inside: avoid;
}

 

6 0
replied on May 10, 2023

Thank you Jason! I ended up just using keepTogether since the section lengths can vary by submission, and it looks much better. I did need to edit the classes on it a bit, your version initially would only work when printing from user task and not when saving to repository. This is what I ended up with:

.keepTogether .fl-section {
  page-break-inside: avoid;
}

Thank you both for all your help!

2 0
replied on May 10, 2023

I'm glad you found something that worked for you.

0 0
replied on July 12, 2023 Show version history

Matthew, it seems like your CSS is the only one here that's working in the new Forms Designer.

Have you found anything like the others are sharing that would work in forms designer?  With ability to page break based on a class?

Edit: The form I'm working on has pagination enabled, but some pages have very few fields and we'd rather have several of those pages save as one page to the repository, but still be separated prior to submission.

 

Thanks!

0 0
replied on July 13, 2023

@████████ - if you are using this CSS: 

/*Force page breaks when archiving to repository*/
.form-pages-container div.Page { 
  page-break-after: always; 
}

in order to put page breaks between the pagination, it's being applied to the actual page elements, so I don't think you're going to be able to override that for particular pages very easily.

If you need that level of specific control, I would recommend trying @████████'s solution with the pageBreak and keepTogether classes added selectively to specific fields.

As mentioned in a few comments, testing this stuff can be a bit of a pain, because the archived version of the form is structured a differently than the live version and there isn't a way to preview that archival version in the browser to try different things out quickly and tweak things with the Browser Inspector.

1 0
replied on July 13, 2023

If you need that level of specific control, I would recommend trying @Jason Smith 's solution with the pageBreak and keepTogether classes added selectively to specific fields.

 

And this solution only works if I don't have pagination enabled on the form, correct?

0 0
replied on July 13, 2023 Show version history

I don't think that will matter.  It's not doing anything regarding pagination, it is just forcing page breaks before fields with the pageBreak class and avoiding page breaks within tables or fields that have the keepTogether class.

But if you are using both Jason's CSS and the Pagination CSS I posted, then it's going to be having page breaks with each page and before the fields with the pageBreak class.

1 0
replied on July 13, 2023 Show version history

I must be missing something then... Your CSS worked to put page breaks between the pagination, but I switched over to Jason's and it doesn't seem to be doing anything at all for me.

 

0 0
replied on July 13, 2023

Unfortunately, as I said, testing this stuff is a pain.

@████████might have a better feel for it, since he's done a lot more testing of the functionality.

0 0
replied on July 13, 2023

Unfortunately, I haven't used the new designer for anything yet, so I don't know enough about it to provide any valuable insights.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.