Skip to main content
January 25, 2019
Answered

Adobe Acrobat SDK - List of Preference Items

  • January 25, 2019
  • 6 replies
  • 2713 views

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. 

This topic has been closed for replies.
Correct answer lrosenth

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.

6 replies

Legend
January 28, 2019

No, it wouldn't. It just zooms. Have you considered the "Restore last view settings when reopening documents" preference, if that is acceptable to your users (remember, if they reopen the PDF it will open it not where you closed it but where THEY closed it).

January 28, 2019

I talked to the person that requested this and they're ok with fixing the zoom.  In the future, I will work on making the size of objects on the page dynamic based on the amount of content so we don't have empty space. The solution doesn't account for the size of the content so we have the font size set to a small size so we don't have objects overlapping.  I appreciate your help today .

Legend
January 28, 2019

AVPageViewZoomTo may be your friend.

January 28, 2019

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

Legend
January 28, 2019

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?

January 28, 2019

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.

Legend
January 28, 2019

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

January 28, 2019

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

lrosenth
Adobe Employee
lrosenthCorrect answer
Adobe Employee
January 26, 2019

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.

January 28, 2019

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.

Legend
January 26, 2019

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

Legend
January 26, 2019

Sorry, Is zoom really a... dang autocorrect