473,405 Members | 2,404 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,405 software developers and data experts.

PDF Creation

Hi

Is there a way to create pdf of reports from within access?

Thanks

Regards
Nov 13 '05 #1
9 1949
On Wed, 23 Jun 2004 18:31:47 +0100, "John" <jo**@nospam.infovis.co.uk>
wrote:
Hi

Is there a way to create pdf of reports from within access?

Thanks

Regards

Yes. You simply need a pdf writer on your system. It is installed like
a printer. Print the report using the pdf printer.

One open source (and free) way that I have used on many different OS's
is the Redmon/Ghostscript setup. It has worked well for me.

http://www.freewebs.com/coandco/faqs...TO_Images.html

- Jim
Nov 13 '05 #2
"John" <jo**@nospam.infovis.co.uk> wrote:
Is there a way to create pdf of reports from within access?


Also see 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 13 '05 #3
RE/
Is there a way to create pdf of reports from within access?


Do you mean automagically - as in running a batch of reports unattended once the
process is started?
--
PeteCresswell
Nov 13 '05 #4
"John" <jo**@nospam.infovis.co.uk> wrote in message news:<40*********************@news-text.dial.pipex.com>...
Hi

Is there a way to create pdf of reports from within access?

Thanks

Regards


This is a great idea. Basic reports have all the information
available such as text box locations and fonts. One problem is that
many of the fonts used in reports are not standard PostScript fonts
and will entail dealing with embedding fonts. There is no legal issue
since the report will not be edited in e.g., Acrobat later. If you
want to do things like Centering, Left or Right justification then it
will be necessary to know how much room your font is going to take up.
If there is not a lot of kerning (typical) then using the Font Metrics
for the given font will give you a good approximation to the space
used by the string. Font Metrics can usually be found in the font's
..afm file. For reasons I won't go into now, the .afm file is not
always easy to come by so an empirical approach may be required to get
the character widths. The following function is an example:

Public Function GetFontWidth(strIn As String, strFontName As String,
dblFontSize As Double) As Double
Dim lngTemp As Long
Dim MetricRS As Recordset
Dim MyDB As Database
Dim strSQL As String
Dim intI As Integer
Dim strChar As String
Dim lngASC As Long

GetFontWidth = 0#
If Len(strIn) = 0 Then Exit Function
lngTemp = 0
Set MyDB = CurrentDb
strSQL = "SELECT * FROM tbl" & strFontName & "Metrics;"
Set MetricRS = MyDB.OpenRecordset(strSQL, dbOpenSnapshot)
For intI = 1 To Len(strIn)
strChar = Mid(strIn, intI, 1)
lngASC = Asc(strChar)
MetricRS.FindFirst "[ASCIINumber] = " & CStr(lngASC)
If Not MetricRS.NoMatch Then
lngTemp = lngTemp + MetricRS("Width")
End If
Next intI
MetricRS.Close
Set MetricRS = Nothing
Set MyDB = Nothing
GetFontWidth = lngTemp * dblFontSize / 1000#
End Function

It can be called like:
dblFontWidth = GetFontWidth(Nz(txtPhone.Value, ""), "HelveticaBold",
9.5)

Then you would use the x coordinate of the center of the box minus
dblFontWidth / 2 in your centering function.

Note that pdf strings need to have certain characters transformed in
order to be printed out literally:

Function TLit(strIn As String) As String
Dim strTemp As String
Dim intI As Integer
Dim strChar As String

'Transform Literals
TLit = ""
If Len(strIn) = 0 Then Exit Function
For intI = 1 To Len(strIn)
strChar = Mid(strIn, intI, 1)
Select Case strChar
Case "\":
strTemp = strTemp & "\\"
Case "(":
strTemp = strTemp & "\("
Case ")":
strTemp = strTemp & "\)"
Case Else
strTemp = strTemp & strChar
End Select
Next intI
TLit = strTemp
End Function

