Solved

Print a Word doc. in pdf format

Posted on 2002-03-06
8
194 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now