Hi
’ instantiate Document Object
Dim doc As Document = New Document()
’ add a page to pages collection of document
Dim page As Page = doc.Pages.Add()
’ load the source image file to Stream object
Dim fs As FileStream = New FileStream(“c:/pdftest/1.tiff”, FileMode.Open,
FileAccess.Read)
Dim tmpBytes(fs.Length) As Byte
fs.Read(tmpBytes, 0, Convert.ToInt32(fs.Length))Dim mystream As MemoryStream = New MemoryStream(tmpBytes)
’ instantiate BitMap object with loaded image stream
Dim b As Bitmap = New Bitmap(mystream)’ Set margins so image will fit, etc.
page.PageInfo.Margin.Bottom = 0
page.PageInfo.Margin.Top = 0
page.PageInfo.Margin.Left = 0
page.PageInfo.Margin.Right = 0page.CropBox = New Aspose.Pdf.Rectangle(0, 0, b.Width, b.Height)
'Create an image object
Dim image1 As Aspose.Pdf.Image = New Aspose.Pdf.Image()
'Add the image into paragraphs collection of the section
page.Paragraphs.Add(image1)
’ set the image file stream
image1.ImageStream = mystream
’ save resultant PDF file
doc.Save(“c:/pdftest/1.pdf”)'close memoryStream object
mystream.Close()
Here i attach tiff file and output file also,pls check the output files.i don’t want
crop the files,if i remove margin and crop lines ,still it reduce the length of image
in pdf.