Non-linearized pdf files can be generated from scratch directly in
Access using strings. Linearized pdf files can also be done using
strings if you are judicious about which end is used for appending.
If you are going to roll your own pdf files plan on spending at least
a few months. My priority is to get this done in a more OOP way by
creating pdf object type definitions in VBA that, among other things,
allow them to link to each other and allow an easy way to calculate
their size. After that is done I will take a serious look at writing
something that will automatically convert an Access Report into a set
of function calls that will create a pdf file. I have already done
some ad hoc reports that fill in an arbitrary number of rows from a
recordset onto pdf pages including text justification and word wrap.
I see no reason why the routines I've mentioned cannot be placed in a
DLL. Unfortunately, these plans will take some time and will not
solve your problem for awhile.

James A. Fortune
Nov 13 '05 #5
"John" <jo**@nospam.infovis.co.uk> wrote in message news:<40*********************@news-text.dial.pipex.com>...
Hi

Is there a way to create pdf of reports from within access?

Thanks

Regards


This is a great idea. Basic reports have all the information
available such as text box locations and fonts. One problem is that
many of the fonts used in reports are not standard PostScript fonts
and will entail dealing with embedding fonts. There is no legal issue
since the report will not be edited in e.g., Acrobat later. If you
want to do things like Centering, Left or Right justification then it
will be necessary to know how much room your font is going to take up.
If there is not a lot of kerning (typical) then using the Font Metrics
for the given font will give you a good approximation to the space
used by the string. Font Metrics can usually be found in the font's
..afm file. For reasons I won't go into now, the .afm file is not
always easy to come by so an empirical approach may be required to get
the character widths. The following function is an example:

Public Function GetFontWidth(strIn As String, strFontName As String,
dblFontSize As Double) As Double
Dim lngTemp As Long
Dim MetricRS As Recordset
Dim MyDB As Database
Dim strSQL As String
Dim intI As Integer
Dim strChar As String
Dim lngASC As Long

GetFontWidth = 0#
If Len(strIn) = 0 Then Exit Function
lngTemp = 0
Set MyDB = CurrentDb
strSQL = "SELECT * FROM tbl" & strFontName & "Metrics;"
Set MetricRS = MyDB.OpenRecordset(strSQL, dbOpenSnapshot)
For intI = 1 To Len(strIn)
strChar = Mid(strIn, intI, 1)
lngASC = Asc(strChar)
MetricRS.FindFirst "[ASCIINumber] = " & CStr(lngASC)
If Not MetricRS.NoMatch Then
lngTemp = lngTemp + MetricRS("Width")
End If
Next intI
MetricRS.Close
Set MetricRS = Nothing
Set MyDB = Nothing
GetFontWidth = lngTemp * dblFontSize / 1000#
End Function

It can be called like:
dblFontWidth = GetFontWidth(Nz(txtPhone.Value, ""), "HelveticaBold",
9.5)

Then you would use the x coordinate of the center of the box minus
dblFontWidth / 2 in your centering function.

Note that pdf strings need to have certain characters transformed in
order to be printed out literally:

Function TLit(strIn As String) As String
Dim strTemp As String
Dim intI As Integer
Dim strChar As String

'Transform Literals
TLit = ""
If Len(strIn) = 0 Then Exit Function
For intI = 1 To Len(strIn)
strChar = Mid(strIn, intI, 1)
Select Case strChar
Case "\":
strTemp = strTemp & "\\"
Case "(":
strTemp = strTemp & "\("
Case ")":
strTemp = strTemp & "\)"
Case Else
strTemp = strTemp & strChar
End Select
Next intI
TLit = strTemp
End Function

Non-linearized pdf files can be generated from scratch directly in
Access using strings. Linearized pdf files can also be done using
strings if you are judicious about which end is used for appending.
If you are going to roll your own pdf files plan on spending at least
a few months. My priority is to get this done in a more OOP way by
creating pdf object type definitions in VBA that, among other things,
allow them to link to each other and allow an easy way to calculate
their size. After that is done I will take a serious look at writing
something that will automatically convert an Access Report into a set
of function calls that will create a pdf file. I have already done
some ad hoc reports that fill in an arbitrary number of rows from a
recordset onto pdf pages including text justification and word wrap.
I see no reason why the routines I've mentioned cannot be placed in a
DLL. Unfortunately, these plans will take some time and will not
solve your problem for awhile.

James A. Fortune
Nov 13 '05 #6
On 24 Jun 2004 22:29:06 -0700, ja******@oakland.edu (James Fortune)
wrote:
"John" <jo**@nospam.infovis.co.uk> wrote in message news:<40*********************@news-text.dial.pipex.com>...
Hi

