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 - memoryStream, dll version, viewing PDF's
  FAQ FAQ  Forum Search   Register Register  Login Login

memoryStream, dll version, viewing PDF's

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


Joined: 27 Oct 11
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote greenley Quote  Post ReplyReply Direct Link To This Post Topic: memoryStream, dll version, viewing PDF's
    Posted: 01 Nov 11 at 8:44PM
Using dll evaluation version 8.12 with C++ Builder 6, want to save pdf stream to use WPViewPDF component to open from stream to avoid creating a temp file. dll version does not support SaveToStream, WPViewPDF only opens from Stream or File. Suggestions? Is it possible to SaveToString, convert that to Stream and then open from Stream? If so, how? Is there a better answer for viewing the  pdf's, I want to avoid temp files, not require adobe, and give option to save or print pdf from the viewer.
Thanks
Bill Greenley
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 01 Nov 11 at 9:35PM
Hi Bill!

If you want these things why not search for them?
Try this with Google ...
Delphi String to Stream
... and you'll get enough inspirations ;-)

Cheers and welcome here,
Ingo
Back to Top
greenley View Drop Down
Beginner
Beginner


Joined: 27 Oct 11
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote greenley Quote  Post ReplyReply Direct Link To This Post Posted: 01 Nov 11 at 10:40PM
Fixed: The following code works, maybe it can help someone else.

I always search first. I have searched and tried a number of methods before I posted, using dll version with C++ Builder 6.

My latest attempt is:
     // above is code that creates a pdf
     TMemoryStream *pMS = new TMemoryStream;
     string memStr = QP.SaveToString();
     int i = memStr.length();
     pMS->Write(memStr.c_str(),memStr.length());
     // saving stream to file to test before trying opening stream in WPViewPDF
     pMS->SaveToFile(L"junk.pdf");   // files does not open, acrobat says is corrupt,
                                     // both have same size (6072 bytes)
     QP.SaveToFile(L"junk1.pdf");    // file is valid and opens in acrobat

I am sure it is a foolish error, but I just can't seem to find it. junk1.pdf opens fine, but junk.pdf does not, something is getting scrambled in the SaveToString -> Write to Stream -> Stream SaveToFile, i does show the correct length of 6072.

Bill Greenley


Edited by greenley - 02 Nov 11 at 1:47AM
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