Página 1 de 1

TPrinter:nCopies

Publicado: Mié Jul 24, 2019 4:49 pm
por emeasoft
Hi,

When I try to print more than 1 copy of a document, changing "TPrinter:nCopies" property, as you can see below, doesn't work.

What I'm doing wrong?

Código: Seleccionar todo

WITH OBJECT TPrinter():New()
  :Create()
  :nCopies:=2
  :lPreview:=.F.
  :nPrinterIndex:=myPrinterIndex
  :StartDoc()
  :WriteData(myText)
  :EndDoc()
  :Destroy()
END
  

Re: TPrinter:nCopies

Publicado: Mié Jul 24, 2019 5:50 pm
por ignacio
Hi,

You do not need to create a TPrinter object. There is already one. Try this:

WITH Printer
:nPrinterIndex:=myPrinterIndex
:nCopies:=2
:lPreview:=.F.
// :StartDoc()
// :StartPage()
:WriteData(myText) // This method does not need StartDoc(), StartPage(), EndPage() and EndDoc()
// :EndPage()
// :EndDoc()
END

You must SET everything after the printer is selected

BTW, if still does not work, I'm afraid the problem in not on our side. Check the sample PrinterInfo and you will that setting the nCopies property on code is reflected perfectly on the executable afterwards.

Regards,

Re: TPrinter:nCopies

Publicado: Mié Jul 24, 2019 7:17 pm
por emeasoft
Thank you, Ignacio.