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 - DPLLoadFromString for PowerBuilder
  FAQ FAQ  Forum Search   Register Register  Login Login

DPLLoadFromString for PowerBuilder

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


Joined: 11 Mar 13
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote KANASTASI Quote  Post ReplyReply Direct Link To This Post Topic: DPLLoadFromString for PowerBuilder
    Posted: 11 Mar 13 at 7:03PM
I'm currently using PowerBuilder 11.5 and trying to load a PDF from a string.  The PDFs in this application are stored in a SQL Server database as BLOBs.
 
For some reason I can't get DPLLoadFromString to work correctly.
 
Here is some of the code :
 
long il_instance_id
long li_ret
string ls_doc, ls_buf
long ll_len
blob lbob_doc
 
il_instance_id = DPLCreateLibrary()
li_ret = DPLunlockkey(il_instance_id, ls_debenu_key)
if li_ret = 0 then
 messagebox('Error','Could not unlock the Debenu tool.')
 return false
end if
ls_doc = string(lblob_doc)  //lblob_doc is a PDF blob from the database
ll_len = len(ls_doc)
ls_buf = DPLCreateBuffer(il_instance_id, ll_len)
if ls_buf = '0' then
 messagebox('Error','Could not create buffer.')
 return false
end if
DPLAddToBuffer(il_instance_id, ls_buf, ls_doc, len(ls_doc))
li_ret = DPLLoadFromString(il_instance_id, ls_buf,'')
if li_ret = 0 then
 messagebox('Error','Could not load the document (' + string(dpllasterrorcode(il_instance_id)) + ')')
 return false
end if
DPLReleaseBuffer(il_instance_id, ls_buf)
 
Any ideas?
Thanks!
 
Back to Top
Wheeley View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Oct 05
Location: United States
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote Wheeley Quote  Post ReplyReply Direct Link To This Post Posted: 11 Mar 13 at 9:11PM
I don't think this will work. The string statement converts the binary data of the blob into unicode characters. You are going to have to write the blob to disc first with FileWriteEX and than open it with LoadFromFile.

Wheeley

Back to Top
KANASTASI View Drop Down
Beginner
Beginner


Joined: 11 Mar 13
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote KANASTASI Quote  Post ReplyReply Direct Link To This Post Posted: 12 Mar 13 at 12:54PM
Thanks Wheeley for the reply.
 
I was hoping I could do all of the PDF work without going to disk.  If I use the ActiveX method do I still have to go to disk?
Back to Top
Wheeley View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Oct 05
Location: United States
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote Wheeley Quote  Post ReplyReply Direct Link To This Post Posted: 13 Mar 13 at 1:56AM
I think your problem is the string function in Powerbuilder. So the ActiveX will fail also. You could test this of course by writing the blob and the string to 2 different files and then try opening both of them as a pdf. My gut is telling me that the one which as a string will fail.

Wheeley
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