Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - VFP Help Loading a PDF
  FAQ FAQ  Forum Search   Register Register  Login Login

VFP Help Loading a PDF

 Post Reply Post Reply
Author
Message
bjharada View Drop Down
Beginner
Beginner


Joined: 04 Oct 12
Location: United States
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote bjharada Quote  Post ReplyReply Direct Link To This Post Topic: VFP Help Loading a PDF
    Posted: 28 Aug 19 at 12:23AM
I have an existing pdf document containing 5 pages.
I also have amendments to the pdf document for pages 2,4 and 5 in individual pdfs.
I would like to create an output document that contains the following:

    page 1 (original document for page 1) as pdf1
    page 2 (original document for page 2) as pdf2
    page 3 (amended document for page 2)  as pdf3
    page 4 (original document for page 3) as pdf4
    page 5 (original document for page 4) as pdf5
    page 6 (amended document for page 4)  as pdf6
    page 7 (original document for page 5) as pdf7
    page 8 (amended document for page 5)  as pdf8

I would create a new filelist by using the following procedure:
    clearfilelist
    addtofilelist(pdf1)
    addtofilelist(pdf2)
    addtofilelist(pdf3)
    addtofilelist(pdf4)
    addtofilelist(pdf5)
    addtofilelist(pdf6)
    addtofilelist(pdf7)
    addtofilelist(pdf8)
    mergefilelist(output.pdf)
   
My questions are as follows:

1) I am currently using QuickPDFDLL0816.dll.  I have been able to create any number of pdf's
    including the existing pdf which I am attempting to load.

2) when attempting to LoadFromFile for the existing pdf,
    I keep getting 0 as the result of the load. 
    What causes this to happen?  I can open the pdf in acrobat and everything appears normal.
    When I try the LastErrorCode I also get a result of 0.
        
3) also, I don't know what function to use to search thru the document once I am able to loadfromfile,
    to determine if this is a document that needs to be amended.
    can I use QuickPDFRenderDocumentToFile or QuickPDFRetrieveCustomDataToString to get a string that I can
    interrogate for a search field to indicate to me that this is a document that I need to amend?

I am currently using Visual Foxpro 9 (SP 2).
   
below is the code I am currently trying to read this pdf.   
   
*!* I am currently using QuickPDFDLL0816.dll as the base dll
*!*
DECLARE Long QuickPDFCreateLibrary IN QuickPDFDLL0816.dll AS QuickPDFCreateLibrary
DECLARE Long QuickPDFUnlockKeyA IN QuickPDFDLL0816.dll AS QuickPDFUnlockKey ;
    Long iInstanceID, String sLicenseKey
DECLARE Long QuickPDFLoadFromFile IN QuickPDFDLL0816.dll AS QuickPDFLoadFromFile ;
    Long iInstanceID, String sFileName
DECLARE Long QuickPDFLastErrorCode IN QuickPDFDLL0816.dll AS QuickPDFLastErrorCode ;
    Long iInstanceID

PUBLIC iInstanceID
iInstanceID = QuickPDFCreateLibrary()
LicenseKey = "(My License Key)"
Result = QuickPDFUnlockKey(iInstanceID, LicenseKey)                <---- This result is 1
IF result = 0
    result = QuickPDFLastErrorCode(iInstanceID)
    =MESSAGEBOX('error',0,'System Message')
ENDIF

lfilename     = "opposing.pdf"
result         = QuickPDFLoadFromFile(iInstanceID,lfilename)          <---- I keep getting a result of 0, when trying the load this file
result         = QuickPDFLoadFromFile(iInstanceID,(lfilename))      <---- I've also used this and got a 0 result
result         = QuickPDFLoadFromFile(iInstanceID,"opposing.pdf")  <---- I've also used this and got a 0 result
IF result = 0
    result = QuickPDFLastErrorCode(iInstanceID)       
    =MESSAGEBOX('error',0,'System Message')
ENDIF

Any and all help would be appreciated.

TIA,
Bob Harada   

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 28 Aug 19 at 10:58PM
Hi Bob,

2. Value 0 means that the load fails. If you have immediatelly behind the LastErrorCode and if the value is 0 this leads to a more common problem.
Is the file still in use? Is the file read-/write-protected?
3. To check if a file is relevant for your process you can use the extract-functionalities and check the textcontent.

You're a community member since 2012 - so i think you already know the online reference, the knowledgebase, the developer guide...

Cheers,
Ingo

Back to Top
bjharada View Drop Down
Beginner
Beginner


Joined: 04 Oct 12
Location: United States
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote bjharada Quote  Post ReplyReply Direct Link To This Post Posted: 28 Aug 19 at 11:22PM
Thanks for replying Ingo.  I've used the QuickPDF libraries since 2012, but I've only used clearfilelist, addtofilelist and mergefilelist.  I've never had to try any other functions. And I have never attempted to read the pdf with quickpdf functions. I've gone thru the knowledgebase and developer guides, but it's sometimes difficult because all examples and fixes are in VB or Deiphi which I am not very familiar with.  Also the pdf file in question is not read/write protected as far as I know.  When I do the lasterrorcode check, the result is also 0, not a valid error code so I have no idea what the error is.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 29 Aug 19 at 10:27PM
Hi,

i don't see a password parameter in your LoadFromFile?
Please check this:
https://www.debenu.com/docs/pdf_library_reference/LoadFromFile.php
BTW: QuickPDF uses unicode for the string values (perhaps 8.16 still as utf8...).

Cheers,
Ingo

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store