How to set page layout to single page using plugin?

Community Beginner ,
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.

Most Valuable Participant
Correct answer by Test Screen Name | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript

Views

213

Likes

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

How to set page layout to single page using plugin?

Community Beginner ,
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.

Most Valuable Participant
Correct answer by Test Screen Name | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript

Views

214

Likes

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
Oct 12, 2017 0
Most Valuable Participant ,
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?)

Likes

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
Reply
Loading...
Oct 13, 2017 0
Community Beginner ,
Oct 15, 2017

Copy link to clipboard

Copied

Yes!

I want to set the current layout mode.

Likes

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
Reply
Loading...
Oct 15, 2017 0
Most Valuable Participant ,
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.

Likes

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
Reply
Loading...
Oct 16, 2017 0
Community Beginner ,
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.

Likes

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
Reply
Loading...
Oct 16, 2017 0