Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculating the pages of files
Message
From
17/06/2006 16:06:48
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01129743
Message ID:
01129751
Views:
17
>Hi !!!
>
>Is anybody have an idea to check the properties or count the numbers of pages of the different files formats ( ie DOC, XLS, BMP, HTML, PDF, etc)
>
>Thanks in advance
>
>Ravi Mehrotra

I don't think there is a systematic, simple, way to handle all the different file formats, unless you find a program that can actually open all those formats. But, for example, I don't think it would be a good idea to open a Word document in Excel, or an Excel document in Word.

For some of those formats, you can use Automation to open those files in Word, or in Excel, for instance, and then look for the function that tells you how many pages there are in total. I don't know which function this is, but Automation is the way to go.

This might work for DOC (Word), XLS (Excel), HTML (Word) - and I don't know whether Word can be made to open PDF files.

I don't think that Adobe Acrobat Reader can be automated; perhaps Adobe Acrobat can - I am not sure - but that would require a license of Adobe Acrobat.

With what program would you want to open BMP? If you open it in Word, the picture will always fit on a single page, i.e., it is automatically scaled.

On the other hand, you can get properties of an image (like BMP, JPG, GIF... and whatever other formats are supported in VFP 9) with an "Image" object. After create the "Image" object and loading an image, you can get its Height and Width properties.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform