Hello,
I'm trying to set the paper size before printing but without sucess
The user may be able to select the paper size manually from a combobox, is that possible?
With the PrintDocument it works, but when i try to do the same thing with pdf printing it isn't working
Here's the PrintDocument Code
"PrintDocument1.PrinterSettings.PrinterName = cmbPrinters.Text
Dim psize As Printing.PaperSize
psize = PrintDocument1.PrinterSettings.PaperSizes.Item(papertype.SelectedIndex)
PrintDocument1.DefaultPageSettings.Margins = New Margins(0, 0, 0, 0)
PrintDocument1.DefaultPageSettings.PaperSize = psize
PrintDocument1.DefaultPageSettings.Landscape = True
PrintDocument1.Print()
Code from printing pdf
Dim doc As New PdfDocument()
'Load a PDF file
doc.LoadFromFile(newfilepdf.Text)
'Specify printer name
doc.PrintSettings.PrinterName = cmbPrinters.Text
'Select a page range to print
doc.PrintSettings.SelectPageRange(1, 1)
'Set PaperSize
Dim psize As New PaperSize With {.RawKind = papertype.SelectedIndex}
doc.PrintSettings.PaperSize = psize
'silent printing
doc.PrintSettings.PrintController = New StandardPrintController()
'Print document
doc.Print()
I've search on some forums and weren't able to find an answer
I'm using the free version o Spire.Office
Thank you for the help, and i'm sorry if there's something i'm not doing correctly here on the forum