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!
![]() |
memoryStream, dll version, viewing PDF's |
Post Reply
|
| Author | |
greenley
Beginner
Joined: 27 Oct 11 Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Topic: memoryStream, dll version, viewing PDF'sPosted: 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 |
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
greenley
Beginner
Joined: 27 Oct 11 Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
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