Planet PDF Forum Archive

Planet PDF  ForumThe page you are viewing is part of our 160,000 page discussion forum archive. See below for PDF-related discussions spanning 1999-2008. To ask questions and get help, head to the live Planet PDF Forum.


How to search this archive. The quickest way is to use the filters on our Advanced Search page so that only archive pages are included in the results.


Previous | Next | (P-PDF) JavaScript


Topic: Disabling the 'Save As...' button using Javascript
Conf: (P-PDF) JavaScript, Msg: 66112
From: Brad Saide
Date: 6/3/2002 07:57 AM

Hi All.

We finally developed a solution whereby we distributed a customised pdf reader, without the save functionality. Unfortunately the development team here could not work out how to do it using the acrobat reader application, even with the subtle clues and hints given by other members of the forum who obviously knew the answer all along.

I was under the impression that a forum was a way to pass on knowledge, rather than a way to make people think you are smarter. This is why I love Microsoft's forums so much - the knowledge is shared, and those receiving the knowledge (in most cases) learn from it. I'll get off my soapbox now. Anyway, in the hope that the knowledge is used elsewhere, here is the code for the VB app we developed.

First, we added the Acrobat Control ActiveX object (I think it is part of the SDK), then -




Dim intZoom As Integer

Private Sub Form_Activate()
On Error GoTo Err1
intZoom = 100
cmpPdf1.Top = 420
cmpPdf1.Left = 30
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'The following code was put in an If-Then conditional statement to prevent errors occuring when setting
'the height and width of the cmpPdf1 part and the command button that covers the menu
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If frmWOWReader.Height > 1000 Then
cmpPdf1.Height = frmWOWReader.Height - 890
cmpPdf1.Width = frmWOWReader.Width - 150
cmdHideBtn.Top = 420
cmdHideBtn.Left = frmWOWReader.Width - 375
End If

Exit Sub
Err1:
MsgBox "There has been an error." & vbCrLf & _
"Please contact the Woolworths National Customer Service Centre on 1800 623 557," & vbCrLf & _
"ask them to raise a PCMS to Web Services, and to include the following information ->" & _
vbCrLf & vbCrLf & "Err ID = " & Err.Number & vbCrLf & "Source = " & Err.Source & vbCrLf & "Desc = " & Err.Description & vbCrLf & "Form = frmWOWReader, Sub = Form_Resize", vbOKOnly & vbCritical, "Error"
End Sub


Private Sub Form_Resize()
On Error GoTo Err1
cmpPdf1.Top = 420
cmpPdf1.Left = 30
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'The following code was put in an If-Then conditional statement to prevent errors occuring when setting
'the height and width of the cmpPdf1 part and the command button that covers the menu
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If frmWOWReader.Height > 1000 Then
cmpPdf1.Height = frmWOWReader.Height - 890
cmpPdf1.Width = frmWOWReader.Width - 150
cmdHideBtn.Top = 420
cmdHideBtn.Left = frmWOWReader.Width - 375
End If
Exit Sub
Err1:
MsgBox "There has been an error." & vbCrLf & _
"Please contact the Woolworths National Customer Service Centre on 1800 623 557," & vbCrLf & _
"ask them to raise a PCMS to Web Services, and to include the following information ->" & _
vbCrLf & vbCrLf & "Err ID = " & Err.Number & vbCrLf & "Source = " & Err.Source & vbCrLf & "Desc = " & Err.Description & vbCrLf & "Form = frmWOWReader, Sub = Form_Resize", vbOKOnly & vbCritical, "Error"
End Sub

Private Sub Form_Terminate()
Unload Me
End Sub


Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
On Error GoTo Err1

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'This Select Case statement checks for what value is returned when one of the menu buttons is
'pressed, and then performs a particular operation depending on the value returned to the code.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Select Case Button.Key
Case Is = "["
cmpPdf1.gotoFirstPage
Case Is = "<"
cmpPdf1.gotoPreviousPage
Case Is = ">"
cmpPdf1.gotoNextPage
Case Is = "]"
cmpPdf1.gotoLastPage
Case Is = "p"
cmpPdf1.printAllFit (True)
Case Is = "h"
frmHelp.Visible = True
Case Is = "+"

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'The user wants to increase the zoom size of the current PDF file
'This conditional statement checks to see if the current value of intZoom
'Is = or > than 10. If it is, then 10 is added to the current value , and the
'zoom of the current pdf doc is set to the new value of intZoom.
'Else, the value of intZoom is set to 100% (IE when the button is first pressed and intZoom = 0)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

If intZoom >= 10 Then
intZoom = intZoom + 10
Else
intZoom = 100
End If
cmpPdf1.setZoom (intZoom)
Case Is = "-"

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'The user wants to decrease the zoom size of the current PDF file
'This conditional statement checks to see if the current value of intZoom
'Is = or > than 10. If it is, then 10 is subtracted from the current value, and the
'zoom of the current pdf doc is set to the new value of intZoom.
'Else, the value of intZoom is set to 100% (IE when the button is first pressed and intZoom = 0,
'or when the value drops below 10 due to repeated clicking.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


If intZoom >= 10 Then
intZoom = intZoom - 10
Else
intZoom = 100
End If
cmpPdf1.setZoom (intZoom)
End Select
Exit Sub
Err1:
MsgBox "There has been an error." & vbCrLf & _
"Please contact the Woolworths National Customer Service Centre on 1800 623 557," & vbCrLf & _
"ask them to raise a PCMS to Web Services, and to include the following information ->" & _
vbCrLf & vbCrLf & "Err ID = " & Err.Number & vbCrLf & "Source = " & Err.Source & vbCrLf & "Desc = " & Err.Description & vbCrLf & "Form = frmWOWReader, Sub = Form_Resize", vbOKOnly & vbCritical, "Error"
End Sub


PDF In-Depth Free Product Trials Ubiquitous PDF

Pitstop Pro

Now graphic arts professionals have even broader and more expert control over their PDF documents. With...

Download free demo

ARTS PDF Aerialist

The ultimate plug-in for Adobe Acrobat and #1 selling product at PDF Store. Advanced splitting, merging,...

Download free demo

Ubiquitous PDF: 2009 IRS income tax forms available for download

With less than a month to go until Americans will be scrambling to file their 2009 tax paperwork. Luckily, printable PDF versions of forms such as the 1040 can be downloaded for free from the IRS website.

March 18, 2010
Search Planet PDF
more searching options...







Download PDF Creator

PDF Resources
Platinum Sponsor
Create & Edit PDF - Nitro PDF Software

ARTS PDF

Silver Sponsors

PDF-Tools QuickPDF: The Unrivaled PDF Developer Toolkit

Get Nitro PDF Professional
Featured Product

NITRO PDF Professional

Built from the ground up, the perfect desktop PDF product for business and enterprise. Nitro PDF Professional has an uncompromising feature set so you can create, combine, edit, collaborate on and...

Featured Event

No upcoming events

PDF Store Categories