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 - NewNamedDestination - will not add a nameddest
  FAQ FAQ  Forum Search   Register Register  Login Login

NewNamedDestination - will not add a nameddest

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


Joined: 22 Jun 06
Location: Germany
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote hubbra Quote  Post ReplyReply Direct Link To This Post Topic: NewNamedDestination - will not add a nameddest
    Posted: 09 Dec 11 at 3:16PM
Hi,

I want to set new named destinations, and failed, so I wrote this little test to read a PDF with namedDest, search one ... this works, but I am confused about the left and top parameters.
And then use the nDestID and create a NewNamedDest ... Result 1, but there is nothing inside.
Than i create a new nDestID with NewDestination, Result <> 0, so it should be ok.
And try to create with it a NewNamedDestination, Result 1 but nothing inside ...
Save the PDF to a new file and no new nameddest inside, only the old ones ...
I got left = -185 and thought it should be 0 or 1 because it shows the first position on page.
I got top = 644 on the middle Position, and 804 on the page top ...

What do I have to do different ?

The example is in PowerBasic, using your INC file.


#COMPILE EXE
#DIM ALL
#DEBUG ERROR ON

#INCLUDE "QuickPDFDLL0726.inc"
#INCLUDE "QuickPDFLizenz.inc"

FUNCTION PBMAIN () AS LONG
  LOCAL nID, nResult, nH, i, x, nDestID AS LONG
  LOCAL sPDF, sKW, sDestName AS ASCIIZ*256

  sPDF = "Test.pdf"

  nID = QuickPDFCreateLibrary()

  IF QuickPDFUnlockKey(nID, $QuickPDFLizenzKeyHB  ) THEN
     ? QuickPDFLibraryVersion(nID)
     ? QuickPDFLicenseInfo(nID)
     nResult = QuickPDFLoadFromFile(nID, sPDF)
     IF nResult <> 1 THEN
        ? "Error PDF could not be opened:", nResult
     ELSE
        ? "PDF is open, some infos:"
        ?
        ? "GetDocumentFileName()='"+QuickPDFGetDocumentFileName(nID)+"'"
        ? QuickPDFGetInformation(nID, 0 ) ' 0 = PDF Version
        ? QuickPDFGetInformation(nID, 1 ) ' 1 = Author
        ? QuickPDFGetInformation(nID, 2 ) ' 2 = Title
'        ? QuickPDFGetInformation(nID, 3 ) ' 3 = Subject
'        ? QuickPDFGetInformation(nID, 4 ) ' 4 = Keywords
        ? QuickPDFGetInformation(nID, 5 ) ' 5 = Creator
        ? QuickPDFGetInformation(nID, 6 ) ' 6 = Producer
        ? QuickPDFGetInformation(nID, 7 ) ' 7 = Creation date
        ? QuickPDFGetInformation(nID, 8 ) ' 8 = Modification date
        ?
        ? "PageCount:          " QuickPDFDAGetPageCount(nID, nH)
        sDestName = "K01Ab"
        nResult = QuickPDFGetNamedDestination(nID,sDestName)
        IF nResult=0 THEN
           ? "not found:  GetNamedDestination()",nID,sDestName
        ELSE
           nDestID = nResult
           ?
           ? "gefunden:      ",nDestID
           ? "Infos zu  " sDestName
           ? "PAGE:     " QuickPDFGetDestPage(nID,nDestID)
           ? "TYPE:     " QuickPDFGetDestType(nID,nDestID)
           ? "V-Left:   " QuickPDFGetDestValue(nID,nDestID,1) ' Left
           ? "V-Top:    " QuickPDFGetDestValue(nID,nDestID,2) ' Top
           ? "V-Right:  " QuickPDFGetDestValue(nID,nDestID,3) ' Right
           ? "V-Bottom: " QuickPDFGetDestValue(nID,nDestID,4) ' Bottom
           ? "V-Zoom:   " QuickPDFGetDestValue(nID,nDestID,5) ' Zoom
           ?
           sDestName = "K01Xx1"
           ? "Set NewNamedDest", QuickPDFNewNamedDestination(nID, sDestName, nDestID)
           ? "TEST: ", QuickPDFGetNamedDestination(nID,sDestName)

        END IF

        sDestName = "K01Xx2"
        nDestID   = QuickPDFNewDestination(nID, 2, 100, 1, 1, 500,0,0)
        IF nDestID=0 THEN
           ? "Error in NewDestination()"
        ELSE
           ? "NewDestination is OK"
           ? "Set NewNamedDest", QuickPDFNewNamedDestination(nID, sDestName, nDestID)
           ? "TEST: ", QuickPDFGetNamedDestination(nID,sDestName)
        END IF

        sPDF = "NeuTest.pdf"
        KILL sPDF
        IF QuickPDFSaveToFile(nID, sPDF ) THEN
           ? "OK, gespeichert"
        ELSE
           ? "Fehler beim speichern"
        END IF
        ? "Reset", QuickPDFReleaseLibrary(nID), " (1=OK)"
     END IF
  ELSE
     ? "ERROR"
  END IF

  ? "press key ..."

  WAITKEY$

END FUNCTION




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

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 13 Dec 11 at 7:37AM

We have reproduced the bug and hopefully will have a fix sometime soon.  It is not a trivial fix as the PDF spec allows for multiple methods for storing Destinations.

Andrew.
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