473,378 Members | 1,334 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,378 software developers and data experts.

Programming to "Print" using CUTE PDF!

HI;

I feel like a fool..I put CUTE FTP in my last request for help --it should have been CUTE
PDF! I have FTP on my mind because I have been working on a web based application, and
somehow my brain got stuck on it..sorry!

Hi:

I need some help writing code that will "print" a report using Cute PDF.

Specifically, I need to set up a "Button" which, when clicked, will:
a. Create an PDF "Print" file of the report using Cute PDF. The file needs to be given a
unique name based on data that will be in the report and on the query that generates the
report.

b. Store the result in a predefined folder..

I really would appreciate some pointers as to how to do this using MS Access 2000. The
application will be running on W98, 2000 and WXP!

Thanks in advance for any help you can give me.

Regards

John Baker
Nov 12 '05 #1
17 22308
That pdf creator does not supprot automation..and thus you can't set the
file name as far as I know...

--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
pl******************@msn.com
http://www.attcanada.net/~kallal.msn
Nov 12 '05 #2
Thanks for that info.

Do you know if any of the other PDF writers support automation? If so which one? I gather
some version of Adobe does, but am uncertain how this works or which version.

Any follow up info you could provide would be appreciated. If I have to buy a PDF writer I
certainly want to support automation with it.

Best Regards

John Baker

"Albert D. Kallal" <ka****@msn.com> wrote:
That pdf creator does not supprot automation..and thus you can't set the
file name as far as I know...


Nov 12 '05 #3
John Baker <Ba******@Verizon.net> wrote:
Do you know if any of the other PDF writers support automation? If so which one? I gather
some version of Adobe does, but am uncertain how this works or which version.


There's a list of such Creating PDF files from within Microsoft Access
http://www.granite.ab.ca/access/pdffiles.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #4
Cool - I didn't know about the new GPL PDF Creator. I've used
RedMon/Ghostscript successfully, but it does take some time to set up
properly.

On Fri, 30 Apr 2004 02:18:58 GMT, Tony Toews <tt****@telusplanet.net> wrote:
John Baker <Ba******@Verizon.net> wrote:
Do you know if any of the other PDF writers support automation? If so which one? I gather
some version of Adobe does, but am uncertain how this works or which version.


There's a list of such Creating PDF files from within Microsoft Access
http://www.granite.ab.ca/access/pdffiles.htm

Tony


Nov 12 '05 #5
TR
FinePrint's PDFFactory can be printed to prgammatially from Access. Not really via automation,
but you can use VBA to set registry values to provide filenames/locations and print 'silently'
without user intervention. Works very well.
www.fineprint.com

John Baker wrote:
Thanks for that info.

Do you know if any of the other PDF writers support automation? If so which one? I gather
some version of Adobe does, but am uncertain how this works or which version.

Any follow up info you could provide would be appreciated. If I have to buy a PDF writer I
certainly want to support automation with it.

Best Regards

John Baker

"Albert D. Kallal" <ka****@msn.com> wrote:
That pdf creator does not supprot automation..and thus you can't set the
file name as far as I know...


Nov 12 '05 #6
TR:

Thanks for that info.

Have you used PDFFactory that way? Are there detailed code instructions as to how to set
it up? I'm not highly skilled in VBA, and need a "cook book" to do things like that.
PDFFactory appears to be the least expensive solution that is capable of being controlled
through Access ($109.95), but I want to be certain I can set it up properly before I
invest in it.

Regards

John Baker

TR <t_NoSpam_redick@Mind_NoSpam_spring.com> wrote:
FinePrint's PDFFactory can be printed to prgammatially from Access. Not really via automation,
but you can use VBA to set registry values to provide filenames/locations and print 'silently'
without user intervention. Works very well.
www.fineprint.com

John Baker wrote:
Thanks for that info.

Do you know if any of the other PDF writers support automation? If so which one? I gather
some version of Adobe does, but am uncertain how this works or which version.

Any follow up info you could provide would be appreciated. If I have to buy a PDF writer I
certainly want to support automation with it.

Best Regards

John Baker

"Albert D. Kallal" <ka****@msn.com> wrote:
>That pdf creator does not supprot automation..and thus you can't set the
>file name as far as I know...


Nov 12 '05 #7
Thanks Tony, a very useful site. However some of the downloads don't appear to work, which
is a snag.

