Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 1038

Issues with Opening known document

$
0
0
Because of the file location not being opened to be used as pdfPage the pageorder variable was not behaving correctly.   
Dim c As Array
Dim pageorder As Integer
 Dim count As Integer
 Dim filename As String
 Dim type As String 
 Dim filelocation As String
 Dim typediscription As Array
 Dim reporttype As Array 
 Dim filedirectory As String 
 Dim PO As String 
 Dim Serial As String
 Dim LT As String 
 Dim UT As String 
 Dim RT As String 
 Dim HOLIDAY As String 
 Dim HE As String 
 Dim ET As String 
 Dim MP As String 
 Dim LP As String 
 Public inputfile As string


inputfile = Form3.TextBox1.Text
        'page Numbers
        LT = Me.LTpgno.Text
        UT = Me.UTpgno.Text
        RT = Me.RTpgno.Text
        HOLIDAY = Me.Holidaypgno.Text
        HE = Me.Hepgno.Text
        ET = Me.ETpgno.Text
        MP = Me.MPpgno.Text
        LP = Me.LPpgno.Text
        'Arrays
        c = {LT, UT, RT, HOLIDAY, HE, ET, MP, LP}
        typediscription = {"LT", "UT", "RT", "HT", "HE", "ET", "MP", "LP"}
        filedirectory = "\\louisville200\NDE\NDT Reports\"
        reporttype = {"Hydro\", "UT\", "RT\", "Holiday\", "Helium Leak Tests\", "ET\", "MP\", "LP\"}
        'Var
        PO = Form1.POBox.Text
        Serial = Form1.SerielBox.Text

        For i = 0 To 7
            pageorder = c(i)
            If pageorder = 0 Then
            Else
                'nameing
                type = typediscription(i)
                filename = type & PO & " - " & Serial & ".pdf"
                'Creating File Location and name
                filelocation = filedirectory & reporttype(i) & filename
                'Open document
                Dim pdfDocument As New Document(inputfile)
                'Get particular page
                Dim pdfPage As Page = pdfDocument.Pages(pageorder)
                'Save the page as PDF file
                Dim newDocument As New Document()
                newDocument.Pages.Add(pdfPage)
                newDocument.Save("filename")

            End If

Viewing all articles
Browse latest Browse all 1038

Trending Articles