PDF through VBA: How to set Initial View?

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default PDF through VBA: How to set Initial View?

    - Adobe Acrobat 6.0 (sorry we're a bit out of date)
    - MS Office 2003
    - MS Windows XP Professional SP2

    I am trying to automate the creation of PDFs from MS Word. I have succeeded. My VBA code works fine (have pasted it below). I can create a PDF, and give it a title and author.
    The problem I am having is with the Initial View settings, i.e. how the document opens. I want to hardcode:
    1. Show to "Page Only"
    2. Page Layout to "Continuous"
    3. Magnification to "Fit Width"
    The first I have done, using AcroExch.PDDoc's SetPageMode() function (although it seems to default to that even without doing this). I cannot, for the life of me, find any reference to the second and third, though. This must be doable, right? Be kind of weird not to have access to this in the API.
    Hours of Googling has thrown up three ideas I've discarded.
    1. AcroExch.App's SetPreference() function. This would presumably change preferences on the machine making the PDF, not reading it. I don't want to fiddle with other people's preferences anyway.
    2. AcroExch.AVPageView's ZoomTo() function. Ditto. I am not creating an app to view PDFs, just trying to configure the default for opening one I've created.
    3. An "undocumented" SetOpenInfo() in AcroExch.PDDoc. This looked the most promising for Magnification, but nobody seems to be able to get it to work, and it does nothing for me either. Someone somewhere even suggested it had been deprecated in later versions of Acrobat.
    So... what do I do?
    Thanks in advance for any pointers.
    jON

    ===============================================

    Sub MakePDF(strFilename As String, strTitle As String, strAuthor As String)

    Dim pdfD As PdfDistiller
    Dim strPDFName As String
    Dim strPSName As String

    strPSName = strFilename & ".ps"
    strPDFName = strFilename & ".pdf"

    '... make PS
    Application.ActivePrinter = myPDFPrinter
    Application.PrintOut Filename:="", _
    Range:=wdPrintAllDocument, _
    Item:=wdPrintDocumentContent, _
    Copies:=1, _
    Pages:="", _
    PageType:=wdPrintAllPages, _
    ManualDuplexPrint:=False, _
    Collate:=True, _
    Background:=False, _
    PrintToFile:=True, _
    PrintZoomColumn:=0, _
    PrintZoomRow:=0, _
    PrintZoomPaperWidth:=0, _
    PrintZoomPaperHeight:=0, _
    OutputFileName:=strPSName, _
    Append:=False

    '... make PDF
    Set pdfD = New PdfDistiller
    pdfD.FileToPDF strPSName, strPDFName, ""

    '... tag PDF
    Set qq = CreateObject("AcroExch.PDDoc")
    b = qq.Open(strPDFName)
    b = qq.SetInfo("Title", strProperties_Title)
    b = qq.SetInfo("Author", strProperties_Author)
    b = qq.SetPageMode(1) '... 1 = PDUseNone

    b = qq.Save(33, strPDFName) '... 33 = PDSaveFull (1) OR PDSaveCollectGarbage (32)
    b = qq.Close

    End Sub
    Jon_Pyne@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. Initial Setup
      When I set up the coldfusion sever in order to test it you are suppose to type in the address of the sever (192.168.0.1:8500) and get a blank page. ...
    2. Changing the "Initial View" of a document.
      I am working on a document "A" in Acrobat 6.0.1 and creating a bookmark to another document "B". My problem is when document "B" opens, it opens to...
    3. Initial View
      I am working on a document "A" in Acrobat 6.0.1 and creating a bookmark to another document "B". My problem is when document "B" opens, it open to...
    4. $: - where does it get its initial values?
      Howdy, Where does $: get its values from? The book says that it contains an array of places to search for loaded files and that it is...
    5. Wierd error when going to Design View from HTML view
      When I go from HTML view (in a webform) to Design View I get the following error: Could not open in Design view. Quote values differently inside a...
  3. #2

    Default Re: PDF through VBA: How to set Initial View?

    I have the same problem. I need to change Initial View Settings configuring the following settings

    2. Page Layout to "Single Page"
    3. Magnification to "Fit Width"

    My software configuration is as follows:

    - Adobe Acrobat 7.9
    - Microsoft Windows XP SP2
    - Visual Basic 6

    Has anyone worked with this attributes of Acrobat?
    Ana_M_Conde@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139