473,394 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

convert any text file into pdf file

40
Hi!
can any one help me by providing the method when i open any text file and convert into pdf format. I searched on the net and i got some code but i am not understanding this code and it also produce error on the highlited line. for converting the file can i have to do the refrence to adobe liberary please tell me

Dim wrd As New Word.Application
Dim doc As Word.Document
wrd.Visible = False
wrd.ScreenUpdating = False
wrd.ActivePrinter = "Acrobat Distiller"
'Open the document
Set doc = wrd.Documents.Open("d:\abc\test.doc")
'Print it to a PostScript file using Distiller
doc.PrintOut False, False, , "d:\abc\test.ps", , , , , , , True
doc.Close False
wrd.Quit False
Set doc = Nothing
Set wrd = Nothing
'Now call distiller to convert the postscript file to PDF
Dim acr As New ACRODISTXLib.PdfDistiller//user defined type not defined
acr.bShowWindow = False
acr.FileToPDF "d:\abc\test.ps", "d:\abc\test.pdf", True
'acr.FileToPDF "d:\abc\test.ps", "d:\abc\test.pdf", 1
Set acr = Nothing
'Delete the old PS file
Kill "d:\abc\test.ps"
'Done

Exit Sub
PDF_error:
doc.Close False
wrd.Quit False
Set doc = Nothing
Set wrd = Nothing
Set acr = Nothing
Mar 13 '08 #1
2 3932
debasisdas
8,127 Expert 4TB
Do you have the third party component / DLL in your system and is that referenced to your project ?
Mar 13 '08 #2
progvar
40
i don't have DLL in my systems related to this program


Do you have the third party component / DLL in your system and is that referenced to your project ?
Mar 13 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: hunterb | last post by:
I have a file which has no BOM and contains mostly single byte chars. There are numerous double byte chars (Japanese) which appear throughout. I need to take the resulting Unicode and store it in a...
2
by: chris | last post by:
Hi there, I create an XML file from a dataset like this: System.IO.StreamWriter xmlSW = new System.IO.StreamWriter(FILENAME); dsUserData1.WriteXml(xmlSW, XmlWriteMode.WriteSchema);...
7
by: whatluo | last post by:
Hi, all I'm now working on a program which will convert dec number to hex and oct and bin respectively, I've checked the clc but with no luck, so can anybody give me a hit how to make this done...
1
by: Daniel | last post by:
I have looked everywhere on the web for an answer to this and the only thing I can find is converting the image format when the file is present on the local filesystem. What I want to do is use a...
10
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
5
by: Socrates | last post by:
I am interested in developing an online utility that will enable users to copy and past any image (or upload any image on the internet) to the online utility, which will then convert the image to...
4
by: csgraham74 | last post by:
Hi, Ive posted on this previously but had no response. Basically i need to build some html using a rich text editor. Then i want to actually create an html document from this and save it to my...
27
by: comp.lang.tcl | last post by:
My TCL proc, XML_GET_ALL_ELEMENT_ATTRS, is supposed to convert an XML file into a TCL list as follows: attr1 {val1} attr2 {val2} ... attrN {valN} This is the TCL code that does this: set...
7
by: elliotng.ee | last post by:
I have a text file that contains a header 32-bit binary. For example, the text file could be: %%This is the input text %%test.txt Date: Tue Dec 26 14:03:35 2006...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.