Print all sheets to one PDF

Posted by: laggen on 8 September 2017, 3:14 pm EST

  • Posted 8 September 2017, 3:14 pm EST

    I use this code when print to PDF.

    Dim SaveD1 As String
    SaveD.FileName = "Gruppförteckning"
    SaveD.Filter = "PDF (*.PDF)|*.PDF" '
    SaveD1 = SaveD.ShowDialog()
    If SaveD1 <> 1 Then Exit Sub
    Dim printset As New FarPoint.Win.Spread.PrintInfo()
    printset.ShowBorder = False
    printset.PrintToPdf = True
    printset.PdfWriteMode = FarPoint.Win.Spread.PdfWriteMode.Append
    printset.PdfFileName = SaveD.FileName
    printset.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide
    printset.ShowColor = True
    printset.Margin.Right = 0 : printset.Margin.Left = 77
    printset.Margin.Top = 80
    printset.PrintType = FarPoint.Win.Spread.PrintType.All
    printset.ShowPrintDialog = False
    printset.AbortMessage = "Skriver ut"
    printset.JobName = "NKS REG utskrift"
    For Each SheetView In FpSpreadSchema.Sheets
    SheetView.PrintInfo = printset

    I try to have all my sheets printed to one PDF.
    I use Spread 7.0 V3.

    I do something wrong
  • Replied 8 September 2017, 3:14 pm EST


    Your entire code for printing all the sheets of a Spread to pdf seems to be correct. However, you can not use AbortMessage property of the PrintInfo class because it is called every time when a new sheet is to be printed. Your application works perfectly after removing the following line:
     'printset.AbortMessage = "Skriver ut"

    Please find the modified application attached. Hope it helps.

  • Marked as Answer

    Replied 8 September 2017, 3:14 pm EST

    Thanks, this working perfect for me :)
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels