cancel
Showing results for 
Search instead for 
Did you mean: 

Page Break using JavaScript

former_member184313
Participant
0 Kudos

Dear specialists

I'm working on a PDF Print Form in transaction SFP. On the paginations tab of the object palette you can set the attribute Place, among other things, with "Following Pervious" or "Top of next Page".

This attribute is responsible for deciding whether the content of this form

is placed at the end of the previous page, or if a new page is started. If I set this attribute

statically and deploy the PDF, everything works as expected.

What I would like to do is, to set this value dynamically during JavaScript initialize event. I've tried different combinations but non of them worked:

----- data.Seite_4::initialize: - (JavaScript, server) ---------------------------------------------

if($record.BERICH_MODULAR.MODULAR.value == "X" && $record.BERICH_MODULAR.KAPITEL.value != "X"){
//this.break.before = "contentArea";
//this.break.startNew = "1";
//this.breakBefore = "pageArea";
//this.breakBefore.startNew = "1";
//this.break.before = "pageArea";
//this.break.before.startNew = "1";
this.break.before = "Seite_4";
this.break.startNew = "1";
}

This is the Adobe reference to breakBefore:

http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=000874.html

Do you have any idea what I'm doing wrong?

Thanks allot for your help.

Daniel

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184313
Participant
0 Kudos

Hello Otto

This is a clever approach. If there is no way to set this attribute by javaScript, I will do it your way.

Thanks for that.

In the meantime I came across some training content from BC480 (PDF Based Printforms) and there is an example going like this:


//formCalc
$.break.after = "contentArea" ; page break after current subform
                              ; can be processed only for subforms

But this doesn't work either...

Could this be a bug? Or any other ideas?

Cheers

Daniel

Former Member
0 Kudos

I tried it and it definitely did a page break, although I didn't find it very useful for my particular situation.  The main part of my page was a sub-page/sub-form named "Body."  It was contained in a page that I renamed to Content_Area (I believe it was named "contentArea" when I first created the form).  Here is an example:

Body.break.after = "Content_Area"    //page break after content area

OttoGold
Active Contributor
0 Kudos

No idea how to do it your way, but I can tell you about mine.

I use empty subform (height = 0, no children), place it where I need a conditional break, make it hidden, set top of next page for this special subform and write a script.

It works like this: when I need a page break, I use script to make the subform visible and only then the pagebreaks happen.

A workaround, but works just fine.

Otto