Ask a Question related to Adobe Acrobat SDK, Design and Development.
-
Jon_Pyne@adobeforums.com #1
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
-
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. ... -
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... -
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... -
$: - 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... -
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... -
Ana_M_Conde@adobeforums.com #2
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



Reply With Quote

