Skip to main content
Jacob_AA
Known Participant
December 18, 2018
Question

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

  • December 18, 2018
  • 5 replies
  • 672 views

Hi, have you ever tried changing the pagination ?

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

This topic has been closed for replies.

5 replies

Jacob_AA
Jacob_AAAuthor
Known Participant
December 18, 2018

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

Jacob_AA
Jacob_AAAuthor
Known Participant
December 18, 2018

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

4everJang
Legend
December 18, 2018

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.

Jacob_AA
Jacob_AAAuthor
Known Participant
December 18, 2018

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

4everJang
Legend
December 18, 2018

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

Jacob_AA
Jacob_AAAuthor
Known Participant
December 18, 2018

Hi, Can you share the code, please  ?

4everJang
Legend
December 18, 2018

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

4everJang
Legend
December 18, 2018

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;