ScanToPDF > Plugins > Application Integration

The API plugin enables ScanToPDF to be called from within your own application.

Your application can pass parameters specifying the pdf filename and pdf filepath and receives a notification from ScanToPDF confirming that the PDF has been created successfully.

The simplest method of integration is for your application to launch Scan To PDF passing the PDF filename and path as a switch. For example, in C# this would be achieved with the following code:
And here's some example code for scanning a supplier invoice document to PDF from within an Access Database application:
    Dim pdfpath As Variant
    Dim pdfname As Variant
    Dim progpath As Variant
    Dim progswitches As Variant
    Dim x%

    pdfname = "SI123456" '//set by your application
    pdfpath = "//server/works order pdfs/" & pdfname & ".pdf"
    progpath = "C:\Program Files\O Imaging Corporation\ScanToPDF\scantopdf.exe"
    progswitches = " /autoscan /terminateaftersave /pdfpath=""" & pdfpath & """"
    x% = Shell(progpath & progswitches, vbNormalFocus)
Integration via the ScanToPDF OCX is very simple.
    One property: FilePath
    One event: PDFFileSaved
    One method: DoScan
so in VB you would have something like:
    Private Sub cmdSetPath_Click
    STP1.FilePath = "c:\test.pdf"
    MsgBox "Required file path set to:" & STP1.FilePath
    End Sub

    Private Sub CommandScan_Click
    ' start ScanToPDF
    On Error Resume Next
    Shell "C:\Program Files\O Imaging Corporation\scantopdf\LSTPDF.exe"
    STP1.DoScan
    End Sub
    Private Sub STP1_PDFFileSavedByVal PDFFilePath As String
    MsgBox "PDFFileSaved: " & PDFFilePath
    End Sub
ScanToPDF can also be integrated with your application software via a number of other methods. These methods include:  
    Exposing ScanToPDF as a .NET Assembly
    Execution of C# or VB.NET custom code - see C# DynaCode for more details
    SQL script database updates
    XML file write/read
Integration enables Scan To PDF to automatically attach a PDF to a record in your database. For example a supplier's invoice to the bought ledger record, a CV to a candidates record, a POD to a despatch record, etc.

Please feel free to contact us with details of your requirements.