Jump to content

Display PDF content in GUI


CZamirekko
 Share

Recommended Posts

I have this code to display the contents of a PDF file in a GUI object. The code is only functional if the included 3rd line is not commented out. Can you advise to correct the code so that MsgBox does not run?

Thank you

Func ShowDialog()
    ; PDF object
        MsgBox(16, $App_name & " " & $App_version, "random text")
        $objectPDF = ObjCreate("AcroPDF.PDF.1")
        $objectPDF.src = $INI_inputfolder &"\"& $pdflist[1]
        $objectPDF.setShowToolbar(0)
        $objectPDF.setShowScrollbars(0)
        $objectPDF.setView('FitH')
        $objectPDF.setLayoutMode('SinglePage')
        $objectPDF.setPageMode('None')
    ; PDF object in GUI
    $dialog = GUICreate("load EAN", 1280, 820, -1, -1, -1,$WS_EX_TOPMOST)
    GUICtrlCreateObj($objectPDF, 5, 5, 1270, 720)

    $Dinput = GUICtrlCreateEdit("", 5, 740, 350, 42, BitOR($ES_WANTRETURN, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL))

    GUICtrlSetTip(-1, "load ean")
    GUICtrlSetFont(-1, 22, 400, 0, "Arial")
    $stat   = _GUICtrlStatusBar_Create($dialog)

    Dim $StatusBar1_PartsWidth[1] = [-1]
    _GUICtrlStatusBar_SetParts($stat, $StatusBar1_PartsWidth)
    _GUICtrlStatusBar_SetText($stat, $App_name & " verze " & $App_version & " ( vers. " & $App_lastupd & ")", 0)

    GUISetState(@SW_SHOW, $dialog)
    GUICtrlSetState($Dinput,$GUI_FOCUS)

    While 1
        $Read = GUICtrlRead($Dinput)
        If StringRight($Read,2) = @CRLF Then
            GUIDelete($dialog)
                Return StringReplace($Read,@CRLF,"")
            ExitLoop
        EndIf
    WEnd
EndFunc

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...