Print Page | Close Window

Problem replacing BMP images with JPG image

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3283
Printed Date: 04 Apr 26 at 7:50PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Problem replacing BMP images with JPG image
Posted By: dfloBob
Subject: Problem replacing BMP images with JPG image
Date Posted: 16 Mar 16 at 10:07AM
Hi All,

I am having issues when trying to replace BMP images in a PDF with JPG Images.  I am extracting the images details from the PDF fine but when I replace the images with JPG versions of the same image the image is not being replaced.  The replace code I'm using is as follows (VBScript)

                        DPL.ReplaceImage ImageID, DPL.AddImageFromFile(NewImageFileName,0)
                        DPL.ClearImage(ImageID)

If I extract the original images to disc and then replace the images in the PDF with exactly the same BMP images from disc it's working fine.  It's just when I replace with JOG images that it doesn't work.

I'm new to QP so any help would be appreciated.

Thanks
Bob



Replies:
Posted By: Ingo
Date Posted: 17 Mar 16 at 9:11PM
Hi Bob,

i'm wondering what's in ImageID after your ReplaceImage...
Still the replaced image or the new one?
if it's then the new one and you're doing the ClearImage then there's still the old one... perhaps ;-)
I think you should try first the ReplaceImage alone to see if there's success.
Before the ClearImage a new SelectImage could be necessary... perhaps ;-)
http://www.debenu.com/docs/pdf_library_reference/ReplaceImage.php
Perhaps it's better using the new imageid as second parameter...

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo



Posted By: dfloBob
Date Posted: 18 Mar 16 at 9:44AM
Hi Ingo,

Thanks for your reply.

It's still the old image in ImageID.  

I think your suggestion of trying SelectImage before I use ClearImage may help so I will try that first.

I appreciate the help.

Thanks
Bob



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk