Announcement

Collapse
No announcement yet.

DDT-PB9 PDF View, a viewer for PDF files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Hello Marc.

    Ofcourse I will supply the COM version. I add a lot of information in the info section.
    But if you need more information please ask for it.

    Here is my COM translation for your code:

    Code:
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    '
    ' PDF View, a PowerBASIC PDF Viewer
    '       Based on the Quick PDF Library 7.12, ActiveX version
    '       Available at: www.quickpdflibrary.com
    '
    ' Released to the public domain on March 15, 2009
    '       This software is free and may be used in private and commercial projects
    '       Credit is always appreciated but not requested or required
    '       If you profit from this software, Karma dictates you be nice and share
    '               My suggestion, Kiva at: http://www.kiva.org/app.php
    '       If this software makes you filthy rich <smile> you'll be required to share
    '       your financial good fortune from this software with me also <smile>
    '
    ' Acknowledgments:
    '   Joe Byrne, thanks for planting the seed that got this project going
    '       Rowan Hanna, thanks for helping with Quick PDF questions, we're not done yet!
    '       Hans Rietveld, thanks for correcting and updating "QuickPDFDLL0712.inc"
    '
    ' Background:
    '       http://www.powerbasic.com/support/pbforums/showthread.php?t=39904
    '       http://www.powerbasic.com/support/pbforums/showthread.php?t=40025
    '       http://www.powerbasic.com/support/pbforums/showthread.php?t=40085
    '
    '   The project:
    '       Compiler:       PowerBASIC 9.01
    '   Tested on:  Windows XP SP2
    '       DLL used:       QuickPDFAX0712.dll ActiveX version (final release)
    '       Include:        iSED712.inc (COM version, generated by the Powerbasic combrowser v. 2.00.070 )
    '       Display:        1024x768
    '
    '   History:
    '       Mar 15, 2009 - Version 0.01 by Marc Giao
    '           Original code release
    '           Added option to load and view single PDF files
    '           Added zoom in and out feature
    '           Added next and previous page feature
    '
    '       Mar 22, 2009 - Version 0.05 by Marc Giao
    '           Added some error checking
    '           Added printing (with input from Hans Rietveld)
    '           Added window resizing (need some work)
    '
    '       Mar 25, 2009 - Version 0.06 rewritten by Hans Rietveld to this ActiveX version.
    '           Versionnumber is waiting for approval by Marc Giao
    '           Steps to take to use this version.
    '           Use the final release 7.12 and go to the map \ActiveX
    '           Copy the QuickPDFAX0712.dll to your system map e.g. \windows\system32
    '           Register this dll with the run command:  regsvr32 C:\WINDOWS\system32\QuickPDFAX0712.dll
    '           Use the Powerbasic combrowser and select Quick PDF Library 7.12 7.c
    '           Select save as:  iSED712.inc
    '           Use the default options.
    '           Build and save this file in program map, or in the include path, or add path information to: #INCLUDE "iSED712.inc"
    '
    '   To do list:
    '       Add option to load multiple files
    '       Add scroll bars to view area
    '
    '
    '   WARNING: This is not production ready code, it's a work in progress and
    '   only minimal error checking is currently provided.
    '
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
    #DIM ALL
    #COMPILE EXE "PDFView.exe"
    #INCLUDE "WIN32API.inc"
    #INCLUDE  "iSED712.inc"      ' Just pick a name and put the file in the path or add path information
    #RESOURCE "PDFView.pbr"
    
    %PDFCanvas      = 1000
    %LoadPDF        = 1001
    %Zoom_I         = 1002
    %Zoom_O         = 1003
    %N_Page         = 1004
    %P_Page         = 1005
    %ZoomVal        = 1006
    %PageNum        = 1007
    %StateLog       = 1008
    %CurrentDoc     = 1009
    %LblDocInfo     = 1010
    %LblRange       = 1011
    %PrintPDF       = 1012
    %LblCurrent     = 1013
    %FileGroup      = 1014
    %ZoomGroup      = 1015
    %PageGroup      = 1016
    %PrintGroup     = 1017
    %PageRange      = 1018
    %PrintSetup     = 1019
    %PrintAll       = 1020
    %PrintOdd       = 1021
    %PrintEven      = 1022
    
    $UnlockKey      = " !!!! insert the licensecode here  !!!!!  "
    $PDFFilter      = "PDF Files  (*.pdf)" + $NUL + "*.PDF" + $NUL
    
    GLOBAL LibInstance  AS LONG
    GLOBAL DocId        AS LONG
    GLOBAL PrintSel     AS STRING ' Printer to use for printout
    GLOBAL oQuickpdf    AS Int_IPDFLibrary
    
    
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    FUNCTION PBMAIN( )  AS LONG
    LOCAL MainHndl      AS LONG ' main dialog handel
    
    ' create object
        LET oQuickpdf = NEWCOM CLSID $CLSID_QuickPDFAX0712_PDFLibrary
    
        ' Is object valid
        IF ISFALSE ISOBJECT(oQuickpdf) THEN
            MSGBOX "Unable to open or start QPDF.dll!"
            FUNCTION = 1
            EXIT FUNCTION
        END IF
    
        DIALOG NEW PIXELS, 0, "PDF View", 10, 10, 1024, 768 _
            , %WS_BORDER OR %WS_SYSMENU OR %WS_THICKFRAME _
            , 0 _
            TO MainHndl
    
    ' file group
        CONTROL ADD FRAME,    MainHndl, %FileGroup, "FILE", 870, 5, 128, 90, 0, 0
        CONTROL ADD BUTTON,   MainHndl, %LoadPDF, "Load PDF", 874, 20, 120, 30, 0, 0, CALL OnEvent_LoadPDF( )
        CONTROL ADD LABEL,    MainHndl, %LblCurrent, "Current Document:",876, 58, 120, 15, , 0,
        CONTROL ADD COMBOBOX, MainHndl, %CurrentDoc, , 874, 70, 120, 25, %CBS_DROPDOWN OR %WS_DISABLED, 0, ' CALL OnEvent_??()
    
    ' zoom group
        CONTROL ADD FRAME,    MainHndl, %ZoomGroup, "ZOOM", 870, 100, 128, 50, 0, 0
        CONTROL ADD LABEL,    MainHndl, %ZoomVal, "0000", 915, 123, 36, 15, %SS_CENTER, 0, ' CALL OnEvent_??()
        CONTROL ADD BUTTON,   MainHndl, %Zoom_O, "Out", 874, 115, 40, 30, 0, 0, CALL OnEvent_Zoom( )
        CONTROL ADD BUTTON,   MainHndl, %Zoom_I, "In", 954, 115, 40, 30, 0, 0, CALL OnEvent_Zoom( )
    
    ' page group
        CONTROL ADD FRAME,    MainHndl, %PageGroup, "PAGE", 870, 155, 128, 50, 0, 0
        CONTROL ADD LABEL,    MainHndl, %PageNum, "0000", 915, 178, 36, 15, %SS_CENTER, 0 ' CALL OnEvent_??()
        CONTROL ADD BUTTON,   MainHndl, %P_Page, "<<", 874, 170, 40, 30, 0, 0, CALL OnEvent_Page( )
        CONTROL ADD BUTTON,   MainHndl, %N_Page, ">>", 954, 170, 40, 30, 0, 0, CALL OnEvent_Page( )
    
    ' print group
        CONTROL ADD FRAME,    MainHndl, %PrintGroup, "PRINT", 870, 210, 128, 100, 0, 0
        CONTROL ADD OPTION,   MainHndl, %PrintAll, "All", 876, 225, 30, 15, 0, 0 CALL OnEvent_Print( )
        CONTROL ADD OPTION,   MainHndl, %PrintOdd, "Odd", 909, 225, 40, 15, 0, 0 CALL OnEvent_Print( )
        CONTROL ADD OPTION,   MainHndl, %PrintEven, "Even", 950, 225, 42, 15, 0, 0 CALL OnEvent_Print( )
        CONTROL ADD LABEL,    MainHndl, %LblRange, "Page Range:", 875, 242, 120, 15, 0, 0 ' CALL OnEvent_??()
        CONTROL ADD TEXTBOX,  MainHndl, %PageRange, "", 875, 255, 118, 18, 0, 0, ' CALL OnEvent_???()
        CONTROL ADD BUTTON,   MainHndl, %PrintPDF, "Print", 874, 275, 80, 30, 0, 0, CALL OnEvent_Print( )
        CONTROL ADD BUTTON,   MainHndl, %PrintSetup, "Set Up", 954, 275, 40, 30, 0, 0, CALL OnEvent_Print( )
    
        CONTROL ADD LABEL,    MainHndl, %LblDocInfo, "Document Information:", 870, 385, 120, 15, 0, 0 ' CALL OnEvent_??()
        CONTROL ADD TEXTBOX,  MainHndl, %StateLog,"" , 870, 400, 128, 300 _
            , %ES_AUTOHSCROLL OR %ES_AUTOVSCROLL OR %ES_LEFT OR %WS_TABSTOP OR %ES_MULTILINE OR %ES_WANTRETURN OR %WS_HSCROLL _ '  OR %WS_VSCROLl
            , %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
            ', CALL OnEvent_???( )
    
        XPRINT ATTACH DEFAULT
        PrintSel = XPRINT$
        DIALOG SHOW MODAL MainHndl, CALL OnEvent_MainDlg
    
    END FUNCTION ' PBMAIN
    
    CALLBACK FUNCTION OnEvent_MainDlg
    LOCAL Temp      AS STRING ' temp text buffer
    LOCAL Result    AS LONG
    LOCAL W         AS LONG
    LOCAL DlgH      AS LONG
    
        SELECT CASE AS LONG CB.MSG
            CASE %WM_MOVE
                DIALOG SET USER CB.HNDL, 8, %WM_MOVE
                FUNCTION = 1
    
            CASE %WM_SIZING
                Result = ShowControls( CB.HNDL, 0 )
                FUNCTION = 1
    
            CASE %WM_EXITSIZEMOVE
                DIALOG GET USER CB.HNDL, 8 TO Result
                IF Result = %WM_MOVE THEN
                    DIALOG SET USER CB.HNDL, 8, 0
                ELSE
                    Result = ShowControls( CB.HNDL, 1 )
                END IF
                FUNCTION = 1
    
            CASE %WM_INITDIALOG ' main dialog is about to be shown
    
                Result = oQuickpdf.UnlockKey( UCODE$($UnlockKey ))
    
                IF Result AND oQuickPDF.Unlocked( ) THEN
                    Temp + = "Library Unlocked" + $CRLF
    
                ELSE
                    MSGBOX "Unable to unlock library. Terminating application" ,%MB_ICONERROR, "Fatal Error"
                    DIALOG END CB.HNDL
                END IF
    
                Temp + = "Temporary file:" + $CRLF
    
                IF oQuickPDF.SetTempPath( UCODE$(EXE.PATH$)) _
                AND oQuickPDF.SetTempFile( UCODE$(EXE.PATH$ + "\QPDFTemp.dat")) _
                THEN
                    Temp + = "  Path and Name set" + $CRLF
                ELSE
                    Temp + = "  Unable to set Path or Name" + $CRLF
                END IF
    
                CALL ShowControls( CB.HNDL, 1 )
                CONTROL SET TEXT CB.HNDL, %StateLog, Temp + $CRLF + "Ready..."
    
                Temp = "PowerBASIC   PDFView Ver. 0.06            "
                Temp + = "Quick PDF ActiveX Ver. " + oQuickPDF.LibraryVersion( )
                Temp + = "   (" + ACODE$(oQuickPDF.LicenseInfo( )) + ")"
                DIALOG SET TEXT CB.HNDL, Temp
    
                FUNCTION = 1
    
            CASE %WM_DESTROY ' main dialog is about to be destroyed
                Result = oQuickPDF.RemoveDocument( DocId )
                GRAPHIC WINDOW END
                SET oQuickpdf = NOTHING
                FUNCTION = 1
    
        END SELECT
    
    
    END FUNCTION ' OnEvent_MainDlg
    
    CALLBACK FUNCTION OnEvent_LoadPDF( ) AS LONG
    LOCAL Selection   AS STRING
    LOCAL Result      AS LONG
    
    
        IF  CB.MSG = %WM_COMMAND AND    CB.CTL = %LoadPDF AND CB.CTLMSG = %BN_CLICKED THEN
    
            DISPLAY OPENFILE CB.HNDL, , , "Open PDF File", "", $PDFFilter, _
            "", "", 0 TO Selection ' [,countvar]
    
            IF LEN( Selection ) THEN
                IF oQuickPDF.DocumentCount( ) THEN
                    GRAPHIC CLEAR
                    GRAPHIC REDRAW
                    CONTROL SET TEXT CB.HNDL, %StateLog, ""
                    Result = oQuickPDF.RemoveDocument( DocId )
                END IF
    
            ELSE
                FUNCTION = 1
                EXIT FUNCTION
            END IF
    
            IF oQuickPDF.LoadFromFile( UCODE$(Selection) ) THEN
                DocId = oQuickPDF.SelectedDocument( )
                CONTROL SET TEXT CB.HNDL, %CurrentDoc, PATHNAME$( NAME,  Selection )
    
            ELSE
                MSGBOX "Unable to load selected file" ,%MB_ICONWARNING, "File Error"
                FUNCTION = 1
                EXIT FUNCTION
            END IF
    
            IF oQuickPDF.PageCount( ) AND oQuickPDF.SelectedPage( ) THEN
                ' document appears valid, render it
                Result = RenderToCanvas( CB.HNDL, "Zoom", 66 )
                CONTROL SET TEXT CB.HNDL, %StateLog, GetDocumentInfo( )
    
            ELSE
                MSGBOX "Unable to process loaded file" ,%MB_ICONWARNING, "File Error"
            END IF
    
            FUNCTION = 1
    
        END IF
    
    END FUNCTION ' OnEvent_LoadPDF
    
    CALLBACK FUNCTION OnEvent_Zoom( ) AS LONG
    
        IF  CB.MSG = %WM_COMMAND AND CB.CTLMSG = %BN_CLICKED THEN
    
            SELECT CASE CB.CTL
                CASE %Zoom_I
                    RenderToCanvas( CB.HNDL, "Zoom", 0 )
                CASE %Zoom_O
                    RenderToCanvas( CB.HNDL, "Zoom", -1 )
            END SELECT
    
            FUNCTION = 1
    
        END IF
    
    END FUNCTION ' OnEvent_Zoom
    
    CALLBACK FUNCTION OnEvent_Page( ) AS LONG
    LOCAL Result            AS LONG
    
        IF  CB.MSG = %WM_COMMAND AND CB.CTLMSG = %BN_CLICKED THEN
    
            SELECT CASE CB.CTL
                CASE %N_Page
                    Result = RenderToCanvas( CB.HNDL, "Page", 0 )
                CASE %P_Page
                    Result = RenderToCanvas( CB.HNDL, "Page", -1 )
            END SELECT
    
            FUNCTION = 1
    
        END IF
    
    END FUNCTION ' OnEvent_Page
    
    CALLBACK FUNCTION OnEvent_Print( ) AS LONG
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ' contributed by Hans Rietveld
    ' page range selection add by Marc Giao
    '
    LOCAL Result        AS LONG ' function return result
    LOCAL NF            AS LONG ' number of range fields
    LOCAL SP            AS LONG ' start page number
    LOCAL EP            AS LONG ' end page number
    LOCAL X             AS LONG ' index
    LOCAL PR            AS STRING ' range of pages to print
    LOCAL Txt           AS STRING '
    
    IF CB.MSG = %WM_COMMAND AND CB.CTLMSG = %BN_CLICKED THEN
    
        SELECT CASE CB.CTL
            CASE %PrintAll
                CONTROL SET TEXT CB.HNDL, %PageRange, "ALL"
            CASE %PrintOdd
                CONTROL SET TEXT CB.HNDL, %PageRange, "ODD"
            CASE %PrintEven
                CONTROL SET TEXT CB.HNDL, %PageRange, "EVEN"
            CASE %PrintSetup
                XPRINT ATTACH CHOOSE
                PrintSel = XPRINT$
                IF TRIM$(PrintSel) = "" THEN
                    XPRINT ATTACH DEFAULT
                    PrintSel = XPRINT$
                END IF
                CONTROL SET TEXT CB.HNDL, %StateLog, GetDocumentInfo( ) ' Update infoscreen
            CASE %PrintPDF
                CONTROL GET TEXT CB.HNDL, %PageRange TO PR
                    SELECT CASE PR
                        CASE ""
                            EXIT FUNCTION
    
                        CASE "ALL"
                            SP = 1
                            EP = oQuickPDF.PageCount( )
                            CONTROL SET TEXT CB.HNDL, %PageRange, "Printing:" + STR$(EP) + " Pages"
                            Result = oQuickPDF.PrintDocument( UCODE$(PrintSel), SP, EP, 0 )
                            XPRINT CLOSE
    
                        CASE "ODD"
                            SP = 1
                            EP = oQuickPDF.PageCount( )
                            FOR X = 1 TO EP STEP 2
                                CONTROL SET TEXT CB.HNDL, %PageRange, "Printing Page:" + STR$( X )
                                Result = oQuickPDF.PrintDocument( UCODE$(PrintSel), X, X, 0 )
                            NEXT
                            XPRINT CLOSE
    
                        CASE "EVEN"
                            SP = 2
                            EP = oQuickPDF.PageCount( )
                            FOR X = 2 TO EP STEP 2
                                CONTROL SET TEXT CB.HNDL, %PageRange, "Printing Page:" + STR$( X )
                                Result = oQuickPDF.PrintDocument( UCODE$(PrintSel), X, X, 0 )
                            NEXT
                            XPRINT CLOSE
    
                        CASE ELSE
                            PR = RETAIN$( PR, ANY "-,1234567890" )
                            IF PR = "" THEN EXIT FUNCTION
                            NF = PARSECOUNT( PR, "," )
                            DIM PP( 1 TO NF ) AS STRING ' array of pages to print
                            PARSE PR, PP( )
                            FOR X = 1 TO NF
                                IF PP( X ) = "" THEN ITERATE
                                IF PARSECOUNT( PP( X ), "-" ) THEN
                                    SP = VAL( PARSE$( PP( X ), "-", 1 ) )
                                    EP = VAL( PARSE$( PP( X ), "-", 2 ) )
                                    CONTROL SET TEXT CB.HNDL, %PageRange, "Printing:" + STR$(SP) + " to" + STR$(EP)
                                ELSE
                                    SP = VAL( PP( X ) ) : EP = SP
                                    CONTROL SET TEXT CB.HNDL, %PageRange, "Printing Page: " + STR$(SP)
                                END IF
                                Result = oQuickPDF.PrintDocument(UCODE$(PrintSel), SP, EP, 0 )
                            NEXT
                            XPRINT CLOSE
                    END SELECT
        END SELECT
    
    FUNCTION = 1
    
    END IF
    
    END FUNCTION ' OnEvent_Print
    
    FUNCTION ShowControls( DlgHndl AS LONG, V AS LONG ) AS LONG
    LOCAL R     AS LONG ' function result
    LOCAL W     AS LONG ' dialog client area width
    LOCAL H     AS LONG ' dialog client area height
    STATIC S    AS LONG ' visibility state of controls
    
    DIALOG GET CLIENT DlgHndl TO W, H
    
    IF V THEN
        CONTROL ADD GRAPHIC, DlgHndl, %PDFCanvas, "", 3, 3, W -136, H - 6  _
            , %WS_CHILD OR %WS_VISIBLE OR %SS_OWNERDRAW OR %WS_BORDER _
            , 0 ' %WS_EX_STATICEDGE ' %WS_EX_CLIENTEDGE
            ' CALL OnEvent_??()
    
        GRAPHIC ATTACH DlgHndl, %PDFCanvas, REDRAW
    ' file group
        CONTROL SET LOC DlgHndl, %LoadPDF, W - 126, 20
        CONTROL SHOW STATE DlgHndl, %LoadPDF, %SW_SHOW
        CONTROL SET LOC DlgHndl, %LblCurrent, W - 124, 58
        CONTROL SHOW STATE DlgHndl, %LblCurrent, %SW_SHOW
        CONTROL SET LOC DlgHndl, %CurrentDoc, W - 126, 70
        CONTROL SHOW STATE DlgHndl, %CurrentDoc, %SW_SHOW
    ' zoom group
        CONTROL SET LOC DlgHndl, %ZoomVal, W - 85, 128
        CONTROL SHOW STATE DlgHndl, %ZoomVal, %SW_SHOW
        CONTROL SET LOC DlgHndl, %Zoom_O, W - 126, 120
        CONTROL SHOW STATE DlgHndl, %Zoom_O, %SW_SHOW
        CONTROL SET LOC DlgHndl, %Zoom_I, W - 46, 120
        CONTROL SHOW STATE DlgHndl, %Zoom_I, %SW_SHOW
    ' page group
        CONTROL SET LOC DlgHndl, %PageNum, W - 85, 188
        CONTROL SHOW STATE DlgHndl, %PageNum, %SW_SHOW
        CONTROL SET LOC DlgHndl, %P_Page, W - 126, 180
        CONTROL SHOW STATE DlgHndl, %P_Page, %SW_SHOW
        CONTROL SET LOC DlgHndl, %N_Page, W - 46, 180
        CONTROL SHOW STATE DlgHndl, %N_Page, %SW_SHOW
    ' print group
        CONTROL SET LOC DlgHndl, %PrintAll, W - 126, 240
        CONTROL SHOW STATE DlgHndl, %PrintAll, %SW_SHOW
        CONTROL SET LOC DlgHndl, %PrintOdd, W - 92, 240
        CONTROL SHOW STATE DlgHndl, %PrintOdd, %SW_SHOW
        CONTROL SET LOC DlgHndl, %PrintEven, W - 50, 240
        CONTROL SHOW STATE DlgHndl, %PrintEven, %SW_SHOW
        CONTROL SET LOC DlgHndl, %LblRange, W - 125, 256
        CONTROL SHOW STATE DlgHndl, %LblRange, %SW_SHOW
        CONTROL SET LOC DlgHndl, %PageRange, W - 125, 270
        CONTROL SHOW STATE DlgHndl, %PageRange, %SW_SHOW
        CONTROL SET LOC DlgHndl, %PrintPDF, W - 126, 290
        CONTROL SHOW STATE DlgHndl, %PrintPDF, %SW_SHOW
        CONTROL SET LOC DlgHndl, %PrintSetup, W - 46, 290
        CONTROL SHOW STATE DlgHndl, %PrintSetup, %SW_SHOW
    ' info group
        CONTROL SET LOC DlgHndl, %LblDocInfo, W - 130, 385
        CONTROL SHOW STATE DlgHndl, %LblDocInfo, %SW_SHOW
        CONTROL SET LOC DlgHndl, %StateLog, W - 130, 400
        CONTROL SHOW STATE DlgHndl, %StateLog, %SW_SHOW
    
        IF DocId THEN
            DIALOG GET USER DlgHndl, 1 TO R
            R = RenderToCanvas( DlgHndl, "Zoom", R )
        END IF
    
    ' canvas visual quue, not required
        CONTROL KILL DlgHndl, 2000
    
        S = 0
    
    END IF
    
    ' canvas visual quue, not required
        CONTROL SET SIZE DlgHndl, 2000, W - 136, H - 6
        CONTROL SET TEXT DlgHndl, 2000, STR$( W - 136 ) + " -" + STR$( H - 6 ) + " "
    ' file group
        CONTROL SET LOC  DlgHndl, %FileGroup, W - 130, 5
    ' zoom group
        CONTROL SET LOC  DlgHndl, %ZoomGroup, W - 130, 105
    ' page group
        CONTROL SET LOC  DlgHndl, %PageGroup, W - 130, 165
    ' print group
        CONTROL SET LOC  DlgHndl, %PrintGroup, W - 130, 225
    
    IF ( V = 0) AND ( S = 0 ) THEN
        GRAPHIC DETACH
        CONTROL KILL DlgHndl, %PDFCanvas
    ' file group
        CONTROL SHOW STATE DlgHndl, %LoadPDF, %SW_HIDE
        CONTROL SHOW STATE DlgHndl, %LblCurrent, %SW_HIDE
        CONTROL SHOW STATE DlgHndl, %CurrentDoc, %SW_HIDE
    ' zoom group
        CONTROL SHOW STATE DlgHndl, %ZoomVal, %SW_HIDE
        CONTROL SHOW STATE DlgHndl, %Zoom_O, %SW_HIDE
        CONTROL SHOW STATE DlgHndl, %Zoom_I, %SW_HIDE
    ' page group
        CONTROL SHOW STATE DlgHndl, %PageNum, %SW_HIDE
        CONTROL SHOW STATE DlgHndl, %P_Page, %SW_HIDE
        CONTROL SHOW STATE DlgHndl, %N_Page, %SW_HIDE
    ' print group
        CONTROL SHOW STATE DlgHndl, %PrintAll, %SW_HIDE
        CONTROL SHOW STATE DlgHndl, %PrintOdd, %SW_HIDE
        CONTROL SHOW STATE DlgHndl, %PrintEven, %SW_HIDE
        CONTROL SHOW STATE DlgHndl, %LblRange, %SW_HIDE
        CONTROL SHOW STATE DlgHndl, %PageRange, %SW_HIDE
        CONTROL SHOW STATE DlgHndl, %PrintPDF, %SW_HIDE
        CONTROL SHOW STATE DlgHndl, %PrintSetup, %SW_HIDE
    ' info group
        CONTROL SHOW STATE DlgHndl, %LblDocInfo, %SW_HIDE
        CONTROL SHOW STATE DlgHndl, %StateLog, %SW_HIDE
    
    ' canvas visual quue, not required
        CONTROL ADD FRAME, DlgHndl, 2000, "X - Y", 3, 3, W - 136, H - 6, %BS_RIGHT, 0
    
        S = 1
    
    END IF
    
    FUNCTION = 1
    
    END FUNCTION ' MoveControls
    
    FUNCTION RenderToCanvas( Hndl AS LONG, MODE AS STRING, X AS LONG ) AS LONG
    LOCAL CanvasDC      AS DWORD
    LOCAL PageCnt       AS LONG
    LOCAL PageNum       AS LONG
    LOCAL Result        AS LONG
    STATIC DPI          AS LONG
    
    PageCnt = oQuickPDF.PageCount( )
    PageNum = oQuickPDF.SelectedPage( )
    
        SELECT CASE MODE
            CASE "Zoom"
                SELECT CASE X
                    CASE 0 ' zoom in
                        IF DPI < 108 THEN
                            DPI + = 6
                            Result = 1
                        END IF
    
                    CASE -1 ' Zoom out
                      IF DPI > 36 THEN
                        DPI - = 6
                        Result = 1
                      END IF
    
                    CASE > 0 ' reset zoom to X
                        IF ( X >= 36 ) AND ( X <= 108 ) THEN
                            DPI = X
                            Result = 1
                        END IF
    
                END SELECT
    
            CASE "Page"
                SELECT CASE X
                    CASE 0 ' next page
                        IF PageNum < PageCnt THEN
                            INCR PageNum
                            Result = 1
                        END IF
    
                    CASE -1 ' previous page
                        IF PageNum > 1 THEN
                            DECR PageNum
                            Result = 1
                        END IF
    
                    CASE > 0 ' reset page to X
                        IF ( X >= 1 ) AND ( X <= PageCnt ) THEN
                            PageNum = X
                            Result = 1
                        END IF
    
                END SELECT
    
        END SELECT
    
        IF Result = 1 THEN
            GRAPHIC GET DC TO CanvasDC
            GRAPHIC CLEAR
            Result = oQuickPDF.RenderPageToDC( DPI, PageNum, CanvasDC )
            Result = oQuickPDF.SelectPage( PageNum )
            GRAPHIC REDRAW
            CONTROL SET TEXT Hndl, %PageNum, STR$( PageNum )
            CONTROL SET TEXT Hndl, %ZoomVal, STR$( DPI )
            CONTROL SET TEXT Hndl, %PageRange, STR$( PageNum ) + "-" + STR$( PageNum )
            DIALOG SET USER Hndl, 1, DPI
    
        END IF
    
        FUNCTION = Result
    
    END FUNCTION ' RenderToCanvas
    
    FUNCTION GetDocumentInfo( ) AS STRING
    LOCAL Info  AS STRING
    LOCAL txt   AS STRING
    
        Info = "PDF File:" + $CRLF
        Info + = "  Version = " + ACODE$(oQuickPDF.GetInformation( 0 )) + $CRLF
    '   Info + = "  Author = " + oQuickPDF.GetInformation( 1 ) + $CRLF
    'txt = oQuickPDF.GetInformation( 5 )
    'info + = "  Creator = " + STR$( oQuickPDF.StringResultLength( ) ) + $CRLF
    '   Info + = "  Creator = " + oQuickPDF.GetInformation( 5 ) + $CRLF
    '   Info + = "  Producer = " + oQuickPDF.GetInformation( 6 ) + $CRLF
        Info + = $CRLF + "Page:" + $CRLF
        Info + = "  Count = " + STR$( oQuickPDF.PageCount( ) ) + $CRLF
        Info + = "  Width = " + STR$( oQuickPDF.PageWidth( ) ) + $CRLF
        Info + = "  Height = " + STR$( oQuickPDF.PageHeight( ) ) + $CRLF
        Info + = $CRLF + "Printer:" + $CRLF              ' Add by Hans Rietveld
        Info + = "  " + PrintSel + $CRLF
    
        FUNCTION = Info
    
    END FUNCTION ' GetDocumentInfo
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ' end of active code
    '
    The iSED712.inc file is included in this posting, in case you have trouble to build this file the first time.

    I think you will find it easy to use and I like to hear about your experience.

    Don't forget to insert your licensekey and use the final 7.12 release.
    You don't have to remove the library version or the dll-library, they don't
    disturb each other.
    Attached Files
    sigpic
    Regards,
    Hans Rietveld.

    Comment


    • #22
      Hello Marc.

      If you have not read it.
      I think you can find here some information about scrolling graphic windows.


      http://www.powerbasic.com/support/pb...ad.php?t=40223
      sigpic
      Regards,
      Hans Rietveld.

      Comment


      • #23
        I need a very simple PDF Viewer with basic functions, small and portable.
        No need to choose the file to view; the program is called via shell passing the name of the file as a command line parameter.

        I started from the code already available in this topic and modified it according my needings.

        I've various versions of QuickPDFLibrary/DebenuPdfLibrary.
        Program works fine with version 7.19 and 8.13, but not with 9.16, 10.12 and 11.15.

        In the recent version there is a strange behaviour when zooming (both by buttons or keyboard (keys + and -).
        If zoom decrease, the area covered by previous render is reduced.
        If zoom increase, the area covered by previous render is not increased, so part of the PDF page is truncated.

        I cannot understand the reason ...
        Someone can help? (Thanks!).
        Please, note that the source can be compiled, but to use it unlock key for QuickPDFLibrary is necessary, so only who have bought the library can test the program.

        To use different version of the library it's necessary to modify the equates at the beginning, leaving only one uncommented.
        The include r_pdf_50.inc contains macro definitions to use the old functions names in recent versions.

        Thank you!


        Code:
              #compiler pbwin
              #dim all
              #include "win32api.inc"
        
             '%QuickPdf0719=1
              %QuickPdf0813=1
             '%QuickPdf0916=1
             '%QuickPdf1012=1
             '%QuickPdf1115=1
              #if %def(%QuickPdf0719)
                 #include "c:\routines.pb\QuickPDFDLL0719.inc"
                 $UnlockKey="xxxxxxxxxxxxxxxxxxxxxxxxx"
              #elseif %def(%QuickPdf0813)
                 #include "QuickPDFDLL0813_PB10.inc"
                 $UnlockKey="xxxxxxxxxxxxxxxxxxxxxxxxx"
              #elseif %def(%QuickPdf0916)
                 #include "DebenuPDFLibraryDLL0916_PB10.inc"
                 $UnlockKey="xxxxxxxxxxxxxxxxxxxxxxxxx"
                 #include "r_pdf_50.inc"
              #elseif %def(%QuickPdf1012)
                 #include "DebenuPDFLibraryDLL1012_PB10.inc"
                 $UnlockKey="xxxxxxxxxxxxxxxxxxxxxxxxx"
                 #include "r_pdf_50.inc"
              #elseif %def(%QuickPdf1115)
                 #include "DebenuPDFLibraryDLL1115_PB10.inc"
                 $UnlockKey="xxxxxxxxxxxxxxxxxxxxxxxxx"
                 #include "r_pdf_50.inc"
              #endif
        
              %PDFCanvas=1000
              %ZoomGroup=1011
              %ZoomI=1012
              %ZoomO=1013
              %ZoomVal=1014
              %PageGroup=1021
              %NPage=1022
              %PPage=1023
              %PageNum=1024
              %PrintGroup=1031
              %PrintAll=1032
              %PrintPage=1033
              %PrintPDF=1034
              %Zoom=1041
              %Page=1042
              %pgup=1051
              %pgdn=1052
              %zoomup=1061
              %zoomdn=1062
              %scrollup=1071
              %scrolldn=1072
              %scrollsx=1073
              %scrolldx=1074
        
              global LibInstance as long
        
        function PBMAIN() as long
              local filepdf as string
              local DocId as long
              local hDlg as long
              local Result as long
              local ermsg as string
              local W as long ' dialog client area width
              local H as long ' dialog client area height
              local x as long
              local y as long
              local xx as double
              local yy as double
        
              filepdf$=trim$(command$)
        
              ermsg$=""
              if filepdf$="" then
                 ermsg$="Sintassi: pdfview <file>"
              end if
              if ermsg$="" then
                 if isfile(filepdf$)=0 then
                    ermsg$=filepdf$+" non trovato"
                 end if
              end if
              if ermsg$="" then
                 LibInstance&=QuickPDFCreateLibrary()
                 if LibInstance&=0& then
                    ermsg$="Inizializzazione libreria QuickPdf non riuscita"
                 end if
              end if
              if ermsg$="" then
                 if QuickPDFUnlockKey(LibInstance&,$UnlockKey+$nul)=0& then
                    ermsg$="Unlock libreria QuickPdf non riuscito"
                 end if
              end if
              if ermsg$="" then
                 if QuickPDFSetTempPath(LibInstance&,EXE.Path$+$nul)=0& or QuickPDFSetTempFile(LibInstance&,EXE.Path$+"\QPDFTemp.dat"+$nul)=0& then
                    ermsg$="Set path/file temp non riuscito"
                 end if
              end if
              if ermsg$="" then
                 #if %def(%QuickPdf0719)
                    if QuickPDFLoadFromFile(LibInstance&,filepdf$+$nul)=0& then
                       ermsg$="Apertura documento non riuscita"
                    end if
                 #else
                    if QuickPDFLoadFromFile(LibInstance&,filepdf$+$nul,$nul)=0& then
                       ermsg$="Apertura documento non riuscita"
                    end if
                 #endif
              end if
              if ermsg$="" then
                 DocId&=QuickPDFSelectedDocument(LibInstance&)
                 if DocId&=0& then
                    ermsg$="Inizializzazione documento non riuscita"
                 end if
              end if
              if ermsg$<>"" then
                 if QuickPDFPageCount(LibInstance&)=0 or QuickPDFSelectedPage(LibInstance&)=0& then
                    ermsg$="Elaborazione documento non riuscita"
                 end if
              end if
              if ermsg$<>"" then
                 msgbox ermsg$,%MB_ICONERROR,"PdfViewer - Errore"
              else
                 desktop get size to x&,y&
                 xx#=x&
                 xx#=xx#*.50#+136#
                 yy#=xx#*.90#
                 x&=xx#
                 y&=yy#
                 dialog new pixels,0,"PdfViewer - "+filepdf$,10,10,x&,y&,%ws_caption or %ws_minimizebox or %ws_sysmenu,0 to hDlg&
                 dialog get client hDlg& to W&,H&
                 dialog set color hDlg&,&hE0E0E0,&h646464
        
                 control add frame,hDlg&,%ZoomGroup,"Zoom",w&-130,15,128,50,0,0
                 control add label,hDlg&,%ZoomVal,"0000",W&-85,38,36,15,%SS_CENTER,0
                 control add button,hDlg&,%ZoomO,"<<",W&-126,30,40,30,0,0,call OnEvent_Zoom()
                 control add button,hDlg&,%ZoomI,">>",W&-46,30,40,30,0,0,call OnEvent_Zoom()
        
                 control add frame,hDlg&,%PageGroup,"Pagina",W&-130,75,128,50,0,0
                 control add label,hDlg&,%PageNum,"0000",W&-85,98,36,15,%SS_CENTER,0
                 control add button,hDlg&,%PPage,"<<",W&-126,90,40,30,0,0,call OnEvent_Page()
                 control add button,hDlg&,%NPage,">>",W&-46,90,40,30,0,0,call OnEvent_Page()
        
                 control add frame,hDlg&,%PrintGroup,"Stampa",W&-130,135,128,100,0,0
                 control add option,hDlg&,%PrintAll,"Tutto",W&-126,160,70,15,0,0,call OnEvent_Print()
                 control add option,hDlg&,%PrintPage,"Pagina",W&-126,180,70,15,0,0,call OnEvent_Print()
                 control add button,hDlg&,%PrintPDF,"Stampa",W&-126,200,80,30,0,0,call OnEvent_Print()
                 control set option hDlg&,%PrintPage,%PrintAll,%PrintPage
        
                 control set color hDlg&,%ZoomGroup,&hFFFFFF,&h646464
                 control set color hDlg&,%ZoomVal,&hFFFFFF,&h646464
                 control set color hDlg&,%ZoomO,&hFFFFFF,&h646464
                 control set color hDlg&,%ZoomI,&hFFFFFF,&h646464
                 control set color hDlg&,%PageGroup,&hFFFFFF,&h646464
                 control set color hDlg&,%PageNum,&hFFFFFF,&h646464
                 control set color hDlg&,%PPage,&hFFFFFF,&h646464
                 control set color hDlg&,%NPage,&hFFFFFF,&h646464
                 control set color hDlg&,%PrintGroup,&hFFFFFF,&h646464
                 control set color hDlg&,%PrintAll,&hFFFFFF,&h646464
                 control set color hDlg&,%PrintPage,&hFFFFFF,&h646464
                 control set color hDlg&,%PrintPDF,&hFFFFFF,&h646464
        
                 control add graphic,hDlg&,%PDFCanvas,"",3,3,W&-136,H&-6,%WS_CHILD OR %WS_VISIBLE OR %SS_OWNERDRAW OR %WS_BORDER,0
                 graphic attach hDlg&,%PDFCanvas,redraw
                 graphic set virtual (w&-136&)*2&,(h&-6&)*2&
                 graphic color &hE0E0E0,&h646464
        
                 dialog show modal hDlg&,call OnEvent_MainDlg
              end if
              if DocId& then
                 Result&=QuickPDFRemoveDocument(LibInstance&,DocId&)
              end if
              if LibInstance& then
                 Result&=QuickPDFReleaseLibrary(LibInstance&)
              end if
        end function
        
        callback function OnEvent_MainDlg() as long
              local gw as single
              local gh as single
              local ac() as accelapi
              local hAccelHandle as dword
        
              select case as long cb.msg
                 case %WM_INITDIALOG
                    redim ac(0 to 7)
                    ac(0).fvirt=%fvirtkey
                    ac(0).key=%vk_pgdn
                    ac(0).cmd=%pgdn
                    ac(1).fvirt=%fvirtkey
                    ac(1).key=%vk_pgup
                    ac(1).cmd=%pgup
                    ac(2).fvirt=0
                    ac(2).key=asc("-")
                    ac(2).cmd=%zoomdn
                    ac(3).fvirt=0
                    ac(3).key=asc("+")
                    ac(3).cmd=%zoomup
                    ac(4).fvirt=%fvirtkey
                    ac(4).key=%vk_up
                    ac(4).cmd=%scrollup
                    ac(5).fvirt=%fvirtkey
                    ac(5).key=%vk_down
                    ac(5).cmd=%scrolldn
                    ac(6).fvirt=%fvirtkey
                    ac(6).key=%vk_left
                    ac(6).cmd=%scrollsx
                    ac(7).fvirt=%fvirtkey
                    ac(7).key=%vk_right
                    ac(7).cmd=%scrolldx
                    accel attach cb.hndl,ac() to hAccelHandle
        
                    RenderToCanvas(cb.hndl,%Zoom,100)
                    function=1
                 case %WM_COMMAND
                    select case cb.ctl
                       case %pgup
                          RenderToCanvas(cb.hndl,%Page,-1)
                          function=1
                       case %pgdn
                          RenderToCanvas(cb.hndl,%Page,0)
                          function=1
                       case %zoomup
                          RenderToCanvas(cb.hndl,%Zoom,0)
                          function=1
                       case %zoomdn
                          RenderToCanvas(cb.hndl,%Zoom,-1)
                          function=1
                       case %scrollup
                          graphic get view to gw!,gh!
                          if gh!>100! then
                             gh!-=100!
                             graphic set view gw!,gh!
                          else
                             gh!=0!
                             graphic set view gw!,gh!
                          end if
                          function=1
                       case %scrolldn
                          graphic get view to gw!,gh!
                          gh!+=100!
                          graphic set view gw!,gh!
                          function=1
                       case %scrollsx
                          graphic get view to gw!,gh!
                          if gw!>100! then
                             gw!-=100!
                             graphic set view gw!,gh!
                          else
                             gw!=0!
                             graphic set view gw!,gh!
                          end if
                          function=1
                       case %scrolldx
                          graphic get view to gw!,gh!
                          gw!+=100!
                          graphic set view gw!,gh!
                          function=1
                    end select
              end select
        end function
        
        callback function OnEvent_Zoom() as long
              if cb.msg=%WM_COMMAND and cb.ctlmsg=%BN_CLICKED then
                 select case cb.ctl
                    case %ZoomI
                       RenderToCanvas(cb.hndl,%Zoom,0)
                    case %ZoomO
                       RenderToCanvas(cb.hndl,%Zoom,-1)
                 end select
                 function=1
              end if
        end function
        
        callback function OnEvent_Page() as long
              if cb.msg=%WM_COMMAND and cb.ctlmsg=%BN_CLICKED then
                 select case cb.ctl
                    case %NPage
                       RenderToCanvas(cb.hndl,%Page,0)
                    case %PPage
                       RenderToCanvas(cb.hndl,%Page,-1)
                 end select
                 function=1
              end if
        end function
        
        callback function OnEvent_Print() as long
              local Result as long
              local SP as long ' start page number
              local EP as long ' end page number
              local PR as long ' range of pages to print
        
              if cb.msg=%WM_COMMAND and cb.ctlmsg=%BN_CLICKED then
                 select case cb.ctl
                    case %PrintPDF
                       control get check cb.hndl,%PrintAll to PR&
                       if PR&=1& then
                          SP&=1&
                          EP&=QuickPDFPageCount(LibInstance&)
                       else
                          SP&=QuickPDFSelectedPage(LibInstance&)
                          EP&=SP&
                       end if
                       errclear
                       xprint attach choose using %PD_ALLPAGES or %PD_NOSELECTION or %PD_NOPAGENUMS or %PD_DISABLEPRINTTOFILE or %PD_HIDEPRINTTOFILE ' default
                       if xprint$<>"" and err=0 then
                          Result&=QuickPDFPrintDocument(LibInstance&,xprint$+$nul,sp&,ep&,0)
                       end if
                       xprint close
                 end select
                 function=1
              end if
        end function
        
        sub RenderToCanvas(byval hDlg as long,byval Mode as long,byval X as long)
              local CanvasDC as dword
              local PageCnt as long
              local PageNum as long
              local Result as long
              #if %def(%QuickPdf0719)
                 static DPI as long
              #elseif %def(%QuickPdf0813)
                 static DPI as long
              #else
                 static DPI as double
              #endif
        
              PageCnt&=QuickPDFPageCount(LibInstance&)
              PageNum&=QuickPDFSelectedPage(LibInstance&)
        
              select case Mode&
                 case %Zoom
                    select case X&
                       case 0 ' zoom in
                          if DPI<200 then
                             DPI+=10
                             Result&=1&
                          end if
                       case -1 ' Zoom out
                          if DPI>50 then
                             DPI-=10
                             Result&=1&
                          end if
                       case>0 ' reset zoom to X&
                          if X&>=50& and X&<=200& then
                             DPI=X&
                             Result&=1&
                          end if
                    end select
                 case %Page
                    select case X&
                       case 0 ' next page
                          if PageNum&<PageCnt& then
                             incr PageNum&
                             Result&=1
                          end if
                       case -1 ' previous page
                          if PageNum&>1 then
                             decr PageNum&
                             Result&=1
                          end if
                       case>0 ' reset page to X&
                          if X&>=1 and X&<=PageCnt& then
                             PageNum&=X&
                             Result&=1
                          end if
                    end select
              end select
              if Result&=1 then
                 graphic get dc to CanvasDC
                 graphic clear
                 Result&=QuickPDFRenderPageToDC(LibInstance&,DPI,PageNum&,CanvasDC)
                 Result&=QuickPDFSelectPage(LibInstance&,PageNum&)
                 graphic redraw
                 control set text hDlg&,%PageNum,str$(PageNum&)
                 control set text hDlg&,%ZoomVal,str$(DPI)
              end if
        end sub
        r_pdf_50.inc

        Code:
              macro QuickPDFAddArcToPath          = DPLAddArcToPath
              macro QuickPDFAddImageFromFile      = DPLAddImageFromFile
              macro QuickPDFAddLineToPath         = DPLAddLineToPath
              macro QuickPDFAddStandardFont       = DPLAddStandardFont
              macro QuickPDFClosePath             = DPLClosePath
              macro QuickPDFCreateLibrary         = DPLCreateLibrary
              macro QuickPDFDrawArc               = DPLDrawArc
              macro QuickPDFDrawBarcode           = DPLDrawBarcode
              macro QuickPDFDrawBox               = DPLDrawBox
              macro QuickPDFDrawEllipse           = DPLDrawEllipse
              macro QuickPDFDrawHtmlTextBox       = DPLDrawHtmlTextBox
              macro QuickPDFDrawLine              = DPLDrawLine
              macro QuickPDFDrawPath              = DPLDrawPath
              macro QuickPDFDrawRoundedBox        = DPLDrawRoundedBox
              macro QuickPDFDrawTextBox           = DPLDrawTextBox
              macro QuickPDFFitTextBox            = DPLFitTextBox
              macro QuickPDFDrawWrappedText       = DPLDrawWrappedText
              macro QuickPDFFitImage              = DPLFitImage
              macro QuickPDFGetPrinterNames       = DPLGetPrinterNames
              macro QuickPDFGetTextBound          = DPLGetTextBound
              macro QuickPDFGetWrappedText        = DPLGetWrappedText
              macro QuickPDFGetWrappedTextHeight  = DPLGetWrappedTextHeight
              macro QuickPDFImageHeight           = DPLImageHeight
              macro QuickPDFImageWidth            = DPLImageWidth
              macro QuickPDFNewCustomPrinter      = DPLNewCustomPrinter
              macro QuickPDFNewDocument           = DPLNewDocument
              macro QuickPDFNewPage               = DPLNewPage
              macro QuickPDFPageCount             = DPLPageCount
              macro QuickPDFPageHeight            = DPLPageHeight
              macro QuickPDFPageWidth             = DPLPageWidth
              macro QuickPDFPrintDocument         = DPLPrintDocument
              macro QuickPDFPrintOptions          = DPLPrintOptions
              macro QuickPDFReleaseLibrary        = DPLReleaseLibrary
              macro QuickPDFReplaceTag            = DPLReplaceTag
              macro QuickPDFLoadFromFile          = DPLLoadFromFile
              macro QuickPDFSaveToFile            = DPLSaveToFile
              macro QuickPDFSelectFont            = DPLSelectFont
              macro QuickPDFSelectImage           = DPLSelectImage
              macro QuickPDFSelectPage            = DPLSelectPage
              macro QuickPDFSetInformation        = DPLSetInformation
              macro QuickPDFSetLineWidth          = DPLSetLineWidth
              macro QuickPDFSetMeasurementUnits   = DPLSetMeasurementUnits
              macro QuickPDFSetOrigin             = DPLSetOrigin
              macro QuickPDFSetPageMode           = DPLSetPageMode
              macro QuickPDFSetPageSize           = DPLSetPageSize
              macro QuickPDFSetTempFile           = DPLSetTempFile
              macro QuickPDFSetTempPath           = DPLSetTempPath
              macro QuickPDFSetTextAlign          = DPLSetTextAlign
              macro QuickPDFSetTextScaling        = DPLSetTextScaling
              macro QuickPDFSetTextSize           = DPLSetTextSize
              macro QuickPDFSetTextUnderline      = DPLSetTextUnderline
              macro QuickPDFSetupCustomPrinter    = DPLSetupCustomPrinter
              macro QuickPDFSetViewerPreferences  = DPLSetViewerPreferences
              macro QuickPDFStartPath             = DPLStartPath
              macro QuickPDFUnlockKey             = DPLUnlockKey
        
              macro QuickPDFSetFillColor          = DPLSetFillColor
              macro QuickPDFSetTextColor          = DPLSetTextColor
              macro QuickPDFSetLineColor          = DPLSetLineColor
              macro QuickPDFSetFillShader         = DPLSetFillShader
              macro QuickPDFNewRGBAxialShader     = DPLNewRGBAxialShader
              macro QuickPDFSetPageDimensions     = DPLSetPageDimensions
              macro QuickPDFSetHTMLNormalFont     = DPLSetHTMLNormalFont
              macro QuickPDFSetHTMLBoldFont       = DPLSetHTMLBoldFont
              macro QuickPDFSetHTMLBoldItalicFont = DPLSetHTMLBoldItalicFont
              macro QuickPDFSetHTMLItalicFont     = DPLSetHTMLItalicFont
              macro QuickPDFGetTextWidth          = DPLGetTextWidth
              macro QuickPDFDrawHtmlText          = DPLDrawHtmlText
              macro QuickPDFAddTrueTypeSubsettedFont = DPLAddTrueTypeSubsettedFont
              macro QuickPDFSelectedDocument      = DPLSelectedDocument
              macro QuickPDFSelectDocument        = DPLSelectDocument
              macro QuickPDFMergeDocument         = DPLMergeDocument
              macro QuickPDFCapturePage           = DPLCapturePage
              macro QuickPDFInsertPages           = DPLInsertPages
              macro QuickPDFGetPageBox            = DPLGetPageBox
              macro QuickPDFDrawCapturedPage      = DPLDrawCapturedPage
              macro QuickPDFSetPDFAMode           = DPLSetPDFAMode
              macro QuickPDFClearFileList         = DPLClearFileList
              macro QuickPDFAddToFileList         = DPLAddToFileList
              macro QuickPDFMergeFileListFast     = DPLMergeFileListFast
              macro QuickPDFMovePage              = DPLMovePage
              macro QuickPDFGetHtmlTextHeight     = DPLGetHtmlTextHeight
              macro QuickPDFEncryptionStatus      = DPLEncryptionStatus
              macro QuickPDFDecrypt               = DPLDecrypt
              macro QuickPDFGetImagePageCount     = DPLGetImagePageCount
              macro QuickPDFEncodePermissions     = DPLEncodePermissions
              macro QuickPDFEncrypt               = DPLEncrypt
              macro QuickPDFExtractFilePageText   = DPLExtractFilePageText
              macro QuickPDFGetPageText           = DPLGetPageText
              macro QuickPDFRenderPageToFile      = DPLRenderPageToFile
              macro QuickPDFFitRotatedTextBox     = DPLFitRotatedTextBox
              macro QuickPDFSelectedPage          = DPLSelectedPage
              macro QuickPDFRemoveDocument        = DPLRemoveDocument
              macro QuickPDFRenderPageToDC        = DPLRenderPageToDC
              macro QuickPDFSetRenderDCErasePage  = DPLSetRenderDCErasePage

        Comment


        • #24
          Problem solved.
          I saw that from version 11 is available a renderer by Debenu, alternative to GDI+.
          Using it there is no problem and the result is even better.

          Comment


          • #25
            I no longer need a pdf viewer.
            Associate pdf files to Chrome browser and many features with no installation.
            Users can click, move, delete files or a program can shell.
            I like the Chrome viewer better than anything that I have used including Foxit.

            Comment


            • #26
              Originally posted by Mike Doty View Post
              I no longer need a pdf viewer.
              Associate pdf files to Chrome browser and many features with no installation.
              Users can click, move, delete files or a program can shell.
              These day you can associate PDFs with any of the main browsers.

              Comment


              • #27
                Sure, but it's not always that simple.
                In general, I've no control on the PCs where my programs run; I don't know which browser they use, which is the default PDF viewer, which is the OS version etc.
                I don't like having to rely on specific configurations

                However, in this specific case I have reasons to use a PDF viewer that is as simple as possible, without many menus and options etc.

                Comment

                Working...
                X