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

How to set page layout to single page using plugin?

Explorer ,
Oct 12, 2017 Oct 12, 2017

Copy link to clipboard

Copied

Hi.

After Opening a PDF file, I want to set the page layout to single page.

I think maybe AVDocSetViewDefEx (AVDoc doc, ASCab viewDef)  can be used,

but I don't know how to set ASCab viewDef about page layout.

And,is it possible to use AVDocOpenFromFileWithParams (ASPathName pathName, ASFileSys fileSys, const

ASText tempTitle, AVDocOpenParams params) to set page layout?

I tried to use PDDocSetLayoutMode (PDDoc doc, PDLayoutMode mode),

but the page layout not changed.

If it's possible, please show me some codes.

Best Regard.

TOPICS
Acrobat SDK and JavaScript

Views

735

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

LEGEND , Oct 16, 2017 Oct 16, 2017

PDDocSetLayoutMode is documented as updating the Catalog only. The Catalog is consulted when the document is opened, so this is how you set the future mode.

You could probably do this with AVDocSetViewDefEx but that requires knowing the key to use; this could be got from experimenting with the results of AVDocGetViewDefEx. However, AVDocSetViewDef (no Ex) is easier. It is marked as superseded but has not gone away and is unlikely to.

Votes

Translate

Translate
LEGEND ,
Oct 13, 2017 Oct 13, 2017

Copy link to clipboard

Copied

Do you want to set the current mode (how it will view this time, at this moment) or the future mode (how it will view next time it is opened?)

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 ,
Oct 15, 2017 Oct 15, 2017

Copy link to clipboard

Copied

Yes!

I want to set the current layout mode.

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
LEGEND ,
Oct 16, 2017 Oct 16, 2017

Copy link to clipboard

Copied

PDDocSetLayoutMode is documented as updating the Catalog only. The Catalog is consulted when the document is opened, so this is how you set the future mode.

You could probably do this with AVDocSetViewDefEx but that requires knowing the key to use; this could be got from experimenting with the results of AVDocGetViewDefEx. However, AVDocSetViewDef (no Ex) is easier. It is marked as superseded but has not gone away and is unlikely to.

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 ,
Oct 16, 2017 Oct 16, 2017

Copy link to clipboard

Copied

I have succeed in setting the page layout to single page layout with your advice.

Thank you very much.

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 Beginner ,
May 16, 2021 May 16, 2021

Copy link to clipboard

Copied

LATEST

I realize a deal of time has passed, but - it would have been really nice if you had shared, briefly even, how you were able to accomplish this.  No disrespect intended, honestly.  Any efforts that you expended in order to figure it out - which were probably non-trivial - could be quite helpful to others 🙂 

 

I'm glad you were able to get that to work though. 

It seems like it should be a matter of your preferences being respected by DC, but - that's not the case, clearly. (Preferences->Page Display -> Single, Single-continuous, etc..  don't work, and when one "updates" a document's properties to use a preferred Page-Display setting, the document's properties are not updated. 

I'll try to see if I can figure out how you did it - never worked with plugins, so it'll be interesting.

Cheers.

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