dbTalk Databases Forums  

ConvertReporttoPDF

comp.databases.ms-access comp.databases.ms-access


Discuss ConvertReporttoPDF in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
musicloverlch
 
Posts: n/a

Default ConvertReporttoPDF - 05-17-2011 , 09:15 AM






So, I was happily using the ConvertReporttoPDF function (http://
www.lebans.com/reporttopdf.htm) in my Access 2k3 compatiable database.

Now suddenly, it is printing everything in landscape. It takes a
report that is setup to print in portrait (which works fine in preview
or print) and blows it up to landscape and cuts off the bottom half of
the report.

Has this happened to you? How else can I send reports out to PDF? I'm
willing to buy something.

Thanks in advance,
Laura

Reply With Quote
  #2  
Old   
James A. Fortune
 
Posts: n/a

Default Re: ConvertReporttoPDF - 05-17-2011 , 09:50 AM






On May 17, 10:15*am, musicloverlch <lho... (AT) gmail (DOT) com> wrote:
Quote:
So, I was happily using the ConvertReporttoPDF function (http://www.lebans.com/reporttopdf.htm) in my Access 2k3 compatiable database.

Now suddenly, it is printing everything in landscape. *It takes a
report that is setup to print in portrait (which works fine in preview
or print) and blows it up to landscape and cuts off the bottom half of
the report.

Has this happened to you? How else can I send reports out to PDF? I'm
willing to buy something.

Thanks in advance,
Laura
This is a shot in the dark. Before buying something, try the
following. I don't know the extent of his PDF linearization or
compression, but if the pdf is editable in Notepad or Word (using
Files of Type: 'All Files' when opening the file), try replacing:

/MediaBox [0 0 792 612]
/CropBox [0 0 792 612]

with

/MediaBox [0 0 612 792]
/CropBox [0 0 612 792]

- actually, just the '792 612' part with '612 792',

if they exist. That change will not affect the binary length
calculations used by the PDF format for its XREF table and should
change the orientation from Landscape to Portrait.

James A. Fortune
CDMAPoster (AT) FortuneJames (DOT) com

Reply With Quote
  #3  
Old   
musicloverlch
 
Posts: n/a

Default Re: ConvertReporttoPDF - 05-17-2011 , 10:24 AM



I need to for it to work in Access. I can't open each PDF after it's
created to change those fields.

Thanks,
Laura


On May 17, 9:50*am, "James A. Fortune" <CDMAPos... (AT) FortuneJames (DOT) com>
wrote:
Quote:
On May 17, 10:15*am, musicloverlch <lho... (AT) gmail (DOT) com> wrote:

So, I was happily using the ConvertReporttoPDF function (http://www.lebans.com/reporttopdf.htm) in my Access 2k3 compatiable database.

Now suddenly, it is printing everything in landscape. *It takes a
report that is setup to print in portrait (which works fine in preview
or print) and blows it up to landscape and cuts off the bottom half of
the report.

Has this happened to you? How else can I send reports out to PDF? I'm
willing to buy something.

Thanks in advance,
Laura

This is a shot in the dark. *Before buying something, try the
following. *I don't know the extent of his PDF linearization or
compression, but if the pdf is editable in Notepad or Word (using
Files of Type: 'All Files' when opening the file), try replacing:

/MediaBox [0 0 792 612]
/CropBox [0 0 792 612]

with

/MediaBox [0 0 612 792]
/CropBox [0 0 612 792]

- actually, just the '792 612' part with '612 792',

if they exist. *That change will not affect the binary length
calculations used by the PDF format for its XREF table and should
change the orientation from Landscape to Portrait.

James A. Fortune
CDMAPos... (AT) FortuneJames (DOT) com

Reply With Quote
  #4  
Old   
musicloverlch
 
Posts: n/a

Default Re: ConvertReporttoPDF - 05-17-2011 , 11:33 AM



I found the problem. Access 2007/2010 really don't do the Snapshot view anymore.

Reply With Quote
  #5  
Old   
James A. Fortune
 
Posts: n/a

Default Re: ConvertReporttoPDF - 05-17-2011 , 01:31 PM



On May 17, 11:24*am, musicloverlch <lho... (AT) gmail (DOT) com> wrote:
Quote:
I need to for it to work in Access. I can't open each PDF after it's
created to change those fields.
I'm glad you found the problem. I never used the snapshot viewer for
my conversions to PDF, so I never encountered that difficulty. It
seems odd that the snapshot viewer would cause a change from portrait
to landscape given how easy it is to set. I used to use GhostScript
to convert Access generated PostScript files before using Access to
generate the PDF directly. IIRC, GhostScript had a default setting
for either portrait or landscape. That would sometimes cause problems
for users. But again, I don't know enough of the details of his PDF
conversion to be able to allow you to adapt it to a situation that
doesn't involve the snapshot view.

James A. Fortune
CDMAPoster (AT) FortuneJames (DOT) com

Reply With Quote
  #6  
Old   
Jim Devenish
 
Posts: n/a

Default Re: ConvertReporttoPDF - 05-18-2011 , 08:57 AM



On May 17, 10:15*am, musicloverlch <lho... (AT) gmail (DOT) com> wrote:
Quote:
So, I was happily using the ConvertReporttoPDF function (http://www.lebans.com/reporttopdf.htm) in my Access 2k3 compatiable database.

Now suddenly, it is printing everything in landscape. *It takes a
report that is setup to print in portrait (which works fine in preview
or print) and blows it up to landscape and cuts off the bottom half of
the report.

Has this happened to you? How else can I send reports out to PDF? I'm
willing to buy something.

Thanks in advance,
Laura
I had exactly this problem recently. The Lebans approach does not work
in A2010. However there is a direct approach. I am away from my system
at the moment so cannot look up the precise method. There is a new
command something like PrintToPdf. Look it up in the Help.

This has one problem. It does not filter for specific records.
Immediately precede this with OpenReport in printPreview and with
acHidden.

Give it a try

Kim

Reply With Quote
  #7  
Old   
(PeteCresswell)
 
Posts: n/a

Default Re: ConvertReporttoPDF - 05-18-2011 , 02:20 PM



Per musicloverlch:
Quote:
Has this happened to you? How else can I send reports out to PDF? I'm
willing to buy something.
I've been using the freebie "CutePDF".

Looks like another printer, just sent the report to "CutePDF"
instead of an actual printer....

Haven't had the opportunity to do it in VBA (i.e.
programmatically specify the DSN of the output file and
so-forth)... but if there is an interface I wouldn't thing it's
all that hard.
--
PeteCresswell

Reply With Quote
  #8  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: ConvertReporttoPDF - 05-18-2011 , 02:53 PM



"(PeteCresswell)" <x@y.Invalid> wrote in
news:9s68t65ssikpth1ape1d9mjnqnra2mhhjo (AT) 4ax (DOT) com:

Quote:
Per musicloverlch:
Has this happened to you? How else can I send reports out to PDF?
I'm willing to buy something.

I've been using the freebie "CutePDF".

Looks like another printer, just sent the report to "CutePDF"
instead of an actual printer....

Haven't had the opportunity to do it in VBA (i.e.
programmatically specify the DSN of the output file and
so-forth)... but if there is an interface I wouldn't thing it's
all that hard.
Based on the code listed here:

http://www.cutepdf.com/solutions/pdfwriter3.asp

....it doesn't really seem to me that CutePDF is actually automatable
by VBA. What that code does is change registry keys so that when the
CutePDF driver is used, the settings are appropriate.

An alternative that is really automatable via VBA is PDFCreator,
which I've had in production us for nearly two years in two
different client apps. It's a little fussy on some things, but it
really does have the COM interface, which it doesn't seem to me that
CutePDF does.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #9  
Old   
musicloverlch
 
Posts: n/a

Default Re: ConvertReporttoPDF - 06-01-2011 , 02:45 PM



I have users on Access 2003, Access 2007, and Access 2010 and the PDF
output choice isn't recognized by 2003.

What I ended up doing is adding this function:

Function GetVersion() As String
GetVersion = SysCmd(acSysCmdAccessVer)
End Function



And then when I created a report I did this:

If GetVersion() = "11.0" Then
ConvertReportToPDF(LngRptName, vbNullString, "C:\folder\" &
RptName & ".pdf", False, False)
Else
DoCmd.OutputTo acOutputReport, LngRptName, "PDFFormat(*.pdf)", "C:
\xxx\" & RptName & ".pdf", False, ""
End If

And it seems to works like a charm.

Thanks so much for your input.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.