Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).

New Forum | Previous | Next | (P-PDF) Developers

Topic: How to create thumbnails (JPG?) from PDF in VB
Conf: (P-PDF) Developers, Msg: 36095
From: atolk
Date: 3/6/2002 01:29 PM

Hi All,

I am new to PDF's, so please be gentle. I am developing in VB 6, I have Acrobat 5.0 and I have downloaded the SDK only to find out that it is not exactly Microsoft-friendly.

I need to create small thumbnails - supposedly in JPEG format, although it is not written in stone - of the first page of color, text and graphics PDF files, as they come into a folder. In my ideal COM-based world, it would look something like this:

set objPDDoc = CreateObject("AcroExch.PDDoc")
objPDDoc.Open strPath
PDDoc.SaveAs FileType:="jpg", FileName:=Replace(strPath,"pdf","jpg"), Page:=1, Width:=100, Height:=75, Quality:=1, Resolution:=96...

Now the harsh reality is setting in. First of all, it almost looks like I have to understand PDF format. Layers. There is PDDoc, AVDoc and all other layer-specific objects. Which one of them may have the methods I am looking for?

Second, SDK documentation seems to concentrates on Java API, and even in the chapter dedicated to VisualBasic programming, it refers to JSObject as the COM-java bridge. Yet, there is a set of COM components that came with Acrobat, most notably acrobat.tlb, but I can't find the documentation for the object model implemented in them.

Third, many of the earlier replies to questions similar to mine have words "this is a very hard task", "you need a third party product", "well, Acrobat SDK can do it, but that, of course, is out". Why? Why is it out? If you open a PDF file natively and click Save As..., you get "Save as type: JPEG", and it even has some parameters -- not a whole lot, though. For starters, I would like to replicate this functionality through my VB app, JSObject or no JSObject: open a file, save it as JPEG while setting compression, format (somebody please explain those to me), colorspace and resolution. This is what the app allows interactively and this is what I want to learn to do. It will not get the job done, but it would show me the ropes.

What I will need to do next is:
- set size for my thumbnail;
- make sure only the first page gets rendered; when I do it from the app, all pages get rendered as numbered JPEG files, that is bad for me;
- plus, I need to figure out why the resulting JPEGs look so crappy; I know, you have said that JPEG is not a text format, but first, I tried TIFF and it looks just as crappy, and second, I don't mind blurriness if it only left the colors alone. As it is, black text looks anything but black.

Anyway, if you tell me that I cannot accomplish what I set out to do using just the SDK, I will buy it. But I want to hear it from you. And I want to hear how Acrobat.exe does it. If that's a plug-in, can I use it, too?

And if you tell me that I cannot (or should not) program the PDF->JPEG process, then I am sure there is a ready-made tool for it. Please recommend one that is
- reliable;
- COM-based (I will need to wrap it in my app which will search for PDF's, convert them and store JPEGs in a database);
- simple (read: cheap); there is very little I need to do (I think), and I don't want to pay for all the bells and whistles; I don't know what PDF tools go for these days, but I consider $50-$70 a fair deal.

Hope I made sense here. Please address as many of my questions as you can and be mindful of the fact that I am under a deadline.

Thanks in advance. I find your forum extremely useful and your posts very insightful. I apologize if my question has been answered already, and I failed to find it.


PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.