PDA

View Full Version : Printer paper size



potski
09-18-2012, 11:05 AM
Hi,
I have a PDF printer that I need to change the paper size between A4 and LETTER depending on the current user, and the task they are performing.

I need to use PDF Camp, as it allows appending of additional pages.

I've created 2 functions to do this ( see below) but it just doesn't work, I know I'm missing something obvious but unfortunately it isn't obvious to me.

My functions are as follows:

Public Function mytest()
Call SET_PAPER("LABEL", "PORTRAIT")
DoCmd.OpenReport "test", acViewPreview
End Function

Public Function SET_PAPER(PAPER_SIZE, PAPER_ORIENTATION)

Set Application.PRINTER = Application.Printers("PDFcamp Printer")
Select Case PAPER_ORIENTATION
Case Is = "LANDSCAPE"
Application.PRINTER.ORIENTATION = acPRORLandscape
Case Is = "PORTRAIT"
Application.PRINTER.ORIENTATION = acPRORPortrait
End Select


Select Case PAPER_SIZE

Case Is = "A4"
Application.PRINTER.DefaultSize = False
Application.PRINTER.PAPERSIZE = 29 'acPRPSA4
Case Is = "LETTER"
Application.PRINTER.DefaultSize = False
Application.PRINTER.PAPERSIZE = acPRPSLetter
Case Is = "LABEL"
Application.PRINTER.DefaultSize = False
Application.PRINTER.PAPERSIZE = acPRPSUser
Application.PRINTER.ItemSizeHeight = 1150
Application.PRINTER.ItemSizeWidth = 6000
Application.PRINTER.BottomMargin = 0
Application.PRINTER.TopMargin = 0
Application.PRINTER.LeftMargin = 0
Application.PRINTER.RightMargin = 0
Application.PRINTER.ORIENTATION = acPRORLandscape
End Select

End Function

The custom option does change the margins, but the orientation never changes, and the paper size doesn't seem to change either.

I'd really appreciate any help.

Thanks

Potski