How to obtain the file size of the merged PDF file?


We are concatenating pdf files into single PDF file. I am using below
code for this and working fine for me however I need a small help.
Before saving merged file into hard disk I wanted to know the actual
size of the file. Can you please help me to get the size of the file?

For i As Integer = 0 To dsInvicePath.Tables(0).Rows.Count - 1
                invoicePath = dsInvicePath.Tables(0).Rows(i)("URL")
                If File.Exists(invoicePath) Then
                    Dim sourcePDFdoc As PDFDoc = New

                    Dim page_end As PageIterator =
                    Dim itr As PageIterator = sourcePDFdoc.PageBegin()
                    Dim arlist As New ArrayList

                    While Not itr.Equals(page_end)
                    End While

                    Dim arImportPage As ArrayList =
                    For xM As Integer = 0 To arImportPage.Count - 1

                    bFileToSave = True
                End If



PDFNet does not know the file size until the file actually saved. After
saving the file to disk you can obtain the file size using standard
.NET API. Another approach is to save the file in memory (e.g. as show
in PDFDocMemory sample) which will directly return you the number of
bytes in the output array.