Best

John

Tony Toews <tt****@telusplanet.net> wrote:
John Baker <Ba******@Verizon.net> wrote:
Do you know if any of the other PDF writers support automation? If so which one? I gather
some version of Adobe does, but am uncertain how this works or which version.


There's a list of such Creating PDF files from within Microsoft Access
http://www.granite.ab.ca/access/pdffiles.htm

Tony


Nov 12 '05 #8
TR
There is some information here:
http://www.fineprint.com/developers/index.html

Basically you are just setting registry values, and then your report can be preset to print to
PDFFactory (the basic version is only 49.95?)
Here is a function that I have used. I edited out some stuff specific to my use, and it calls some
registry functions from the Access Developers Handbook that I have not included(but you could
substitute any similar functions, there are many examples available on the net). Hopefully you can
get an idea of whats involved from this.

Private Function PrintToPDF()
'Purpose : uses a recordset to print individual reports to pdf files
'Comments : requires Fineprint PDF printer,
' and a report with Fineprint PDF printer set,
' selected items are written out to the selected items table
' a recordset is used to group the selected item on the appropriate field
' so that a seperate report can be printed.
'Parameters:
'Sets :
'Returns :
'Created by:
'Created : 03/25/2002 4:05:12 PM
'Modified : 03/25/2002 4:05:12 PM

On Error GoTo PrintToPDF_ERR

Dim dbs As Database
Dim rstFaxList As Recordset
Dim strSQL As String
Dim tblPickedItems As String
Dim strScheduleTable As String
Dim intFaxCount As Integer
Dim intFaxDone As Integer
Dim lngRetVal As adhRegErrors
Dim strRegValue As Variant
Dim strCurrentPDFOutput As String
Dim varCurrentPDFShowDlg As Variant
Dim strUserPDFOutput As String
Dim strDefOutputFile As String
Dim strNewOutputFile As String

'save users current default pdf output path
strRegValue = Space(adhcMaxDataSize)
lngRetVal = adh_accRegGetVal(adhcHKEY_CURRENT_USER, _
"Software\FinePrint Software\pdfFactory", _
"AutoSaveDir", strRegValue, Len(strRegValue))
If lngRetVal = adhcAccErrSuccess Then
strCurrentPDFOutput = strRegValue
Else
'no defined output, assume no pdf factory installed
MsgBox "You do not have PDF Factory installed, cannot print to PDF"
GoTo PrintToPDF_EXIT
End If

'save users current default pdf output view
strRegValue = Space(adhcMaxDataSize)
lngRetVal = adh_accRegGetVal(adhcHKEY_CURRENT_USER, _
"Software\FinePrint Software\pdfFactory\FinePrinters\FinePrint
pdfFactory\PrinterDriverData", _
"ShowDlg", strRegValue, Len(strRegValue))
If lngRetVal = adhcAccErrSuccess Then
varCurrentPDFShowDlg = Asc(Mid(strRegValue, 1, 1))
Else
'no defined output, assume no pdf factory installed
MsgBox "You do not have PDF Factory installed, cannot print to PDF"
GoTo PrintToPDF_EXIT
End If

'set output path for pdf files
strUserPDFOutput = GetPathPart_TSB(CStr(CurrentDb.Name)) & "PDF_" & CurrentUser() & "_" &
Format(Now(), "yyyymmdd_hhnnss")
MkDir strUserPDFOutput
lngRetVal = adh_accRegWriteVal( _
adhcHKEY_CURRENT_USER, _
"Software\FinePrint Software\pdfFactory", _
"AutoSaveDir", strUserPDFOutput, adhcREG_SZ)
If lngRetVal = adhcAccErrSuccess Then
'ok
Else
MsgBox "Unable to set required parameters, cannot print to PDF"
GoTo PrintToPDF_EXIT
End If

'set dialog mode to silent
lngRetVal = adh_accRegWriteVal( _
adhcHKEY_CURRENT_USER, _
"Software\FinePrint Software\pdfFactory\FinePrinters\FinePrint
pdfFactory\PrinterDriverData", _
"ShowDlg", 4, adhcREG_DWORD)
If lngRetVal = adhcAccErrSuccess Then
'ok
Else
MsgBox "Unable to set required parameters, cannot print to PDF"
GoTo PrintToPDF_EXIT
End If

'get recordset of sites to print
Set dbs = CurrentDb()
strSQL = "SELECT DISTINCT siteno From tblSites "
Set rstFaxList = dbs.OpenRecordset(strSQL, dbOpenSnapshot, dbReadOnly)
If Not rstFaxList.EOF And Not rstFaxList.BOF Then
rstFaxList.MoveLast
rstFaxList.MoveFirst
intFaxCount = rstFaxList.RecordCount
End If
intFaxDone = 0
' for each siteno in recordset
Do Until rstFaxList.EOF
'set output filename via pdfFacory key
'the key is erased by pdfFactory after file is created
'print report for siteno
strNewOutputFile = strUserPDFOutput & "\Site_Scheduler_Report(Site " & rstFaxList!siteno &
").PDF"
lngRetVal = adh_accRegWriteVal( _
adhcHKEY_CURRENT_USER, _
"Software\FinePrint Software\pdfFactory", _
"OutputFile", strNewOutputFile, adhcREG_SZ)
If lngRetVal = adhcAccErrSuccess Then
'ok
Else
MsgBox "Unable to set output file (" & strNewOutputFile & "), cannot print to PDF"
GoTo PrintToPDF_EXIT
End If
DoCmd.OpenReport "rptScheduler_PDF", acViewNormal, , "siteno = '" & rstFaxList!siteno & "'"

DoEvents
'there is some time lag between printing, and erasing the ouput file key
'loop here until outputfile key no longer found
strRegValue = Space(adhcMaxDataSize)
lngRetVal = adhcAccErrSuccess
Do Until lngRetVal <> adhcAccErrSuccess
DoEvents
lngRetVal = adh_accRegGetVal(adhcHKEY_CURRENT_USER, _
"Software\FinePrint Software\pdfFactory", _
"OutputFile", strRegValue, Len(strRegValue))
Loop
'next site
intFaxDone = intFaxDone + 1
rstFaxList.MoveNext
Loop
'restore user's pdf settings for default output path and show dialog
lngRetVal = adh_accRegWriteVal( _
adhcHKEY_CURRENT_USER, _
"Software\FinePrint Software\pdfFactory", _
"AutoSaveDir", strCurrentPDFOutput, adhcREG_SZ)
lngRetVal = adh_accRegWriteVal( _
adhcHKEY_CURRENT_USER, _
"Software\FinePrint Software\pdfFactory\FinePrinters\FinePrint
pdfFactory\PrinterDriverData", _
"ShowDlg", varCurrentPDFShowDlg, adhcREG_DWORD)

PrintToPDF_EXIT:
On Error Resume Next
If Not (rstFaxList Is Nothing) Then rstFaxList.Close: Set rstFaxList = Nothing
If Not (dbs Is Nothing) Then Set dbs = Nothing
Exit Function

PrintToPDF_ERR:
Select Case Err
Case 0 'insert Errors you wish to ignore here
Resume Next
Case Else 'All other errors will trap
Msgbox "Error: " & Err & ", " & Error,vbExclamation,"Error in PrintToPDF"
Resume PrintToPDF_EXIT
End Select
End Function

John Baker wrote:
TR:

Thanks for that info.

Have you used PDFFactory that way? Are there detailed code instructions as to how to set
it up? I'm not highly skilled in VBA, and need a "cook book" to do things like that.
PDFFactory appears to be the least expensive solution that is capable of being controlled
through Access ($109.95), but I want to be certain I can set it up properly before I
invest in it.

Regards

John Baker

TR <t_NoSpam_redick@Mind_NoSpam_spring.com> wrote:
FinePrint's PDFFactory can be printed to prgammatially from Access. Not really via automation,
but you can use VBA to set registry values to provide filenames/locations and print 'silently'
without user intervention. Works very well.
www.fineprint.com

John Baker wrote:
Thanks for that info.

Do you know if any of the other PDF writers support automation? If so which one? I gather
some version of Adobe does, but am uncertain how this works or which version.

Any follow up info you could provide would be appreciated. If I have to buy a PDF writer I
certainly want to support automation with it.

Best Regards

John Baker

"Albert D. Kallal" <ka****@msn.com> wrote:

>That pdf creator does not supprot automation..and thus you can't set the
>file name as far as I know...


