Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

Creating a PDF file in a VB application

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
shaji_am
Asked:
shaji_am
1 Solution
 
TimCotteeCommented:
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
 
shaji_amAuthor Commented:
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
 
gencrossCommented:
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jeetCommented:
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
 
shaji_amAuthor Commented:
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
 
gencrossCommented:
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
 
shaji_amAuthor Commented:
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
 
gencrossCommented:
Use the printer object in VB

Printer.Print
Printer.FontSize = 12
Printer.FontName = "Arial"
Printer.FontBold = True
etc...
0
 
shaji_amAuthor Commented:
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
 
shaji_amAuthor Commented:
Hi ,

Any solution??
Thanks
0
 
shaji_amAuthor Commented:

How can I add a Report object to my appliction.
Thanks
0
 
DanRollinsCommented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now