Solved

How to Convert MS word (97-2000) document to PDF document by printing on "Source Forge - PDF Creator" through server side asp

Posted on 2009-04-12
5
335 Views
Last Modified: 2012-05-06
I have a requirement where i need to convert a word (97-2000) document to a PDF document through asp. I have sourceforge-PDFCreator installed on the server and try printing the word document to a PDF file. there are 2 issues in the process.
(i)   I am not able to supply file as a parameter.
I tried using the following ObjDocument.PrintOut(,,,"drive\filename")
This saves the file but i am not able to open this file.. it is empty and giving an error on opening.

(ii) If i use
  ObjDocument.PrintOut() - This gives me an openable document, but askes for file name.

Please suggest how do i use and get the desired results.
0
Comment
Question by:drgiridharan
  • 3
  • 2
5 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 24126663
Try setting the PrintToFile parameter to True.

ObjDocument.PrintOut(,,,"drive\filename",,,,,,,True)
0
 

Author Comment

by:drgiridharan
ID: 24126680
It gives an error.
If i miss the first parameter as blank like
objDocument.PrintOut(,,,............)
instead if i use objDocument.PrintOut(0,0,0.......) then it does not give error but still i am not able to open the doucment. When i try to open the document, it gives .. the document is not in the required format.
0
 

Author Comment

by:drgiridharan
ID: 24126683
Can yu give me the full code snippet that will work.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 24126740
I can't reproduce your environment, but these two subs print to a file in VBA
Sub PrintDoc1(Doc As Document)

    Doc.PrintOut , , , "C:\MyPath\MyFile1.prn", , , , , , , True

End Sub
 

Sub PrintDoc2(Doc As Document)

    Doc.PrintOut OutputFileName:="C:\MyPath\MyFile2.prn", PrintToFile:=True

End Sub

Open in new window

0
 

Accepted Solution

by:
drgiridharan earned 0 total points
ID: 24161743
Graham,
This works in VBA. I did make it work earlier and you would have got that from my original posting.

However, the same function PrintOut(... do not give the desired result. The file is created but when you try to open the file, you get an incompatible format message and contents are not displayed.

Currently i have given our client the following choices.

(i)    Write an VB activeX/application that is callable from asp - vbscript/Jascript.
(ii)   Buy a thirdparty component. (not yet decided).

Thanks for your help. But not able to take it as it does not work..
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBScript to list Unavailable Mapped Drives 5 43
MsgBox 4 45
VB6 ListBox Question 4 32
Modifying Powershell and WMI to obtain disk, cpu, mem & IP data ? 5 37
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

911 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

21 Experts available now in Live!

Get 1:1 Help Now