Problem with the PaperBin Page Attribute

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
Markten
Posts: 11
Joined: Thu Jan 19 2006

Problem with the PaperBin Page Attribute

Post by Markten »

The PaperBin Attribute for the page doesn't seems to work for me, I'm using the PDF creator v2.0, the printer always print with the upper tray(default) even though I've change the PaperBin with a value of 4 =Lower tray
Did I've missed something...
When I open the document with the PDF creator User Interface, goto document settings... goto Tab Page Setup the Paper tray has the right selection (lower)

I'm using a Lexmark optra 1855 MS printer and the attributes Trayselection and FormToBinMap are set with default values

This is the code I've wrote for that
With PDF1
.ReportState = acReportStateDesign
.Open "c:\testFilledServiceInvoice.pdf", ""

For n = 1 To .PageCount
.ObjectAttribute("Pages[" & n & "]", "PaperBin") = 4
Next

.StartPrint "", False

For n = 1 To .PageCount
.PrintPage n
Next

.EndPrint

End With
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

What are the default values of the attribute Tray selection and FormToBinMap?

I suspect that you will need to set the method "TraySelection"

The "TraySelection" method which accepts an integer value determines how does the control selected paper trays when printing and you can assign it one of the properties below:

0: PDF file setting if any
1: Set by the destination printer
2: Set depending on the FormToBinMap property

In your case you will need to us the "PDF file setting if any"

The information below is about FormToBinMap and it may be helpful for other users trying to print to different paper bins:

The FormToBinMap method which accepts a string value assigns each paper size to a specific printer tray. This string can be set up using the format below:
(Printer1) Size1 Tray1 Size2 Tray2. (Printer2) Size1 Tray1 Size2 Tray2.


Let us know if helps.
Markten
Posts: 11
Joined: Thu Jan 19 2006

Trayselection FormToBinMap

Post by Markten »

What are the default values of the attribute Tray selection and FormToBinMap?

the Tray selection has the value of 0
->supposed to mean PDF file setting if any

and I did not set any value for the FormToBinMap attribute, so I guess the value for this is nothing or blank

I'm still printing in the upper tray (the default one)

Can you show me a piece of code that use the Trayselection combined with the FormToBinMap attribute ?
I think the documentation is not clear enough about how to initialize the FormToBinMap attribute correctly
(Printer1) Size1 Tray1 Size2 Tray2

This is what I've wrote to test your assumption, is it OK ? I think not because I'm still printing with the upper tray

With PDF1
.ReportState = acReportStateDesign
.Open "c:\testFilledServiceInvoice.pdf", ""

.ObjectAttribute("Document", "TraySelection") = 2

'Here want to use the default printer
.ObjectAttribute("Document", "FormToBinMap") ="1 4"
end with

Thanks in advance!
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

There seems to be an issue with the value you are passing to the "PaperBin" property.

The "PaperBin" value is not a physical tray value but it is the ID bin value generated by the printer.

I have included a link to MSDN that explains this completely.

http://msdn.microsoft.com/library/defau ... perbin.asp

Hope this helps?
Markten
Posts: 11
Joined: Thu Jan 19 2006

PaperBin issue

Post by Markten »

Yup I have already read this MSDN article, I've tried a lot of paperbin value (1,2,3,4,5,6), I'm still printing in the default tray (the upper one) I've tried also with another printer, same thing, still printing with the default tray.
When printing page by page with PDF Creator ActiveX, the control doesnt seems to care about the page property PaperBin even though the page attribute have a value for another tray.

This is very important for us to be able to change the PaperBin when printing a PDF document, we want to use this Activex Control to create invoices, customer statements, receipts, that's why I need this to work
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

Can you verify the effect of setting FormToBinMap property on your issue?

(Printer1) Size1 Tray1

Example:

Printer:”HP LaserJet”
Paper Size: Letter

The paper size should be an integer that represents the paper size as defined by Windows (1 for Letter, ...)

Tray: 7


.ObjectAttribute("Document", "FormToBinMap") =“(HP LaserJet) 1 7”;

Hope this helps?
Markten
Posts: 11
Joined: Thu Jan 19 2006

Problem was the Tray ID

Post by Markten »

The problem is like you have said earlier in this Topic, I've set the wrong Tray ID for the lower tray of my printer

Assigned the value of 260 in the PaperBin Attribute my program work fine!!!
Thanks!

Find a good KB article on Microsoft
on how to get Tray IDs for a Printer Q194789
Post Reply