Announcement

Collapse
No announcement yet.

DDT-PB9 PDF View, a viewer for PDF files

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

  • DDT-PB9 PDF View, a viewer for PDF files

    New topic for comments regarding the PDF View topic in the source code forum:

    http://www.powerbasic.com/support/pb...765#post311765
    Regards,
    Marc

  • #2
    Hi Marc,

    your program worked well for 99% of PDFs I have tried.

    But there seems to be problem with some PDFs exported from MS Word 2007.

    I attach it here for you so you can see where problem occurs.


    Thank you,
    Petr
    Attached Files
    [email protected]

    Comment


    • #3
      Hi Petr,

      Thanks for testing, nasty troublemaker you got there. The file loads fine, a document id is assigned correctly but the page selection function fails.

      The library doesn't appear to like this document, I don't know if it's relevant but the document uses PDF version 1.5, I'll investigate some more.
      Regards,
      Marc

      Comment


      • #4
        Hi Marc.

        Maybe it will help you,
        hereby a few lines of code to add a print option.

        A simple way to print the current page on the default printer.
        Code:
        CONTROL ADD BUTTON, MainHndl&, %Print, "Print", 878, 230, 120, 30, 0, 0, CALL OnEvent_Print( )          
        
        ' Add a new button to the main dialog
        
        CALLBACK FUNCTION OnEvent_Print() AS LONG
        LOCAL PageNum       AS LONG
        
           IF  CB.MSG = %WM_COMMAND AND    CB.CTL = %Print AND CB.CTLMSG = %BN_CLICKED THEN
        
                PageNum& = QuickPDFSelectedPage( LibInstance& )
        
                IF PageNum& > 0 THEN
                   XPRINT ATTACH DEFAULT
                   ' get the default printer
                   QuickPDFPrintDocument(LibInstance&, XPRINT$ & $NUL, PageNum&, PageNum& + 1, 0)
                   ' Print one page on the default printer
                   XPRINT CLOSE
                   FUNCTION = 1
                END IF
           END IF
        
        END FUNCTION ' OnEvent_Print
        Just add it somewhere to your code.
        If you want to expand it, you can add a printer dialog and select more
        then one page.

        So far it is a nice program, thanks for it.
        sigpic
        Regards,
        Hans Rietveld.

        Comment


        • #5
          Marc, I got GPFs when trying it on WinME as well as Vista. I have the 2 computers on a home network and the program comes up initially but after using the load to enter a pdf file name (including the one you have in the zip file) it gets a GPF on ME and the 'This program has stopped working...' on Vista. Using PBwin 9.01. On ME it doesn't come up at all but I that's not a big problem (that is, i get the GPF right away before any GUI).
          Last edited by Fred Buffington; 17 Mar 2009, 06:50 AM.
          Client Writeup for the CPA

          buffs.proboards2.com

          Links Page

          Comment


          • #6
            Hi Hans,

            Thanks for the print routine, wow, you even include a button with coordinates! I’ll add it in and see how it goes from there.

            I appreciate your contribution.
            Regards,
            Marc

            Comment


            • #7
              Hi Fred,

              WinME is completely off my radar and I won’t be much help since I only have access to XP and Vista. One thing I mentioned in my original demos but forgot to mention in the PDF View demo is that Quick PDF uses GDI +. It’s included with XP and Vista but may not be with ME, if not, it should be added to the same folder as the demo… just a shot in the dark.

              I’ve tested the code with the included sample PDF file and a few others, on VIST Business (SP1) without any problems. My Vista system is nothing special, it’s a Dell Inspiron I6400 laptop, Intel Core Duo, 1.87Ghz T2350 with 2GB RAM.

              One thing I thought might be problematic with Vista, depending on how you’re logged on, is that the application writes to the folder in which it’s located. However, I would not expect this to produce a GPF, just annoying warnings. Nevertheless, I’ll keep digging.

              Some questions regarding your Vista test:
              -Are you running the EXE or compiling your own?
              -Was the included sample PDF file the “first” one you tried? Or did you try it “after” a GPF with another file?

              The sequence of events that produces a GPF on Vista is as follows:
              -The program loads and runs fine.
              -When you click load PDF, the file dialog shows.
              -When you select a file and click open, you get a GPF.
              -You never see the PDF or the document description.

              Error checking is non existent in the current demo but I am working on an update that’ll include some error checking, it may help locate the problem

              Thanks for testing and reporting this new “feature”.
              Regards,
              Marc

              Comment


              • #8
                Fred, Marc.

                Have you thought about inserting the license code in the source.

                I have insert a wrong code and got a GPF.

                Maybe it is just so simple.

                Succes
                sigpic
                Regards,
                Hans Rietveld.

                Comment


                • #9
                  Fred, Marc.

                  I respond to fast.

                  I run the program with VirtualMachine in W98 and ME and in both cases I got
                  a GPF error.
                  They point to the QuickPDF.DLL. It is possible that the DLL only runs
                  with XP or better.
                  sigpic
                  Regards,
                  Hans Rietveld.

                  Comment


                  • #10
                    Hi Hans,

                    Yep, that’s why I asked whether Fred was using the EXE or compiling. If you compile and don’t add the unlock key the program will crash because there’s not error checking. The trial key is included in the 7.12 beta 2 download but I didn’t want to provide it separately unless I got the nod from Quick PDF. Anyway, I’ll be adding error checking for this in the next update.

                    I don’t know if it needs XP or better but, I think it only handles PDF versions up to 1.4. I am putting all these questions to Rowan later tonight.

                    Thanks for following up.
                    Regards,
                    Marc

                    Comment


                    • #11
                      I compiled it on both machines winme and vista. Not concerned with it not working on ME just thought id bring it up.

                      I did try another pdf before trying the test_report.pdf (I think that is what you called the test file).

                      In vista, once you select a file i get pdfview has stopped working. A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.

                      Of course it never notifies me. The dll is in the same folder as pdfview. I dont know about GDI+
                      Client Writeup for the CPA

                      buffs.proboards2.com

                      Links Page

                      Comment


                      • #12
                        well i unzipped the exe from the zip file and it works fine on Vista. Why would it give me an error when i compiled it with 9.01 ? must have to do with the key you spoke of.
                        Last edited by Fred Buffington; 19 Mar 2009, 05:55 AM.
                        Client Writeup for the CPA

                        buffs.proboards2.com

                        Links Page

                        Comment


                        • #13
                          Hi Fred.
                          must have to do with the key you spoke of
                          Add your valid licensekey here.

                          Code:
                          [COLOR="Silver"]LibInstance& = QuickPDFCreateLibrary( )[/COLOR]
                          Result& = QuickPDFUnlockKey( LibInstance&, "[COLOR="Red"]Insert your licensekey here[/COLOR]" )
                          [COLOR="silver"]AppPath$ = EXE.PATH$[/COLOR]
                          Add this line to your code to check the license key.

                          Code:
                          [COLOR="Gray"]Caption$ += ", Beta 2     (" + QuickPDFLicenseInfo( LibInstance& ) + ")"[/COLOR]            
                          [COLOR="Green"]IF QuickPDFUnlockEd( LibInstance&) = 0 THEN MSGBOX "Wrong Licensekey !"[/COLOR]            
                          [COLOR="gray"]DIALOG SET TEXT CB.HNDL, Caption$[/COLOR]
                          Today there is a new final release of QuickPDF version 7.12 available.
                          The DLL - library and the PBasic include file seems to be ok now.
                          sigpic
                          Regards,
                          Hans Rietveld.

                          Comment


                          • #14
                            Code update notice

                            Hi,

                            Just update the PDF View code on the source code forum:

                            http://www.powerbasic.com/support/pb...ad.php?t=40139

                            Code and comments welcome
                            Regards,
                            Marc

                            Comment


                            • #15
                              Hello,

                              thanks for the souce, I am learning!!!

                              @Hans.

                              I am using the dll version and I would like to continue doing so. I am not going to get in an endless discussion about pure dll <> ocx but I think there are a lot of PB users who prefere pure dll's. I hope support will not end for this, this is one of the main reasons I payed money for QuickPDF.

                              Marc
                              Regards,
                              Marc

                              Comment


                              • #16
                                Hi Marc,

                                Welcome to the class I hope you find the code useful. Future support for the library and, the DLL version in particular, was also my main concern but Rowan, one of the new owners, assured me development and support for the DLL library will continue. In my opinion the new owners are a serious outfit with their feet firmly planted on the ground and fully committed to the success of the library.

                                Rowan, in particular, has been very supportive and always willing to help. I’ve had no contact with the other partner but from reading discussions on another forum it appears he’s just as committed.

                                Nevertheless, I must admit Hans has stirred my curiosity to explore the new PowerBASIC COM but, I am a bit late joining the CLASS!

                                Disclaimer: I am in no way affiliated with Quick PDF… what’s the conversion between Australian and Canadian dollars?
                                Regards,
                                Marc

                                Comment


                                • #17
                                  Hi Marc & Marc.

                                  Nevertheless, I must admit Hans has stirred my curiosity to explore the new PowerBASIC COM but, I am a bit late joining the CLASS!
                                  If you want to explore the ActiveX version I will put the code and instructions
                                  how to use and build this version on the forum.
                                  I will include the neccessary includefile with it.
                                  This in case you don't want to build it yourself.

                                  This is the last version with all the addons in it.
                                  (Marc I was so free to set it to version 0.06 if it is ok with you)

                                  Please let me know if you want to get it.
                                  sigpic
                                  Regards,
                                  Hans Rietveld.

                                  Comment


                                  • #18
                                    Hi Hans,

                                    Thanks for the printer setup code I’ll include it for the next release.

                                    I think I only want to use the Quick PDF library for tasks that PowerBASIC can’t handle. Printing appears to be is very well supported now so any printing features should be done in PowerBASIC. Generally speaking and in my opinion the project should:

                                    First and foremost, show-off PowerBASIC’s out-of-the-box power and ease-of-use.
                                    Secondly, introduce PowerBASIC users to the Quick PDF library and some of its capabilities.

                                    Regarding COM/ActiveX, it’s totally new (read alien) to me and I know absolutely nothing, zilch, nada about it. I am currently on my second reading of the PB manual on the subject but the light isn’t “on” yet. The advantages are obvious to me and I think I understand most of the individual concepts but I am still not able to put all the pieces together. I learn by doing so I need to go over it again… and again and again Probably simplistic but looking at the example you posted, it seems that once you have the include file and do some initializing the programming is basically the same as using the DLL version.

                                    I think it would be fantastic for the PowerBASIC community to have the project available in both DLL and ActiveX versions but it’ll be some time before I understand COM enough to do the conversion. If you’ve already done it and are willing to post I think it would be appreciated by everybody, I know I’d love to see it.

                                    There are still some things I want to add to the current project before I move on and try another, maybe use the library with COM to write instead of read PDF’s.

                                    Thanks for the help Hans, your contribution is much appreciated.
                                    Regards,
                                    Marc

                                    Comment


                                    • #19
                                      Hi Marc,

                                      would it be possible to put some scrollbars so that you can scroll in a pdf if it is zoomed in.

                                      Thanks.
                                      Regards,
                                      Marc

                                      Comment


                                      • #20
                                        Hi Marc,

                                        I feel like I am talking to myself

                                        Yes, scroll bars are one of the things I sill want to add. I remember, some time back, seeing a scrolling “DDT Graphic” example on this forum but I never copied it so now I’ll have to go hunting.

                                        I would also like to add loading of multiple documents, maybe merge documents, maybe some minor editing ability… maybe I am just day dreaming

                                        I hope you’re finding it useful, educational or entertaining.
                                        Regards,
                                        Marc

                                        Comment

                                        Working...
                                        X