:Start of VDSAcroPDF <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN"> <html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>VDSAcroPDF.dsc</title><STYLE>BODY{FONT-SIZE: 12px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #ffffed } A{COLOR: Blue} A:active {FONT-WEIGHT: bold; COLOR: #008000} A:visited{FONT-WEIGHT: bold; COLOR: #400000} A:hover{ FONT-WEIGHT: bold; COLOR: #008000;} H1{COLOR: #400000; TEXT-ALIGN: left FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif} #copyright { border-top: 2px solid rgb(165, 82, 0); width: 100%; } DIV.left{TEXT-ALIGN: left} DIV.centered{TEXT-ALIGN: center}</STYLE></head><body bgcolor=#ffffed><table width="100%" height="133"><tr height="129"><th width="173"><a href = "http://www.dragonsphere.net" target = "_blank"><img style="Z-INDEX: 100; LEFT: 25px; POSITION: absolute; TOP: 40px" height="124" alt="DragonSphere" src="http://www.dragonsphere.net/images/dragonfly.png" width="169" align="left" border="0"></a></th><th><a href = "http://www.dragonsphere.net" target = "_blank"><img style="Z-INDEX: 100; LEFT: 200px; POSITION: absolute; TOP: 40px" height="124" alt="Software" src="http://www.dragonsphere.net/images/dslogotext.png" width="473" align="left" border="0"></a></th></tr></table><br/><!--

#DEFINE COMMAND,<!--
#DEFINE COMMAND,-->
<!-- This is crazy but now we should be able to see this script in the browser and run it in VDS too without changing the source code. --><h1>DragonSphere Software Demos</h1><br/><p>If you are viewing this script in your browser you can save it as a VDS 5.x source file (*.dsc) to run it.</p><br/><hr><br/><pre>

Title Embeded PDF Example
#
# <a href = "http://www.dragonsphere.net" target = "_blank">DragonSphere Software's Home Page</a>
#  
# <a href = "http://www.dragonsphere.net/products/gadgetx/demos/vdsacropdf.zip">All Source Files for this demo</a>
#
# This demo hosts the <a href = "http://www.adobe.com/products/acrobat/readstep2.html" target = "_blank">Adobe Reader 7.0</a> in a VDS dialog.
# The example uses the IAcroAXDocShim Interface and shows how
# to create the AcroPDFLib object and place it on a VDS Dialog
# 

If @Greater(@Name(@SYSINFO(DSVER)),4)
<!-- GadgetX --><a href = "http://www.dragonsphere.net/products/gadgetx/gadgetx.zip">
External GadgetX.dll,@SYSINFO(DSVER)
<!-- GadgetX --></a>
  # GadgetX Commands
  #DEFINE COMMAND,GadgetX,OLE,Set
  # GadgetX Functions
  #DEFINE FUNCTION,GadgetX,OLE,Get
Else
  Warn This demo was designed to work with@CR()VDS 5.x from http://www.dialogscript.com
  Stop
End

# The following line is required
Ole Init
# The following line is optional
# it is here for debugging your script
# Ole Exceptions,SHOW

DIALOG CREATE,Embeded PDF Example,-1,0,276,110
REM *** Modified by Dialog Designer on 12/2/2005 - 10:10 ***
  DIALOG ADD,TEXT,TEXT1,21,10,,,Click the Select but for the PDF file you want to view.
  DIALOG ADD,BUTTON,PDFCLICK,56,101,64,24,Select
DIALOG SHOWMODAL

:evloop
  wait event
  %E = @event()
  if %E
    goto %E
  End
goto evloop

:PDFCLICKBUTTON
  # IAcroAXDocShim Interface
  # Example:  Uses the following inline command to add
  #           and create the control with a single command.
  %%classname = #PDFExample  
  DIALOG CREATE,PDF,-1,0,800,600,CLASS PDFExample
  DIALOG Add,MENU,&File,&Open,-,&Quit
    # Add the Acrobat PDF reader ActiveX control
    GadgetX Add,Ole,AcroPDFLib,%%classname,0,0,800,600,AcroPDF.PDF.1
  DIALOG SHOW
:OPENMENU
  %F = @filedlg("PDF file (*.pdf)|*.pdf",Open file)
  If %F
    If @Get(AcroPDFLib)
      # property src
      Ole Set,AcroPDFLib,"src = ^B",@Path(%F)
      # method LoadFile
      #%A = @Ole(Call,AcroPDFLib,^B,"LoadFile(^B)",@Name(%F).@Ext(%F))
      Ole Call,AcroPDFLib,"LoadFile(^B)",@Name(%F).@Ext(%F)
      # method printWithDialog
      Ole Call,AcroPDFLib,printWithDialog
    End
  End
goto evloop

:QUITMENU
:CLOSE
  # The lines below are required to be called
  # before your script exits
  If @Get(AcroPDFLib)
    # Remove the object from the Dialog
    Ole Remove,AcroPDFLib,%%classname
    # Free the Object variable
    Ole Free,Object,AcroPDFLib
  End
  # Close the dialogs for this example
  DIALOG SELECT,1
  DIALOG CLOSE
  DIALOG SELECT,0
  DIALOG CLOSE
  # The following line is optional
  # it is here for debugging your script
  # Ole Exceptions,HIDE
  
  # The following line is required to be
  # the very last executed line in your script
  Ole UnInit
Exit
<!-- This is crazy but now we should be able to see this script in the browser. --></pre><div id="copyright"><p>copyright &copy; DragonSphere Software 2000-2006<br><a href="http://www.dragonsphere.net/terms.html" target="_blank">Terms and Conditions</a></p></div></body></html><!--
:-->
:<!--
  
Exit 
# -->End of VDSAcroPDF
