Adobe Acrobat SDK - List of Preference Items

Jan 25, 2019

Copy link to clipboard

Copied

I am working on creating a vba script (Excel) that will create a pdf and fix the width of the document to size of the view port.  I reviewed the Interapplication Communication API Reference documentation that list all of the methods and properties of the api.  I want to use the “SetPreferenceEx” method to set the  Zoom preference  to  a value of Fit Width.  In the instructions (page28), the method provides the data type and description of the parameters. The first parameter is expecting an application preference to be provided, for example, I would expect to be able to pass “Zoom” into this parameter.  I have been unsuccessful in trying to set this parameter.  The description says to go to the Acrobat and PDF Library API reference for a list of preference items.  I found the document here , the issue I am having is that document has over 6,000 pages and I have been unsuccessful in finding the  list of preferences.  I was hoping you could provide me with a cheat sheet or a page number of where I can locate the list. 

Remember that preferences just change the viewer that you are targeting – it does not change the PDF. So that any else viewing the document will see their preference view.

TOPICS
Acrobat SDK and JavaScript

Views

494

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

Adobe Acrobat SDK - List of Preference Items

Jan 25, 2019

Copy link to clipboard

Copied

I am working on creating a vba script (Excel) that will create a pdf and fix the width of the document to size of the view port.  I reviewed the Interapplication Communication API Reference documentation that list all of the methods and properties of the api.  I want to use the “SetPreferenceEx” method to set the  Zoom preference  to  a value of Fit Width.  In the instructions (page28), the method provides the data type and description of the parameters. The first parameter is expecting an application preference to be provided, for example, I would expect to be able to pass “Zoom” into this parameter.  I have been unsuccessful in trying to set this parameter.  The description says to go to the Acrobat and PDF Library API reference for a list of preference items.  I found the document here , the issue I am having is that document has over 6,000 pages and I have been unsuccessful in finding the  list of preferences.  I was hoping you could provide me with a cheat sheet or a page number of where I can locate the list. 

Remember that preferences just change the viewer that you are targeting – it does not change the PDF. So that any else viewing the document will see their preference view.

TOPICS
Acrobat SDK and JavaScript

Views

495

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
Jan 25, 2019 0
Most Valuable Participant ,
Jan 26, 2019

Copy link to clipboard

Copied

Is zoom cruelly s preference? Where would you set it it Edit >Preferences, and would setting to do the job you want?

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...
Jan 26, 2019 0
Most Valuable Participant ,
Jan 26, 2019

Copy link to clipboard

Copied

Sorry, Is zoom really a... dang autocorrect

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...
Jan 26, 2019 0
Adobe Employee ,
Jan 26, 2019

Copy link to clipboard

Copied

Remember that preferences just change the viewer that you are targeting – it does not change the PDF. So that any else viewing the document will see their preference view.

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...
Jan 26, 2019 1
Jan 28, 2019

Copy link to clipboard

Copied

Thank you for the response.  I was hoping there would be away to alter the users preferences but that didn't really make sense.  Our team will have to decide if its worth increase the size of the font to increase the readability of the pdf.

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...
Jan 28, 2019 0
Most Valuable Participant ,
Jan 28, 2019

Copy link to clipboard

Copied

I don't understand the problem. If things are too small, why not just zoom?

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...
Jan 28, 2019 0
Jan 28, 2019

Copy link to clipboard

Copied

Our team was trying to avoid having the user zoom in.  I agree I would just zoom in as well.

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...
Jan 28, 2019 0
Most Valuable Participant ,
Jan 28, 2019

Copy link to clipboard

Copied

So, why not zoom in for the user? Or set the document open options so they don't have to?

I don't quite follow the path from this problem which led you to wanting to edit Preferences?

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...
Jan 28, 2019 0
Jan 28, 2019

Copy link to clipboard

Copied

Are you saying there is a method I can use to set the zoom factor for the user?  I would like for when the user opens the pdf its set to the zoom factor that was established when the macro executed said code.

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...
Jan 28, 2019 0
Jan 28, 2019

Copy link to clipboard

Copied

I am using Excel VBA to create the pdf, so Ideally I wanted the zoom to be set at the time the pdf is created.  So, when the user opens the pdf the zoom is set to the value that was used at the time of creation.

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...
Jan 28, 2019 0
Most Valuable Participant ,
Jan 28, 2019

Copy link to clipboard

Copied

AVPageViewZoomTo may be your friend.

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...
Jan 28, 2019 0
Jan 28, 2019

Copy link to clipboard

Copied

Its funny you mention that method. The original code I had was using this method.  I would open the document and then zoom in and save the document.  I found the snippet online and some minor modifications to zoom in. The problem is the pdf when saved doesn't retain the zoom in factor. 

Dim AcroApp As CAcroApp

Dim AVDoc As CAcroAVDoc

Dim PDDoc As CAcroPDDoc

Dim PPageView As CAcroAVPageView

Set AcroApp = CreateObject("AcroExch.App")

Set AVDoc = CreateObject("AcroExch.AVDoc")

pdfFileName = "C:\Users\csmith\Desktop\Metrics\Commercial Quote Builder.pdf"

Call AVDoc.Open(pdfFileName, "")

Set AVDoc = AcroApp.GetActiveDoc

If AVDoc.IsValid Then

    Set PDDoc = AVDoc.GetPDDoc

    Set PPageView = AVDoc.GetAVPageView

    PPageView.ZoomTo 4, 1

    PDDoc.Save PDSaveFull, "C:\Users\csmith\Desktop\Metrics\Commercial Quote Builder.pdf"

    PDDoc.Close

   

End If

'Close the PDF

AVDoc.Close True

AcroApp.Exit

'Cleanup

Set PPageView = Nothing

Set PDDoc = Nothing

Set AVDoc = Nothing

Set AcroApp = Nothing

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...
Jan 28, 2019 0