Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Print a Word doc. in pdf format

Posted on 2002-03-06
8
196 Views
Last Modified: 2010-04-05
Hi all,

I'm running Win2000 + MS-Office 2000 + Delphi5 + Adobe Acrobat Writer driver.

I would like to print some Word files in pdf format but I don't know how to select the driver name and to give the filename(.pdf) to the driver

Could you please help ?

Thanks,

Pascal
0
Comment
Question by:F31203
8 Comments
 
LVL 3

Expert Comment

by:lopem
ID: 6844992
Pascal,

You dont have to define the printer driver from delphi. You can do it from windows printer manager... But
to print a word is not just a matter of sending it to the printer. You have to understand (from delphi), how the internal format of Word documents works).

On the other hand, there are some components... (i think are commercial all of them)... try

http://forum.planetpdf.com/archive/4225.htm

Hope this help
Manuel Lopez (lopem)
0
 
LVL 45

Expert Comment

by:aikimark
ID: 6845491
Pascal,

Do you really mean "save some Word files in pdf format"?

If so, the Word (automation) document object SaveAs method allows you to specify the converter.  

You will need to iterate through the word.application.fileconverters collection to find the Adobe Writer.  The Adobe file converter's value is the one you'll use with the SaveAs method.
0
 

Author Comment

by:F31203
ID: 6846880
Hi Manuel,

It is what I'm actually doing : I open the document with
Word (from Delphi) and I try to give the parameters to the
Word.Printout(params).

I've checked some components, but they only allow to open a pdf file and not to create them.

Regards,

Pascal
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 45

Expert Comment

by:aikimark
ID: 6846911
Pascal,

Do you mean you have a virtual printer setup?  If so, you need to set the default printer to Adobe.  There should be no further special processing required other than Print.
0
 

Author Comment

by:F31203
ID: 6846980
Hi aikimark,

I'm actually testing your solution too but not yet finished !

In fact, when you have installed the Acrobat Writer, it creates a virtual printer (in Word, you can't 'save as' a file as a pdf file but only print it giving a filename.pdf)

I'm trying to iterate the fileconverters but it seems to be hard work !

Regards,

Pascal
0
 
LVL 45

Accepted Solution

by:
aikimark earned 100 total points
ID: 6847365
{ List all the file converters installed }
  for i := 1 to Word.FileConverters.Count do
  begin
    Idx := i;
    Converter := Word.FileConverters.Item(Idx);
    ListBox1.Items.Append(Converter.ClassName + ' : ' +
Converter.FormatName);
  end;
0
 

Author Comment

by:F31203
ID: 6847659
OK, now I get the list of converters ... and Acrobat Writer is not in the list.

As I'm in a hurry with this problem, the quickest way for me will be to use the sendkey command to have the filename.pdf (not very elegant, but ...)
0
 

Expert Comment

by:CleanupPing
ID: 9343303
F31203:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question