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 - Problem using AddImageFromStream
  FAQ FAQ  Forum Search   Register Register  Login Login

Problem using AddImageFromStream

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


Joined: 22 Mar 16
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Brummos Quote  Post ReplyReply Direct Link To This Post Topic: Problem using AddImageFromStream
    Posted: 22 Mar 16 at 10:36AM
Hi,

I need some help using AddImageFromStream.

At the moment i have the following.

 PDFLibrary.InsertPages(1, 1);
 PDFLibrary.SetPageSize('A4');
 imageid := PDFLibrary.AddImageFromStream(IMGStream, 0);
 PDFLibrary.SelectImage(imageidd);
 horz := PDFLibrary.ImageWidth;
 vert:= PDFLibrary.ImageHeight;
 PDFLibrary.SetOrigin(1);
 PDFLibrary.DrawImage(0, 0, horz, vert);
 PDFLibrary.ReleaseImage(imageid);

the problem is with "imageid := PDFLibrary.AddImageFromStream(IMGStream, 0);". It keeps returning 0, so something goes wrong with adding the image. And the result is a blanco pdf file.

If i save the stream i get a perfect image, so i assume its correctly inserted into the stream i'm using.

Can anyone help me with this?

Thanks in advance

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: 22 Mar 16 at 11:18AM
Hi Brummos,

so the image data isn't valid.
It would be more helpful posting the code snippet which builds the stream.
Perhaps then it's possible to find the error.
BTW: It's not necessary to insert a first blank page for creation because for first creation a blank page is as default already inside ;-)

Cheers and welcome here,
Ingo

Cheers,
Ingo

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: 22 Mar 16 at 11:22AM
perhaps it's only the stream-position.
It have to be set to 0 before.

Cheers, Ingo
Cheers,
Ingo

Back to Top
Brummos View Drop Down
Beginner
Beginner


Joined: 22 Mar 16
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Brummos Quote  Post ReplyReply Direct Link To This Post Posted: 22 Mar 16 at 11:23AM
Hi,

thanks for your help! you answer already helped me since it made me figure out why the stream was wrong.

the stream was fflled with a pdf and not an image like tiff. as soon as i stored the stream with tiff it started working.

thanks!
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