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!
DPLLoadFromString Fails |
Post Reply |
Author | |
Xan
Beginner Joined: 23 Jan 13 Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 23 Jan 13 at 11:11PM |
Hello,
I'm using QuickPDF Library as a LIB, building a DLL to be a browser plugin. It works great overall. Right now, I'm taking in a Base64-encoded PDF as input, decoding it, writing that file to a temporary file, and then loading that with DPLLoadFromFile. It would be really nice to use DPLLoadFromString, since I have a std::string containing the Base64-decoded data, but I can't get it to work. The call to DPLLoadFromString always returns 0. I've tried several machinations, but here's what I believe ought to work. Can anybody help?
|
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
I see you are using C++. The word string is a little confusing as it actually refers to a Delphi AnsiString which is a little different to a char pointer.
I suggest you read the final comment in the following thread. It shows how to create an AnsiString buffer which can be used with LoadFromString. http://www.quickpdf.org/forum/using-qpl8xx-with-realbasic-realstudio_topic2315.html int BufferID , Test , ImageID; BufferID = QPDFCreateBuffer ( InstanceID , buffer.Size ) if (BufferID != 0) // OK { Test = QPDFAddToBuffer (InstanceID , BufferID , buf, sizeof(buf)); QPDFLoadFromFromString (InstanceID, BufferID , ""); Test = QPDFReleaseBuffer ( InstanceID, BufferID ) } Edited by AndrewC - 13 Mar 14 at 12:09AM |
|
Xan
Beginner Joined: 23 Jan 13 Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Thank you very much! It now works. Here's the C++ version, in case anybody stumbles across this.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store