Is there a way to create pdf of reports from within access?

Thanks

Regards


This is a great idea. Basic reports have all the information
available such as text box locations and fonts. One problem is that
many of the fonts used in reports are not standard PostScript fonts
and will entail dealing with embedding fonts. There is no legal issue
since the report will not be edited in e.g., Acrobat later. If you
want to do things like Centering, Left or Right justification then it
will be necessary to know how much room your font is going to take up.
If there is not a lot of kerning (typical) then using the Font Metrics
for the given font will give you a good approximation to the space
used by the string. Font Metrics can usually be found in the font's
.afm file. For reasons I won't go into now, the .afm file is not
always easy to come by so an empirical approach may be required to get
the character widths. The following function is an example:


I have a great idea for an invention.

It is essentially based on observations regarding circularity and
roundness and how exploiting their properties we might be able to
create things that would assist us greatly in moving things about.

I also have a working name for this invention - the wheel.

Unless anyone has already heard of something like it, I think I
proceed with a patent application.

;-)

Nov 13 '05 #7
"Jim Allensworth" <ji****@Notdatacentricsolutions.com> wrote in message news:<40*****************@news.west.earthlink.net> ...
On 24 Jun 2004 22:29:06 -0700, ja******@oakland.edu (James Fortune)
wrote:
"John" <jo**@nospam.infovis.co.uk> wrote in message news:<40*********************@news-text.dial.pipex.com>...
Hi

Is there a way to create pdf of reports from within access?

I have a great idea for an invention.

It is essentially based on observations regarding circularity and
roundness and how exploiting their properties we might be able to
create things that would assist us greatly in moving things about.

I also have a working name for this invention - the wheel.

Unless anyone has already heard of something like it, I think I
proceed with a patent application.

;-)


Boy, I'm glad I saw that smiley :-). I agree that many companies have
created products that enable users to print to a pdf print driver and
get the Access Reports printed. Some are even free. So why don't I
just use them? One of the things I noticed in creating custom pdf
files was that it became possible to create formats for reports that
are not possible using the Access report generator. Distiller is
great but if they don't have Acrobat I am forcing them to buy both my
software and Acrobat. Even some of the free converters include
language that requires a license for commercial applications. I think
Acrobat requires a per-seat license for Distiller. I'm discovering
that there is tremendous interest in merging database and pdf
capabilities. I like being able to develop my own libraries for
creating different effects in pdf. For me, I see an advantage to
being able to do it all in Access. Others may not.

James A. Fortune
Nov 13 '05 #8
On 27 Jun 2004 13:49:54 -0700, ja******@oakland.edu (James Fortune)
wrote:

Boy, I'm glad I saw that smiley :-). I agree that many companies have
created products that enable users to print to a pdf print driver and
get the Access Reports printed. Some are even free. So why don't I
just use them? One of the things I noticed in creating custom pdf
files was that it became possible to create formats for reports that
are not possible using the Access report generator.
What do mean by "formats"?
Distiller is
great but if they don't have Acrobat I am forcing them to buy both my
software and Acrobat. Even some of the free converters include
language that requires a license for commercial applications. I think
Acrobat requires a per-seat license for Distiller.
You don't want them to buy additional software but you want to charge
them to create new software that does (hopefully) what has already
been done?

I don't use Distiller. The free open-source Ghostscript approach has
worked quite well for me. I have installed it on Win OS's from Win95
to XP without a hitch.
I'm discovering
that there is tremendous interest in merging database and pdf
capabilities. I like being able to develop my own libraries for
creating different effects in pdf. For me, I see an advantage to
being able to do it all in Access. Others may not.


Of course there is lots of interest; PDF has become the standard for
portability in docs. Virtually everyone has Acrobat - and if not it is
readilly available.

AFAICS, creating an all-Access PDF generator is not trivial. The big
question is why bother?

Why reinvent the wheel?

- Jim
Nov 13 '05 #9
>On 27 Jun 2004 13:49:54 -0700, ja******@oakland.edu (James Fortune)
wrote:

