We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Callback function for printing pages of document and for converting file to PDF?


Could you please tell me how can I use my callback funktion to see if Aspose printing or converting process is still alive? This is really actula request if source document contains 100+ pages.

My code snippet is:

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
    Dim sFile = "C:\In\1032034.docx"
    Dim sPrinter = "Canon iR C3000 Series UFR II"

        Dim myDoc As New Aspose.Words.Document(sFile)

        ' define callback for converting file here
        myDoc.Save("D:\out\1032034.pdf", Words.SaveFormat.Pdf)

        Dim ps As New System.Drawing.Printing.PrinterSettings() With {.PrinterName = sPrinter}

        ' define callback for printing pages here
        myDoc.Print(ps, GetFileNameExt(sFile))
    Catch ex As Exception
    End Try
End Sub

@Mikhael There is no callback that is calling on saving or printing each page, however there is IPageLayoutCallback which is called when page layout is built. Actually layout is the most time consuming operation upon conversion document to fixed page format or printing. So I think this callback will allow you to achieve what you need.

Thank you!


1 Like