Nov 12 '05 #9
TR
Also, I believe you can download a trial version and try this out as well.

John Baker wrote:
TR:

Thanks for that info.

Have you used PDFFactory that way? Are there detailed code instructions as to how to set
it up? I'm not highly skilled in VBA, and need a "cook book" to do things like that.
PDFFactory appears to be the least expensive solution that is capable of being controlled
through Access ($109.95), but I want to be certain I can set it up properly before I
invest in it.

Regards

John Baker

TR <t_NoSpam_redick@Mind_NoSpam_spring.com> wrote:
FinePrint's PDFFactory can be printed to prgammatially from Access. Not really via automation,
but you can use VBA to set registry values to provide filenames/locations and print 'silently'
without user intervention. Works very well.
www.fineprint.com

John Baker wrote:
Thanks for that info.

Do you know if any of the other PDF writers support automation? If so which one? I gather
some version of Adobe does, but am uncertain how this works or which version.

Any follow up info you could provide would be appreciated. If I have to buy a PDF writer I
certainly want to support automation with it.

Best Regards

John Baker

"Albert D. Kallal" <ka****@msn.com> wrote:

>That pdf creator does not supprot automation..and thus you can't set the
>file name as far as I know...


Nov 12 '05 #10
"John Baker" <Ba******@Verizon.net> wrote in message
news:de********************************@4ax.com...
Thanks for that info.

Do you know if any of the other PDF writers support automation? If so which one? I gather some version of Adobe does, but am uncertain how this works or which version.
Any follow up info you could provide would be appreciated. If I have to buy a PDF writer I certainly want to support automation with it.

pdf995 stores output file name and folder info in an .ini file. All you need
to do is edit the .ini file in code. It's simple and very inexpensive..
Nov 12 '05 #11
"John Winterbottom" <as******@hotmail.com> wrote in message
news:c6************@ID-185006.news.uni-berlin.de...
"John Baker" <Ba******@Verizon.net> wrote in message
news:de********************************@4ax.com...
Thanks for that info.

Do you know if any of the other PDF writers support automation? If so which one? I gather
some version of Adobe does, but am uncertain how this works or which

version.

Any follow up info you could provide would be appreciated. If I have to

buy a PDF writer I
certainly want to support automation with it.

pdf995 stores output file name and folder info in an .ini file. All you

need to do is edit the .ini file in code. It's simple and very inexpensive..

http://www.pdf995.com
Nov 12 '05 #12
On Fri, 30 Apr 2004 11:47:27 -0400, "John Winterbottom" <as******@hotmail.com>
wrote:
"John Winterbottom" <as******@hotmail.com> wrote in message
news:c6************@ID-185006.news.uni-berlin.de...
"John Baker" <Ba******@Verizon.net> wrote in message
news:de********************************@4ax.com...
> Thanks for that info.
>
> Do you know if any of the other PDF writers support automation? If so

which one? I gather
> some version of Adobe does, but am uncertain how this works or which

version.
>
> Any follow up info you could provide would be appreciated. If I have to

buy a PDF writer I
> certainly want to support automation with it.
>

pdf995 stores output file name and folder info in an .ini file. All you

need
to do is edit the .ini file in code. It's simple and very inexpensive..

http://www.pdf995.com


One of my clients has used pdf995 from Access this way and had good things to
say about it.
Nov 12 '05 #13
"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:t0********************************@4ax.com...
On Fri, 30 Apr 2004 11:47:27 -0400, "John Winterbottom" <as******@hotmail.com> wrote:


http://www.pdf995.com

One of my clients has used pdf995 from Access this way and had good things

to say about it.

I think it's a good solution. It's certainly the most cost-effective one
that I've found. Quality is acceptable. The only problem I've found is when
running under terminal services; there is only one .ini file - you can't
specify a different .ini file for each user, even if you have multiple
licenses. So you have to make sure only one person is generating pdf's at
any one time or else there can be a clash.
Nov 12 '05 #14
On Thu, 29 Apr 2004 23:52:21 GMT, John Baker <Ba******@Verizon.net>
wrote:
Do you know if any of the other PDF writers support automation? If so which one? I gather
some version of Adobe does, but am uncertain how this works or which version.


