VERSION 5.00 Object = "{82963F89-0C60-4090-BE33-E14F34906092}#1.0#0"; "PDFview.ocx" Begin VB.Form Form1 Caption = "PDFView OCX Demo" ClientHeight = 8475 ClientLeft = 60 ClientTop = 240 ClientWidth = 10260 LinkTopic = "Form1" ScaleHeight = 8475 ScaleWidth = 10260 StartUpPosition = 2 'CenterScreen Begin PDFViewer.PDFView PDFView1 Height = 6375 Left = 120 TabIndex = 31 Top = 1440 Width = 9975 _ExtentX = 17595 _ExtentY = 11245 End Begin VB.CommandButton Command20 Height = 375 Left = 4320 TabIndex = 12 ToolTipText = "Add comment to PDF pages" Top = 8040 Width = 255 End Begin VB.CommandButton Command19 Height = 375 Left = 4080 TabIndex = 11 ToolTipText = "Add text to PDF pages" Top = 8040 Width = 375 End Begin VB.CommandButton Command18 Height = 375 Left = 5040 TabIndex = 15 ToolTipText = "Create an image file from active PDF page" Top = 8040 Width = 255 End Begin VB.CommandButton Command17 Height = 375 Left = 4800 TabIndex = 14 ToolTipText = "Create a text file from active PDF page" Top = 8040 Width = 255 End Begin VB.CommandButton Command16 Height = 375 Left = 5280 TabIndex = 16 ToolTipText = "Form field demo" Top = 8040 Width = 255 End Begin VB.CommandButton Command15 Height = 375 Left = 4560 TabIndex = 13 ToolTipText = "Open a Data Stream Object" Top = 8040 Width = 255 End Begin VB.CommandButton Command14 Caption = "Get PDF Viewer .NET" Height = 400 Left = 4440 TabIndex = 19 ToolTipText = "Download the PDF Viewing component for .NET developers" Top = 8400 Width = 3315 End Begin VB.CommandButton Command13 Caption = ">|" Height = 375 Left = 3480 TabIndex = 9 ToolTipText = "Last page" Top = 8040 Width = 375 End Begin VB.CommandButton Command10 Caption = ">" Height = 375 Left = 3240 TabIndex = 8 ToolTipText = "Next page" Top = 8040 Width = 255 End Begin VB.CommandButton Command4 Caption = "<" Height = 375 Left = 3000 TabIndex = 7 ToolTipText = "Previous page" Top = 8040 Width = 255 End Begin VB.CommandButton Command8 Caption = "|<" Height = 375 Left = 2640 TabIndex = 6 ToolTipText = "First page" Top = 8040 Width = 375 End Begin VB.CommandButton Command2 Height = 375 Left = 3840 TabIndex = 10 ToolTipText = "Add image file to PDF pages" Top = 8040 Width = 255 End Begin VB.CommandButton Command6 Height = 375 Left = 1080 Picture = "Form1.frx":0000 Style = 1 'Graphical TabIndex = 3 ToolTipText = "Save a copy of PDF file" Top = 8040 Width = 375 End Begin VB.CommandButton Command7 Caption = "Page" Height = 375 Left = 2040 TabIndex = 5 ToolTipText = "Set Page Number" Top = 8040 Width = 615 End Begin VB.CommandButton Command1 Caption = "Zoom" Height = 375 Left = 1440 TabIndex = 4 ToolTipText = "Set Zoom Percentage" Top = 8040 Width = 615 End Begin VB.CommandButton Command12 Height = 375 Left = 0 Picture = "Form1.frx":0102 Style = 1 'Graphical TabIndex = 0 ToolTipText = "Open PDF file" Top = 8040 Width = 375 End Begin VB.CommandButton Command11 Height = 375 Left = 720 Picture = "Form1.frx":0204 Style = 1 'Graphical TabIndex = 2 ToolTipText = "Go to home PDF file" Top = 8040 Width = 375 End Begin VB.CommandButton Command9 Height = 375 Left = 360 Picture = "Form1.frx":0306 Style = 1 'Graphical TabIndex = 1 ToolTipText = "Print PDF file" Top = 8040 Width = 375 End Begin VB.CommandButton Command5 Cancel = -1 'True Caption = "&Exit" Height = 375 Left = 9840 TabIndex = 18 Top = 8040 Width = 495 End Begin VB.CommandButton Command3 Caption = "&Buy PDFViewer OCX" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 7920 TabIndex = 17 Top = 8040 Width = 1935 End Begin VB.Frame Frame1 Caption = "Adobe Reader Options" Height = 975 Left = 120 TabIndex = 20 Top = 360 Width = 9975 Begin VB.CheckBox Check10 Caption = "Close Toolbar" Height = 255 Left = 8280 TabIndex = 29 Top = 600 Width = 1455 End Begin VB.CheckBox Check9 Caption = "Disable Toolbar" Height = 255 Left = 6600 TabIndex = 28 Top = 600 Width = 1575 End Begin VB.CheckBox Check8 Caption = "Disable Text Copying" Height = 255 Left = 7680 TabIndex = 27 Top = 240 Width = 1815 End Begin VB.CheckBox Check7 Caption = "Disable Popup Menus" Height = 255 Left = 4560 TabIndex = 26 Top = 600 Width = 2655 End Begin VB.CheckBox Check6 Caption = "Disable Document Properties Dialog" Height = 255 Left = 4560 TabIndex = 25 Top = 240 Width = 3015 End Begin VB.CheckBox Check5 Caption = "Disable Preferences Dialog" Height = 255 Left = 2160 TabIndex = 24 Top = 600 Width = 2415 End Begin VB.CheckBox Check4 Caption = "Disable Save As Dialog" Height = 255 Left = 2160 TabIndex = 23 Top = 240 Width = 2055 End Begin VB.CheckBox Check3 Caption = "Disable Save Dialog" Height = 255 Left = 240 TabIndex = 22 Top = 600 Width = 1935 End Begin VB.CheckBox Check2 Caption = "Disable Print Dialog" Height = 255 Left = 240 TabIndex = 21 Top = 240 Width = 1815 End End Begin VB.Label Label1 Caption = "The lowest-priced ActiveX PDF viewing component available with the most features, free support and future upgrades!" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 255 Left = 120 TabIndex = 30 Top = 50 Width = 13000 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal HWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Dim strFilePath As String Dim blnDownloaded As Boolean Private Sub Check10_Click() PDFView1.CloseToolbar End Sub Private Sub Check2_Click() If Check2.Value Then PDFView1.DisablePrintDialog MsgBox "Click the Print Icon or press keys CTRL+P to see the effect", vbOKOnly, "Disable Print Dialog" Else PDFView1.EnablePrintDialog End If End Sub Private Sub Check3_Click() If Check3.Value Then PDFView1.DisableSaveDialog Else PDFView1.EnableSaveDialog End If End Sub Private Sub Check4_Click() If Check4.Value Then PDFView1.DisableSaveAsDialog MsgBox "Click the Save Icon to see the effect", vbOKOnly, "Disable Save As Dialog" Else PDFView1.EnableSaveAsDialog End If End Sub Private Sub Check5_Click() If Check5.Value Then PDFView1.DisablePreferencesDialog MsgBox "Press keys CTRL+K to see the effect", vbOKOnly, "Disable Page Preferences Dialog" Else PDFView1.EnablePreferencesDialog End If End Sub Private Sub Check6_Click() If Check6.Value Then PDFView1.DisableDocumentPropertiesDialog MsgBox "Press keys CTRL+D to see the effect", vbOKOnly, "Disable Document Properties Dialog" Else PDFView1.EnableDocumentPropertiesDialog End If End Sub Private Sub Check7_Click() If Check7.Value Then PDFView1.DisablePopupMenus MsgBox "Right-click on the PDF file to see the effect", vbOKOnly, "Disable Popup Menus" Else PDFView1.EnablePopupMenus End If End Sub Private Sub Check8_Click() If Check8.Value Then PDFView1.DisableTextCopy = True MsgBox "Try copying some PDF text and pasting", vbOKOnly, "Disable Text Copying" Else PDFView1.DisableTextCopy = False End If End Sub Private Sub Check9_Click() If Check9.Value Then PDFView1.DisableToolbar MsgBox "Click on any icon in the toolbar to see the effect", vbOKOnly, "Disable Toolbar" Else PDFView1.EnableToolbar End If End Sub Private Sub Command1_Click() Dim s As String Dim z As String On Error Resume Next z = CStr(PDFView1.ZoomPct) s = InputBox("Enter number 1 through 6400", "Zoom Percentage", z) If Len(s) Then If CInt(s) < 1 Or CInt(s) > 6400 Then MsgBox "Zoom percentage must be a number 1 through 6400", vbExclamation, App.Title Else PDFView1.SetZoomPct CInt(s) End If End If End Sub Private Sub Command10_Click() PDFView1.NextPage End Sub Private Sub Command11_Click() PDFView1.GoHome End Sub Private Sub Command12_Click() Dim strFile As String Dim b As Boolean On Error Resume Next If MsgBox("Click the Yes button to open a file located on a disk." & vbCrLf _ & "Click the No button to open a file located on the internet.", vbYesNo, App.Title) = vbYes Then strFile = OpenDialog(Me, "PDF Files (*.pdf)|*.pdf|All Files (*.*)|*.*", "Select PDF File to Open", strFilePath) If Len(strFile) Then strFilePath = Left(strFile, InStrRev(strFile, "\")) PDFView1.Path = strFile b = PDFView1.OpenPDF If b = False Then MsgBox "Unable to open file.", vbExclamation Else Me.Caption = App.Title & " - " & PDFView1.Path End If End If Else strFile = InputBox("Enter URL of PDF file (HTTP or FTP)", "Open PDF file located on the internet", "http://www.getfilez.com/pdfview.pdf") If Len(strFile) Then PDFView1.Path = strFile b = PDFView1.OpenPDF If b = False Then MsgBox "Unable to open file.", vbExclamation Else Me.Caption = App.Title & " - " & PDFView1.Path End If End If End If End Sub Private Sub Command13_Click() PDFView1.LastPage End Sub Private Sub Command14_Click() Dim strHTML As String On Error Resume Next strHTML = "http://www.getfilez.com/pdfvnet.zip" ShellExecute 0, vbNullString, strHTML, vbNullString, vbNullString, 1 End Sub Private Sub Command15_Click() 'Open PDF file from an ADO Data Stream Object 'One practical use: PDFs stored in database fields as BLOBs 'can be read using method OpenPDFstream Dim objStream As Object Dim b As Boolean On Error Resume Next Set objStream = CreateObject("ADODB.Stream") If Err.Number Then MsgBox Err.Number & " : " & Err.Description, vbExclamation, "Error" Exit Sub End If objStream.Open 'set as binary objStream.Type = 1 objStream.LoadFromFile App.Path & "\pdfview.bin" b = PDFView1.OpenPDFstream(objStream) objStream.Close Set objStream = Nothing Me.Caption = App.Title & " - " & PDFView1.Path End Sub Private Sub Command16_Click() PDFView1.FindText Exit Sub Dim s As String PDFView1.OpenPDF App.Path & "\fw9.pdf" Me.Caption = App.Title & " - " & PDFView1.Path 'Set the PDF file containing form fields PDFView1.SetFormPDF PDFView1.Path 'Store form field names and values to a text file s = PDFView1.GetFormFields(App.Path & "\fields.txt") MsgBox s, vbOKOnly, "Form Fields in fw9.pdf" MsgBox "Click OK to create a copy of fw9.pdf and populate fields with data." FileCopy App.Path & "\fw9.pdf", App.Path & "\fw9filled.pdf" ' Set Form Field Values 'Set the PDF file containing form fields PDFView1.SetFormPDF App.Path & "\fw9filled.pdf" ' Name PDFView1.SetFormFieldValue "f1-1", "John Doe", True 'Flatten field ' Company Name PDFView1.SetFormFieldValue "f1-2", "SkySof Software Inc.", True 'Flatten field ' Other PDFView1.SetFormFieldValue "f1-3", "Other Info" ' Street Address PDFView1.SetFormFieldValue "f1-4", "123 Main St.", False, True 'Set field as Read-Only ' City, State, Zip PDFView1.SetFormFieldValue "f1-5", "Mayberry, North Carolina 12345" ' Requestor's Name and Address PDFView1.SetFormFieldValue "f1-6", "Jane Doe" & vbCrLf & "56 Elm St" & vbCrLf & "Anytown, NY 99999" ' Additional Account Numbers PDFView1.SetFormFieldValue "f1-7", "12345, 67890" ' Soc Sec Number PDFView1.SetFormFieldValue "f1-8", "1" PDFView1.SetFormFieldValue "f1-9", "2" PDFView1.SetFormFieldValue "f1-10", "3" PDFView1.SetFormFieldValue "f1-11", "4" PDFView1.SetFormFieldValue "f1-12", "5" PDFView1.SetFormFieldValue "f1-13", "6" PDFView1.SetFormFieldValue "f1-14", "7" PDFView1.SetFormFieldValue "f1-15", "8" PDFView1.SetFormFieldValue "f1-16", "9" ' Employer ID Number PDFView1.SetFormFieldValue "f1-17", "1" PDFView1.SetFormFieldValue "f1-18", "2" PDFView1.SetFormFieldValue "f1-19", "3" PDFView1.SetFormFieldValue "f1-20", "4" PDFView1.SetFormFieldValue "f1-21", "5" PDFView1.SetFormFieldValue "f1-22", "6" PDFView1.SetFormFieldValue "f1-23", "7" PDFView1.SetFormFieldValue "f1-24", "8" PDFView1.SetFormFieldValue "f1-26", "9" ' Individual/Sole Proprietor PDFView1.SetFormFieldValue "c1-1", "Yes" 'PDFView1.SetFormFieldValue "c1-1", "No" //Uncheck ' Corporation PDFView1.SetFormFieldValue "c1-2", "Yes" ' Partnership PDFView1.SetFormFieldValue "c1-3", "Yes" ' Other PDFView1.SetFormFieldValue "c1-4", "Yes" ' Exempt from Backup Withholding PDFView1.SetFormFieldValue "c1-5", "Yes" 'Note: For radio button fields you may need to set the value to "On" or "Off" 'Reopen PDF with filled form fields PDFView1.OpenPDF App.Path & "\fw9filled.pdf" Me.Caption = App.Title & " - " & PDFView1.Path 'Store form field names and values to a text file s = PDFView1.GetFormFields(App.Path & "\fields.txt") MsgBox s, vbOKOnly, "Form Fields in fw9filled.pdf" 'Refresh PDF Viewer PDFView1.Refresh End Sub Private Sub Command17_Click() Dim strFile As String strFile = App.Path & "\page.txt" 'Create a text file from the active PDF page If PDFView1.SavePageAsTextFile(strFile) = 1 Then Shell "notepad " & strFile, vbNormalFocus End If 'Create a text file from the active PDF (all pages) 'If PDFView1.SavePDFAsTextFile(strFile) = 1 Then ' Shell "notepad " & strFile, vbNormalFocus 'End If 'Create a text file from the active PDF (page 2 to last page) 'If PDFView1.SavePDFAsTextFile(strFile, 2, -1) = 1 Then ' Shell "notepad " & strFile, vbNormalFocus 'End If 'Create a text file from the active PDF (last page) 'If PDFView1.SavePDFAsTextFile(strFile, -1, -1) = 1 Then ' Shell "notepad " & strFile, vbNormalFocus 'End If End Sub Private Sub Command18_Click() Dim strFile As String strFile = App.Path & "\page.jpg" 'Create an image file from the active PDF page If PDFView1.SavePageAsImageFile(strFile, JPG, 150) = 1 Then ShellExecute 0, vbNullString, strFile, vbNullString, vbNullString, 1 End If End Sub Private Sub Command19_Click() PDFView1.UnloadPDF FileCopy App.Path & "\pdfview.pdf", App.Path & "\copy.pdf" PDFView1.Path = App.Path & "\copy.pdf" 'Add text to pages in PDF PDFView1.AddText "Hello World!", 1, 3, 200, 300, 50, 1, 0.6, 0, 0.5, 45, TimesItalic PDFView1.OpenPDF App.Path & "\copy.pdf" Me.Caption = App.Title & " - " & PDFView1.Path MsgBox "Text added to pages 1 thru 3" End Sub Private Sub Command2_Click() Dim strFile As String strFile = App.Path & "\water1.jpg" PDFView1.UnloadPDF FileCopy App.Path & "\pdfview.pdf", App.Path & "\copy.pdf" PDFView1.Path = App.Path & "\copy.pdf" 'Add image file to pages in PDF PDFView1.AddImageFile strFile, 1, 3, 100, 500, 2, 50 PDFView1.OpenPDF App.Path & "\copy.pdf" Me.Caption = App.Title & " - " & PDFView1.Path MsgBox "Image added to pages 1 thru 3" End Sub Private Sub Command20_Click() PDFView1.UnloadPDF FileCopy App.Path & "\pdfview.pdf", App.Path & "\copy.pdf" PDFView1.Path = App.Path & "\copy.pdf" 'Add text to pages in PDF PDFView1.AddComment Comment, "Hello World!", 1, 3, 100, 700, 200, 300, 130, 80, "My Comment", 0.7, 0, 0.1, False PDFView1.OpenPDF App.Path & "\copy.pdf" Me.Caption = App.Title & " - " & PDFView1.Path MsgBox "Comment added to pages 1 thru 3" End Sub Private Sub Command3_Click() 'The pricing for PDFView OCX through www.regnow.com is as follows: '$299.95 USD Individual Developer License '$499.95 USD Site Developer License (Unlimited number of developers per site) 'Save 10% by buying PDFView OCX through www.paypal.com!!! '$269.95 USD Individual Developer License '$449.95 USD Site Developer License (Unlimited number of developers per site) 'Go to this link to buy a single developer license using PayPal: 'https://www.paypal.com/xclick/business=kusluski%40mail.ic.net&item_name=PDFViewer+OCX+Single+Developer+License&amount=269.95 'Go to this link to buy a site developer license using PayPal: 'https://www.paypal.com/xclick/business=kusluski%40mail.ic.net&item_name=PDFViewer+OCX+Site+Developer+License&amount=449.95 'PDFView OCX may be distributed with your application royalty free and all future 'upgrades are free! Absolutely no runtime license fees! 'Please send emails to kusluski@bellsouth.net for additional ordering methods. Dim strHTML As String On Error Resume Next MsgBox "When ordering enter the coupon code SUM-KDQC to save 10%", vbOKOnly, "Coupon Code" strHTML = "https://www.regnow.com/softsell/nph-softsell.cgi?item=4459-37" ShellExecute 0, vbNullString, strHTML, vbNullString, vbNullString, 1 End Sub Private Sub Command4_Click() PDFView1.PreviousPage End Sub Private Sub Command5_Click() Unload Me End Sub Private Sub Command6_Click() If MsgBox("Save a copy of the entire PDF file? Select No to extract specific pages.", vbQuestion + vbYesNo) = vbYes Then 'To display a File Save Dialog Screen use this code PDFView1.SaveAsDialog Else Dim s As String s = InputBox("Enter the pages to extract (Example: 1-3,5)", "Pages", "1-3,5") If Trim(s) <> "" Then If PDFView1.ExtractPages(App.Path & "\extract.pdf", s) = 1 Then MsgBox "Pages extracted into file " & App.Path & "\extract.pdf" Else MsgBox "Unable to extract pages" End If End If End If 'Note: To save copies of active PDF without a dialog screen use 'method SaveCopy (see code below) Exit Sub Dim strFile As String On Error Resume Next strFile = SaveDialog(Me, "PDF Files (*.pdf)|*.pdf", "Save PDF File", strFilePath, "file.pdf") If Len(strFile) Then Dim b As Boolean If LCase(Left(PDFView1.Path, 4)) = "http" Or LCase(Left(PDFView1.Path, 4)) = "ftp:" Then Form2.Show End If b = PDFView1.SaveCopy(strFile) Unload Form2 If b Then MsgBox "File " & strFile & " saved.", vbOKOnly, App.Title Else MsgBox "Unable to save.", vbExclamation, App.Title End If End If End Sub Private Sub Command7_Click() Dim s As String Dim c As String On Error Resume Next 'Get the current page c = CStr(PDFView1.Page) s = InputBox("Enter page number", "Page Number", c) If Len(s) Then PDFView1.SetPageNo CLng(s) End If End Sub Private Sub Command8_Click() PDFView1.FirstPage End Sub Private Sub Command9_Click() Dim ps As String Dim js As String Dim st As String PDFView1.PrintPDFWithDialog Exit Sub 'set default printer 'PDFView1.DefaultPrinter = "My Printer" 'MsgBox PDFView1.DefaultPrinter st = PDFView1.CheckPrinterStatus(ps, js) 'st = PDFView1.CheckPrinterStatus(ps, js, "My Printer") If InStr(ps, "Printer Status = Ready") Then 'OK ElseIf st = "ERR" Then MsgBox "Invalid Printer" Exit Sub Else MsgBox "Printer not ready" Exit Sub End If Dim b As Boolean 'b = PDFView1.PrintPDF() 'print PDF silently without dialog screen b = PDFView1.PrintPDF(True, 10) 'wait until printer has no jobs before printing, timeout after 10 seconds of waiting If b Then MsgBox "Printed" Else MsgBox "Unable to print" End If 'PdfView1.PrintPDFWithDialog() End Sub Private Sub Form_Load() Dim b As Boolean On Error Resume Next strFilePath = App.Path 'Open a password-protected PDF file 'PDFView1.Password = "letmein" 'PDFView1.Path = "C:\temp\console.pdf" 'Open PDF file with an unknown file extention 'b = PDFView1.OpenPDF(strFilePath & "\pdfview.bin") 'Open PDF file w/toolbar by setting Path property and calling method OpenPDF PDFView1.Path = strFilePath & "\pdfview.pdf" b = PDFView1.OpenPDF 'Open PDF file with toolbar by passing PDF file name 'b = PDFView1.OpenPDF(strFilePath & "\pdfview.pdf") 'Open PDF file w/toolbar at specific page number and zoom percentage 'b = PDFView1.OpenPDF(strFilePath & "\pdfview.pdf", 4, 75) 'Open PDF file with the toolbar disabled 'b = PDFView1.OpenPDF(strFilePath & "\pdfview.pdf", blnDisableToolbar:=True) 'Open PDF file with the toolbar closed. Not applicable for PDF-XChange. 'b = PDFView1.OpenPDF(strFilePath & "\pdfview.pdf", blnCloseToolbar:=True) 'Open a file located using HTTP protocol 'b = PDFView1.OpenPDF("http://www.getfilez.com/pdfview.pdf") 'Open PDF file using FTP protocol 'b = PDFView1.OpenPDF("ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-407.pdf") 'This code downloads a file from a web server to a local drive then opens it locally 'PDFView1.BeginDownload "http://www.getfilez.com/pdfview.pdf", "c:\temp\pdfview.pdf" 'Do While blnDownloaded = False 'wait for file to be downloaded ' DoEvents 'Loop 'b = PDFView1.OpenPDF("c:\temp\pdfview.pdf") If b = False Then MsgBox "Unable to open PDF file.", vbExclamation, App.Title End If 'Set page number 'PDFView1.SetPageNo 3 'Set zoom percentage 'PDFView1.SetZoomPct 60 'Close toolbar 'PDFView1.CloseToolbar 'Use with property DisableSaveKeys to prevent saving PDF files 'Disable toolbar 'PDFView1.DisableToolbar 'PDF-XChange toolbar methods 'PDFView1.CloseCommentAndMarkupToolbar 'PDFView1.CloseDocumentOptionsToolbar 'PDFView1.CloseFileToolbar 'PDFView1.CloseFindToolbar 'PDFView1.CloseLaunchDocumentToolbar 'PDFView1.CloseLinksToolbar 'PDFView1.CloseMeasuringToolbar 'PDFView1.CloseMenu 'PDFView1.ClosePagesLayoutToolbar 'PDFView1.ClosePagesNavigationToolbar 'PDFView1.ClosePropertiesToolbar 'PDFView1.CloseRotateViewToolbar 'PDFView1.CloseStandardToolbar 'PDFView1.CloseZoomToolbar 'PDFView1.DisableCommentAndMarkupToolbar 'PDFView1.DisableDocumentOptionsToolbar 'PDFView1.DisableFileToolbar 'PDFView1.DisableFindToolbar 'PDFView1.DisableLaunchDocumentToolbar 'PDFView1.DisableLinksToolbar 'PDFView1.DisableMeasuringToolbar 'PDFView1.DisableMenu 'PDFView1.DisablePagesLayoutToolbar 'PDFView1.DisablePagesNavigationToolbar 'PDFView1.DisablePropertiesToolbar 'PDFView1.DisableRotateViewToolbar 'PDFView1.DisableStandardToolbar 'PDFView1.DisableZoomToolbar 'Zoom functions 'PDFView1.Zoom100 'PDFView1.ZoomFitWidth 'PDFView1.ZoomFitPage 'PDFView1.ZoomFitVisible 'Not applicable for PDF-XChange. 'PDFView1.ZoomReflow ' Not applicable for PDF-XChange. 'Disable CTRL+SHIFT+S keys which calls the Save Dialog Screen 'Use this with method CloseToolbar to prevent saving PDF files 'PDFView1.DisableSaveKeys = True 'Disable the Save Dialog 'PDFView1.DisableSaveDialog 'PDFView1.DisableSaveDialog "save copy as" 'PDF-XChange 'PDFView1.DisableSaveAsDialog "save as" 'PDF-XChange 'Disable the Print Dialog 'PDFView1.DisablePrintDialog 'Disable the Page Preferences Dialog 'PDFView1.DisablePreferences 'Disable all popup menus 'PDFView1.DisablePopupMenus 'PDFView1.DisplayMessage = True 'Display a message when a popup menu is blocked 'Disable CTRL+C to prevent copying of PDF text 'Use with DisablePopupMenus above 'PDFView1.DisableCopyKeys = True 'Another way to prevent copying of PDF text is to use this property which will clear the Clipboard 'If you use this then it is not necessary to use DisablePopupMenus and DisableCopyKeys 'PDFView1.DisableTextCopy = True 'PDFView1.DisableTabs True 'Disable Document Properties Dialog 'PDFView1.DisableDocumentPropertiesDialog 'Disable the Export to Image Dialog (PDF-XChange) 'PDFView1.DisableExportToImageDialog Me.Caption = App.Title & " - " & PDFView1.Path 'Set form's minimum height and width FixSize Me, Me.Width, Me.Height, Screen.Width, Screen.Height End Sub Private Sub Form_Resize() Dim ctl As Control On Error Resume Next For Each ctl In Form1.Controls If TypeOf ctl Is CommandButton Or TypeOf ctl Is CheckBox Then If InStr(1, " check2 check3 check4 check5 check6 check7 check8 check9 check10 ", ctl.Name, vbTextCompare) Then 'ignore ElseIf ctl.Name = "Command14" Then ctl.Top = Form1.Height - 800 Else ctl.Top = Form1.Height - 1000 End If End If Next PDFView1.Width = Form1.Width - 500 PDFView1.Height = Form1.Height - Frame1.Height - Label1.Height - 1400 End Sub Private Sub PDFView1_AfterOpenPDF(varFile As Variant) 'MsgBox "PDF opened", vbInformation, App.Title End Sub Private Sub PDFView1_BeforeOpenPDF(varFile As Variant) 'MsgBox "Open PDF", vbInformation, App.Title End Sub Private Sub PDFView1_DownloadComplete(MaxBytes As Long, SaveFile As String) blnDownloaded = True 'MsgBox "Download completed", vbInformation, App.Title End Sub Private Sub PDFView1_DownloadError(SaveFile As String) blnDownloaded = True 'MsgBox "Error occurred while downloading", vbExclamation, App.Title End Sub Private Sub PDFView1_DownloadProgress(CurBytes As Long, MaxBytes As Long, SaveFile As String) Form2.Label1.Caption = "Downloaded " & CurBytes & " of " & MaxBytes & " bytes" End Sub Private Sub PDFView1_DownloadStarted(SaveFile As String) blnDownloaded = False 'MsgBox "Download started", vbInformation, App.Title End Sub Private Sub PDFView1_OpenPDFError(varFile As Variant, varErrorCode As Variant) 'MsgBox "Error occurred while opening PDF", vbExclamation, App.Title End Sub