Boy, I'm glad I saw that smiley :-). I agree that many companies havecreated products that enable users to print to a pdf print driver andget the Access Reports printed. Some are even free. So why don't I
just use them? One of the things I noticed in creating custom pdf
files was that it became possible to create formats for reports that
are not possible using the Access report generator. What do mean by "formats"?
What I mean by formats is finely detailed Titles, Labels, lines with
finely controlled thicknesses, color shading, customized shadow
effects, the ability to break free of Report Details constraints,
custom bordor effects and other possibilities that can usually be
accomplished by having a print shop at your disposal.
Distiller is
great but if they don't have Acrobat I am forcing them to buy both mysoftware and Acrobat. Even some of the free converters include
language that requires a license for commercial applications. I thinkAcrobat requires a per-seat license for Distiller. You don't want them to buy additional software but you want to charge
them to create new software that does (hopefully) what has already
been done?
When I say "my software" I am not talking about the pdf generation
part. I expect to create software that uses the capability to make
pdf to do things such as create tournament brackets and automatically
fill in the slots. I don't want someone who is buying the tournament
software to have to buy Acrobat. Other applications might be for
companies that already have Acrobat so the "default" idea of this NG
to use the printer driver approach is O.K.
I don't use Distiller. The free open-source Ghostscript approach has
worked quite well for me. I have installed it on Win OS's from Win95
to XP without a hitch.
Even though Ghostscript is Open Source if you look closely at the
agreement you will see that for commercial applications you are
supposed to pay the shareware fee or whatever it's called.
I'm discovering
that there is tremendous interest in merging database and pdf
capabilities. I like being able to develop my own libraries for
creating different effects in pdf. For me, I see an advantage to
being able to do it all in Access. Others may not.

Of course there is lots of interest; PDF has become the standard for
portability in docs. Virtually everyone has Acrobat - and if not it isreadilly available. AFAICS, creating an all-Access PDF generator is not trivial. The big
question is why bother? Why reinvent the wheel?
BTW, I do have an automotive patent (# 5,603,240). AFAICS, you
shouldn't bother doing it. The PDF generation, except when converting
PostScript, is merely a document converter. I have looked at nearly
all of the PDF converters, including the Acrobat SDK, pdf995,
Distiller and UNIX versions. I see value in me doing it. Document
translation is not my goal. With most of the capabilities of
PostScript available, you don't have to settle for less when you need
more.
- Jim


Note: My newsreader was not able to reply to Jim's latest post so I am
replying to an earlier one.

James A. Fortune
Nov 13 '05 #10

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

Similar topics

5
by: [ EuGeNe ] | last post by:
Hi all, I would like to write a script that downloads one file from a ftp server if the file creation date satisfy a condition. I can't figure out how to find from a ftp server what is the...
3
by: SK | last post by:
I have a file. i get the creation time using File.GetCreationTime. then i go and delete that file. and then create it again and print the File.GetCreationTime. It is giving me the old creation...
6
by: | last post by:
I have a class with overloading operator new. (Because, if an identical object exists, return a pointer to existed object instead of a new pointer) It has no sense (it is dangerous) to allocate an...
2
by: David Fickbohm | last post by:
People, I am trying to determine the creation date of files in a folder. I am using the following code to find the folder and confirm that files exist in the folder. If someone could give me an...
5
by: Tompa | last post by:
Hi, I would like to create images on the fly as a response to an http request. I can do this with PIL like this (file create_gif.py): from PIL import Image, ImageDraw print 'Status: 200 OK'...
1
by: chettiar | last post by:
Hi, I am dropping an index and recreating it to lower the high water mark. The index creation is taking a lot of time. I am stuck as to why it does so. Is there any way that I can find out why...
0
by: Pluton | last post by:
Hello, I would like to know if you are informed of one (or several!) good book, document (memory, tutorial, etc...) or site concerning the creation of controls? I am rather interested in...
3
by: Steven Blair | last post by:
Hi, I have a trace log file for a system I am writing. If the creation date is older than 14 days, I have to rename that file (File.Move). The next time a trace message is required a new file is...
8
by: Anthony Munter | last post by:
I have a web application with impersonate=”true” in Web.config and on my own logon page I allow the user to either - specify a userid/password for the app to impersonate when calling legacy...
3
by: Nick Dreyer | last post by:
I was quite surprised to notice that Sub New() gets called twice, once at declaration time and once at creation time. I can't figure out why it would be called at declaration if there is no class...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.