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!
convert gif to pdf |
Post Reply |
Author | |
abenitez77
Beginner Joined: 24 Oct 10 Location: FL, USA Status: Offline Points: 4 |
Post Options
Thanks(0)
Posted: 25 Oct 10 at 12:00PM |
I have 100,000 gif images and I want to convert them all to pdf files. How can i do this in a script? |
|
Rowan
Moderator Group Joined: 10 Jan 09 Status: Offline Points: 398 |
Post Options
Thanks(0)
|
Converting GIF images to PDF files can be done relatively easily. Here's a sample written in JScript: ------------------------------------------------------- /* Convert an image to a PDF */ // Load a sample image into memory QP.AddImageFromFile("sample123.gif", 0); // Get the width and height of the image lWidth = QP.ImageWidth(); lHeight = QP.ImageHeight(); // Reformat the size of the page in the selected document QP.SetPageDimensions(lWidth, lHeight); // Draw the image onto the page using the specified width/height QP.DrawImage(0, lHeight, lWidth, lHeight); // Store the updated PDF where you like QP.SaveToFile("sample123.pdf"); ------------------------------------------------------- All you have to do is loop through this little snippet of code for each image that you wish to convert.
|
|
abenitez77
Beginner Joined: 24 Oct 10 Location: FL, USA Status: Offline Points: 4 |
Post Options
Thanks(0)
|
Thanks!
I am unfamiliar with jscript. If I had a folder "e:\images" and wanted to loop thru the gif files in that dir, what is the syntax?
|
|
abenitez77
Beginner Joined: 24 Oct 10 Location: FL, USA Status: Offline Points: 4 |
Post Options
Thanks(0)
|
How would i kick that script off? do I need to run in from within quickpdf?
|
|
Wheeley
Senior Member Joined: 30 Oct 05 Location: United States Status: Offline Points: 146 |
Post Options
Thanks(0)
|
It might help if you tell us which programming language you are trying to use.
Wheeley |
|
abenitez77
Beginner Joined: 24 Oct 10 Location: FL, USA Status: Offline Points: 4 |
Post Options
Thanks(0)
|
I am familiar with vbscript and vba
|
|
Rowan
Moderator Group Joined: 10 Jan 09 Status: Offline Points: 398 |
Post Options
Thanks(0)
|
There is some samples on how to use Quick PDF Library with VBScript in this folder (after you've installed Quick PDF Library):
C:\Program Files\Quick PDF Library\Samples, Tutorials and Help\VBScript It should not be very hard to convert the JScript code that I posted into VBScript, just a few minor changes like removing the semi-colons from the end of the lines and a few other things. As for looping through each image in the folder, off the top of my head I'm not familiar with how to do this in VBScript, but you should be able to find a sample in Google. Good luck!
|
|
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