• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Set Properties to Display Logical Page in Acrobat Reader?

Explorer ,
Jun 26, 2018 Jun 26, 2018

Copy link to clipboard

Copied

Dear community,

What bothers me is the page numbering in the toolbar of the PDF Reader. In my documents, the TOC is Roman numbering and the rest is Arabic numbering, however the toolbar does not display iii (3 of 900) nor 1 (20 of 900) for the first page of the first chapter. Instead it displays 3 (3 of 900) and 20 (20 of 900) although "Use logical page number" is checked in the preferences.

The documents I publish are made from a *.book with several components:

  • First component: Title page with copyright
  • Next component: Table of content
  • Following components: The chapters and an index

I suppose I have to set some sort of properties somehow somewhere in here:

book.PDFPageHeight = 297 * 185771;

book.PDFPageWidth  = 210 * 185771;

var comp = book.FirstComponentInBook;

while(comp.ObjectValid()) {

    var openParams = GetOpenDefaultParams ();

    var i = GetPropIndex(openParams, Constants.FS_UpdateXRefs);

    openParams.propVal.ival = Constants.FV_DoOK;

    var doc = Open(comp.Name, openParams, new PropVals());

    doc.PDFBookmark = true;

    doc.DocAcrobatElements = false;

    comp = comp.NextBookComponentInDFSOrder;

}   

var params = GetSaveDefaultParams();

var index = GetPropIndex(params, Constants.FS_FileType);

params[index].propVal.ival = Constants.FV_SaveFmtPdf;

var pdfDocInfo = new Strings();

pdfDocInfo.push("Author");

pdfDocInfo.push("XXX GmbH");

book.PDFDocInfo = pdfDocInfo;

book.Save(pdfPath, params, new PropVals());

I checked the value of "comp.FirstPageNum" for all the components. The value for the first component with a chapter is "1" as it should be.

Best regards,

Fabian

TOPICS
Scripting

Views

690

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Jun 28, 2018 Jun 28, 2018

Hi Fabian,

Here is an example of the output from my PageLabeler script.

/pdfmark where { pop} { userdict /pdfmark /cleartomark load put} ifelse

[ {Catalog} << /PageLabels << /Nums [

0 << /S  /r  /St 1 /P () >>

1 << /S  /r  /St 2 /P () >>

2 << /S  /D  /St 1 /P (1-) >>

] >> >> /PUT pdfmark

This goes into a PostScript text frame on the first body page of the last component in the book. Each line starting with 03 represents the page numbering for each of the components in the book. The required syntax is do

...

Votes

Translate

Translate
Community Expert ,
Jun 26, 2018 Jun 26, 2018

Copy link to clipboard

Copied

Hi Fabian,

Please see my PageLabeler script: http://www.frameexpert.com/store/

Rick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 26, 2018 Jun 26, 2018

Copy link to clipboard

Copied

Hi Rick,

Thank you for answering. Unfortunately, the documents are published on a server, I can't use something with a GUI.

Fabian -

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 26, 2018 Jun 26, 2018

Copy link to clipboard

Copied

Hi Fabian,

The method PageLabeler uses is inserting pdfmark codes in a small Postscript text frame. This method could be modified so that it doesn't require the GUI interface. Please contact me offlist if you are interested in exploring this. Thank you very much.

rick at frameexpert dot com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 28, 2018 Jun 28, 2018

Copy link to clipboard

Copied

LATEST

Hi Fabian,

Here is an example of the output from my PageLabeler script.

/pdfmark where { pop} { userdict /pdfmark /cleartomark load put} ifelse

[ {Catalog} << /PageLabels << /Nums [

0 << /S  /r  /St 1 /P () >>

1 << /S  /r  /St 2 /P () >>

2 << /S  /D  /St 1 /P (1-) >>

] >> >> /PUT pdfmark

This goes into a PostScript text frame on the first body page of the last component in the book. Each line starting with 03 represents the page numbering for each of the components in the book. The required syntax is documented in Adobe's pdfmark Reference manual. The site license version of my PageLabeler script includes the source code and you may be able to integrate it into your own process.

-Rick

Votes

Translate

Translate

Report

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