Rabu, 21 September 2011

[MS_AccessPros] Re: Output Report to PDF

 

Thanks Dave! I am testing out code, but you have filled in the gaps between what I saw on the bullzip site for options and how to implement them in code. Thanks for the extra comments.

--- In MS_Access_Professionals@yahoogroups.com, "brian.rogoski" <brian.rogoski@...> wrote:
>
> Tim,
>
> Here's the code I use to generate the runonce.ini file. The file itself gets deleted after a printing occurs, so each time you fire off the event, you have to create a new ini file. See the comments within the code for an explanation of each bit.
>
> This web page details all the different options you can set in the ini file.
>
> http://www.bullzip.com/products/pdf2/doc/info.php
>
> Sub ReportPdf(strReportName As String, strPdfFileName As String)
> 'don't forget in strPdfFilename you have to specifiy the entire file
> 'name including the directory you want it to save to.
> Dim strRunOnce As String
> Dim intLoop As Integer
> Dim strTemp As String
> Dim fs As New Scripting.FileSystemObject
> Dim strLastFile As String
> Dim bz As New Bullzip.PDFPrinterSettings
> 'do dimension this variable you'll need to add a reference to your
> 'bullzip pdf dll file located at system32\bzpdfc.dll
>
> 'This is the output of the actual ini file. we use this to...
> strRunOnce = Environ("APPDATA") & "\Bullzip\PDF Printer\runonce.ini"
> '... check to make sure another print job isn't happening. and then...
> Do Until Not fs.FileExists(strRunOnce)
> 'wait half a second, and then try again. if the created date of the
> 'ini file is more then 15 minutes, we just delete and print anyway.
> 'The assumption here is that this left over from a failed print job
>
> If DateDiff("n", fs.GetFile(strRunOnce).DateCreated, Now) > 15 Then fs.DeleteFile strRunOnce, False
>
> Sleep 5000
> Loop
>
> Set fs = Nothing
>
> 'set the current printer to the bullzp printer.
> Set Application.Printer = Application.Printers("Bullzip PDF Printer")
> 'output location
> 'here is where the actual file gets created by that dll.
> 'if you don't want to add the dll to the references, you
> 'could just create the runonce.ini file using a text stream
> 'i'm not sure of the formatting though
>
> 'here, in order to do the username password thing, you'd use
> 'bz.SetValue "OwnerPassword", "PASSWORD"' for the "owner password"
> 'bz.Setvalue "UserPassword", "PASSWORD"'for the "user password
> bz.SetValue "output", strPdfFileName
> bz.SetValue "showsettings", "never"
> bz.SetValue "showpdf", "no"
> bz.SetValue "confirmoverwrite", "no"
> bz.WriteSettings True
> 'and print the report
> DoCmd.OpenReport strReportName
> Set bz = Nothing
> End Sub
>
>
> --- In MS_Access_Professionals@yahoogroups.com, "juiceplustim" <tritter@> wrote:
> >
> > I am using Bullzip in an application and would be very interested in hearing more about how you set the print job up beforehand in Access by creating the ini file. Specifically we would also like to be able to set the owner/user password in Bullzip to create a secure PDF file, along with the name, location, etc. for single reports or batches of reports.
> > Thanks Brian,
> > Tim Ritter
> > P.S. Sorry I don't post much, but I have gotten a lot from many of you through the past couple of years watching this group.
> >
> > --- In MS_Access_Professionals@yahoogroups.com, "brian.rogoski" <brian.rogoski@> wrote:
> > >
> > > Stan,
> > >
> > > I do this sort of thing all the time. What pdf creator are you using, and how do you create them?
> > >
> > > The PDF maker I use installs on the computer as a printer, and we can generate an ini file that will set the output location, file type, etc of the document we're printing. The program is called bullzip.
> > >
> > > The documentation of the PDF creator you use may specify how to set these variables.
> > >
> > > --- In MS_Access_Professionals@yahoogroups.com, "Stan Helmle" <shelmle@> wrote:
> > > >
> > > > I have an interesting project where I need to generate 5500 individual PDF documents from an Access database. They must each be assigned a specific name that will be referenced in an XML file from the same Access database.
> > > >
> > > > Everything is done except the PDF creator I'm using thinks it must open each document being created and then ask me where I want to save it. Any advice this group can provide will be greatly appreciated.
> > > >
> > > > To summarize: 5500 pdf documents each with specific name (to be converted to a TIFF) along with an XML file from the same Access database.
> > > >
> > > > Stan
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > >
> >
>

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar