doc.PageSide - problem - I am not able to modify pagination

Community Beginner ,
Dec 18, 2018

Copy link to clipboard

Copied

Hi, have you ever tried changing the pagination ?

doc.PageSide = Constants.FV_BK_START_RIGHT;   seems, doesn't work

TOPICS
Scripting

Views

319

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Advocate ,
Dec 18, 2018

Copy link to clipboard

Copied

Are you sure your document is doublesided ? I tried your code on a new doc and it works only if I first set

doc.DocIsDoubleSide = true;

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jacob_AA AUTHOR
Community Beginner ,
Dec 18, 2018

Copy link to clipboard

Copied

Hi, Can you share the code, please  ?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Advocate ,
Dec 18, 2018

Copy link to clipboard

Copied

I just did. Place the code line from my previous reply before the line you already have. That should do the trick.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jacob_AA AUTHOR
Community Beginner ,
Dec 18, 2018

Copy link to clipboard

Copied

doc must be a object of the book or .fm doc ?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Advocate ,
Dec 18, 2018

Copy link to clipboard

Copied

OK, I get it. I thought you already had the doc object available.

When you have a document open, you can set the doc object to point to it. I use variable names that indicate what type of thing they represent, so my objects are always prepended with an 'o'. Strings get an 's' prefix, integers an 'i'. etc.

So my complete code would lool like this:

var oDoc = app.ActiveDoc;

oDoc.DocIsDoubleSided = true

oDoc.PageSide = Constants.FV_BK_START_RIGHT;

To set this for all the documents in a book, you will have to open all the book components one by one and run the above code on them. I do not have time to give you the code for that. You will have to figure that out yourself. But for the currently active document the above code will work. And the settings are saved in the file, so you do not need to repeat this when the doc is reopened.

Kind regards

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jacob_AA AUTHOR
Community Beginner ,
Dec 18, 2018

Copy link to clipboard

Copied

var doc = OpenDoc(bookComp.Name);

if (doc.ObjectValid()) {

doc.DocIsDoubleSided  = true;

doc.PageSide = Constants.FV_BK_START_RIGHT;

doc.PageNumComputeMethod = Constants.FV_NUM_RESTART;

doc.ChapNumComputeMethod = Constants.FV_NUM_RESTART;

doc.PgfNumComputeMethod = Constants.FV_NUM_RESTART;

doc.MakePageCount = Constants.FV_MakePageCountEven;

doc.Close(1);

}

And, no any changes

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Advocate ,
Dec 18, 2018

Copy link to clipboard

Copied

You are not saving the document after making all those changes. The parameter 1 in the Close method tells Frame to disregard any changes and close the doc anyway.

Before closing the doc you need to save it:

doc.SimpleSave( doc.Name, false );

The false parameter makes the save non-interactive. This should be fine for the SimpleSave method.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jacob_AA AUTHOR LATEST
Community Beginner ,
Dec 18, 2018

Copy link to clipboard

Copied

it didn't help. Thanks I will try more and share the results here.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more