Create Pdf File From Vb6 Shell
This article contains code samples to Create File using VBScript, and commands to Create File in Powershell and Command Line (cmd). Environment: Visual Basic 6 When it comes to generating reports in software systems, most users want these reports to be printed as an Adobe Portable Document Format (PDF) file, which is is normally a read-only format so that users can't change the contents of it.Most customers will ask that your report be printed in PDF format.
The task :
Using multiple commands like :
I generate some text file.
For readiness I must insert page break.
When the program is finished I want to convert the final text file to a pdf file.
When finished, I got two files : One text file and One pdf file.
When printing both, you cannot differentiate them.
What I have done :
I build a single groff base file by copying data :
First I initialize the base document with :
Then I fill the base file with the result of :
Then I build the pdf file like this :
Problem N°1
The page break is always at line 67.
I tried to change page length with :
With different value but the page break arise always at the same place.
So How to change the page break.
Problem N°2
I want to use different fonts type and size.
This will certainly affect the presentation of the document.
How to fix the problem of page breaks.
Problem N°3
How to set page length by lines/per page ?
Problem N°4
With enscript you can explicitly set page format, font, ...
--lines-per-page= ?
--margins=?:?:?:?
--font=?
--media=?
This may contradict the presentation of the document generated by groff.
Problem N°5
I have look after hundreds of web page and I have not found a good tutorial to help me is that task that should be simple.
Any help is welcome.
- Points
- 802
- Posts
- 114
Hi all
I'm using Excel 2010 and have Adobe Reader 11.
I'm trying to make a code in VBA that can print a specific PDF file. It's OK if the file opens first but it not necessary.
The file name change from time to time but it’s written in a specific cell in Excel. Let us say that it’s A1 in sheet1. The path is the same every time so that can be written directly in the code.
I have found this code on WWW but it doesn’t work for me.
Display More- Option Explicit
- Public Declare Function ShellExecute Lib 'shell32.dll' Alias 'ShellExecuteA' ( _
- ByVal hwnd As Long, _
- ByVal lpOperation As String, _
- ByVal lpFile As String, _
- ByVal lpParameters As String, _
- ByVal lpDirectory As String, _
- ByVal nShowCmd As Long) As Long
- Public Function PrintThisDoc(Formname As Long, FileName As String)
- On Error Resume Next
- Dim X As Long
- X = ShellExecute(Formname, 'Print', FileName, 0&, 0&, 3)
- End Function
- Sub testPrint()
- Dim printThis
- Dim strDir As String
- Dim strFile As String
- strDir = 'J:KALMachinesExtruder IKøredataTegninger'
- strFile = '370_Rev.pdf'
- printThis = PrintThisDoc(0, strDir & strFile)
- End Sub
Jo bheji thi dua mp3 download 320kbps mr jatt. I do hope that someone can help me.
Thank you in advance
- Navigation
- OzGrid
- Forum
- Members
- Options
- Current Location
This site uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.Your browser has JavaScript disabled. If you would like to use all features of this site, it is mandatory to enable JavaScript.