I use WIn2PDF and automate the generation of PDFs from both Access and
Excel, including assiging the file name, using Registry entries.
However, it does require Windows XP, NT, or 2000.

See
http://www.daneprairie.com/products/win2pdf.htm
Steven Zuch
Cogent Management Inc.
Nov 12 '05 #15
Thansk to you all.

This sounds like a great solution.

Could someone give me a sample of the code that i would uise to edit the .ini file? I have
never done much in Code in Access, concentarting mosty on macros.

Thanks a lot

John

"John Winterbottom" <as******@hotmail.com> wrote:
"John Baker" <Ba******@Verizon.net> wrote in message
news:de********************************@4ax.com.. .
Thanks for that info.

Do you know if any of the other PDF writers support automation? If so

which one? I gather
some version of Adobe does, but am uncertain how this works or which

version.

Any follow up info you could provide would be appreciated. If I have to

buy a PDF writer I
certainly want to support automation with it.

pdf995 stores output file name and folder info in an .ini file. All you need
to do is edit the .ini file in code. It's simple and very inexpensive..


Nov 12 '05 #16
I have downloaded the Win2PDF. It installed easily and the simple
commands work fine.

For example:
SaveSetting "Dane Prairie Systems", "Win2PDF", "PDFFileName", PathName

works just fine, but the commands that set the registry items are not
working. I pasted their code in, but when I call the routines:

SaveWin2PDFDword "file options", 0x02

It either does not work at all or says it's the wrong type. How do
you get the hex to work?

Their samples are VB, is that the problem? It would be great if
someone had some sample code similar to that which the earlier poster
put up for pdfFactory.

Thanks,

Tony

st***@nospam.com (Steve) wrote in message news:<40***************@news.westnet.com>...
On Thu, 29 Apr 2004 23:52:21 GMT, John Baker <Ba******@Verizon.net>
wrote:
Do you know if any of the other PDF writers support automation? If so which one? I gather
some version of Adobe does, but am uncertain how this works or which version.


I use WIn2PDF and automate the generation of PDFs from both Access and
Excel, including assiging the file name, using Registry entries.
However, it does require Windows XP, NT, or 2000.

See
http://www.daneprairie.com/products/win2pdf.htm
Steven Zuch
Cogent Management Inc.

Nov 12 '05 #17
SA
John:

Our PDF and Mail Library for Access may be an option. It supports
outputting PDF files using any of the following drivers:

Adobe drivers (versions 3-6)
Win2PDF
pdfFactory
PDF 995
PDF 4 U
Amyuni PDF Converter

Certainly one could spend hours getting the programming right with any
particular driver, our library provides a quick, in-expensive solution to
"automate" output with any of those drivers, including securing files (PDF
Pro Plus edition), merging files, adding book marks etc. Code is as simple
as:

Const PDFENGINE_ADOBE_PDF = 2

Dim objPDF as New PDFClass
With objPDF
.ReportName = "Your Report"
.ReportWhere = "Some SQL Filter"
.PDFEngine = PDFENGINE_ADOBE_PDF
.OutputFile = "c:\some dir\some file.pdf"
.PrintImage
Debug.print .Result
End With

You'll find the library on our web site in the developer tools area.
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

"John Baker" <Ba******@Verizon.net> wrote in message
news:de********************************@4ax.com...
Thanks for that info.

Do you know if any of the other PDF writers support automation? If so
which one? I gather
some version of Adobe does, but am uncertain how this works or which
version.

Any follow up info you could provide would be appreciated. If I have to
buy a PDF writer I
certainly want to support automation with it.

Best Regards

John Baker

"Albert D. Kallal" <ka****@msn.com> wrote:
That pdf creator does not supprot automation..and thus you can't set the
file name as far as I know...



Nov 12 '05 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John Baker | last post by:
Hi: I need some help writing code that will "print" a report using Cute FTP. Specifically, I need to set up a "Button" which, when clicked, will: a. Create an FTP "Print" file of the...
16
by: John Baker | last post by:
HI; I feel like a fool..I put CUTE FTP in my last request for help --it should have been CUTE PDF! I have FTP on my mind because I have been working on a web based application, and somehow my...
2
by: David C | last post by:
I am looking for a way to - loop through PDF files - Within each pdf file, split it into two files (page 1 to file, and the rest to another, for example). So one PDF file gets split into two....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.