Solved

Creating a PDF file in a VB application

Posted on 2002-07-17
12
316 Views
Last Modified: 2010-05-02
Hi,
I am working with a VB project.In this project I am generating a report (a text file with .txt extension) for more than 1000 clients per day.The VB application automatically generate the report getting input from SQL sever data base and e-mail to the respective client.It is working fine.

Now I want to generate a .pdf file in place of the text file.Is it possible  a VB application to automatically generate a pdf format report by getting values from the data base and with out any user intervention.

Thanks
shaji

0
Comment
Question by:shaji_am
12 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 7158981
There are a number of ways you could achieve this, however they all require some sort of PDF writer to achieve it. You can either use the Acrobat (full version not just the reader) application to create PDF files, there is a PDF writer printer driver that can be used or you can use the Acrobat Distiller application which can take .ps (postscript formatted) files and convert them automatically to PDF. Personally I use Distiller, I simply print to a postscript printer driver sent to a file in a folder watched by the distiller process and the .pdf file is output to another specified folder.
0
 

Author Comment

by:shaji_am
ID: 7159011
Hi Tim,
Thank you for the reply.If it is possible , then my company will  purchase the software.My aim is a fully automated system. ie, generate the pdf report file and e-mail it to the clients.I am new to this environment.Can you please give me some more specification about the programming, some helpful texts, web sites etc.
Thanks
Shaji
0
 
LVL 4

Expert Comment

by:gencross
ID: 7159206
There is also a reporting tool called ActiveReports that I use to do reporting.  It will export the report in PDF, RTF, or XLS format.  Very quick and easy to use.  You could use it to generate the report as opposed to the txt file then make one call to export the report to a PDF.  I have plenty of code to create a dynamic report and export if you would like to see it.  Check out this web site... www.datadynamics.com
0
 
LVL 1

Expert Comment

by:jeet
ID: 7167481
Like Tim, I have installed Acrobat (full version about $200), so i just "print" to the Acrobat printer from my VB app. Acrobat's API allows for the filename of the pdf to be set from the vb app, so no user intervention is required.

Jeet
0
 

Author Comment

by:shaji_am
ID: 7355052
Hi,
If I install Acrobat full version , is it possible to generate PDF in Japanese or Chinese fonts. or a combination of some different fonts.
Thanks
0
 
LVL 4

Expert Comment

by:gencross
ID: 7355766
Yes, I believe Acrobat will generate a pdf that matches the document that you send to it.  As far as I know it doesn't matter what font or language is used in the document.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:shaji_am
ID: 7358506
Hi,
I have some more doubts.
Which function I need to use for writing to the PDF.Is it the PRINT function of VB?
How can I set the page size(width & height) and othere charecteristics like font size,boldness etc.
Is it also from VB?
Thanks
0
 
LVL 4

Accepted Solution

by:
gencross earned 250 total points
ID: 7360184
Use the printer object in VB

Printer.Print
Printer.FontSize = 12
Printer.FontName = "Arial"
Printer.FontBold = True
etc...
0
 

Author Comment

by:shaji_am
ID: 7417853
Hi,
I have installed adobe full version and set the distiller as the default printer.Now I am able to create the pDF file and no issue with japanese font.In the report Japanese and English fonts are comming together. I am able to get some portion BOLD even. Now I am facing some other problems.
1. During the application run , the windows dialog box is activating and asking for a file name.ie, I am failed to put the file name in the program.

2. I am not sure about how I can dynamically pass different file names at runtime .(The file names are actually generated by the application)

3. How can I put a page break . In my application I have different sections and I want some of the sections should start in a new page.

4. Can I control the number of lines to be printed in one page from my application.Also page width , page height, orientation etc.

Thanks
0
 

Author Comment

by:shaji_am
ID: 7432991
Hi ,

Any solution??
Thanks
0
 

Author Comment

by:shaji_am
ID: 7451948

How can I add a Report object to my appliction.
Thanks
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8013751
Hi shaji_am,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Split points between: TimCottee and gencross

shaji_am, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

758 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

17 Experts available now in Live!

Get 1:1 Help Now