Hi,
As a part of evaluation, i have prepared a sample application which basically take the list of Tiff Files to generate MultiPage PDF. As a output MultiPage PDF, Only First Page will have the actual first Tiff Image, the rest of the pages shows Blank Page. Also, it shows an error message "Insufficient Data for an image." while opening that PDF file.
Moreover, if i use Jpeg Images then it will add those images to MultiPage PDF. Also, if i use DrawString method as per below commented code then it will add specific text in each page.
Below are the code details.
Code:
Dim pdfDocument As New PdfSharp.Pdf.PdfDocument
Dim i As Int32 = 0
For Each FilePath As String In FileNames
Dim m_BinaryData As Byte() = System.IO.File.ReadAllBytes(FilePath)
m_Stream = New MemoryStream(m_BinaryData)
Dim inBitmap As New Bitmap(m_Stream)
Dim oPage As PdfSharp.Pdf.PdfPage = pdfDocument.AddPage()
Dim xgr As PdfSharp.Drawing.XGraphics = PdfSharp.Drawing.XGraphics.FromPdfPage(oPage)
Dim img As PdfSharp.Drawing.XImage = PdfSharp.Drawing.XImage.FromGdiPlusImage(inBitmap)
xgr.DrawImage(inBitmap, 0, 0)
'Dim printFontCour8 = New PdfSharp.Drawing.XFont("Courier New", 8, PdfSharp.Drawing.XFontStyle.Regular)
'xgr.DrawString("Yahoo", printFontCour8, Brushes.Black, New PdfSharp.Drawing.XPoint(400, 400))
xgr.Dispose()
i = i + 1
Next
pdfDocument.Save(modifiedFilePath)
pdfDocument.Close()
Please Suggest !!