Yesterday you answered my question about how to print using Aspose. Your answer was excellent, although if you noticed in my original code I had to convert a TIFF to a PDF doc first. I was able to accomplish this using some of my original code, a memory stream, and your code - see code below. However, when I use the PrintDocumentWithSetup method, the print screen is hidden and doesn't appear on my tab strip at the bottom. To the common user, it looks like the program just hangs. Is there a way to move this dialog box to the top, or better yet, show the normal printer dialog box?
Here's my full code. As you see, I have multiple TIFF images that I'm using to create the PDF pages.
Thanks!
Aspose.Pdf.Kit.PdfViewer viewer = new Aspose.Pdf.Kit.PdfViewer();
Pdf pdf1 = new Pdf();
for (int page = 0; page < IVSO.ImageViewerDocumentObject.PAGE_COUNT; page++)
{
//Create a section in the Pdf object ..a page
Section SectionTemp = pdf1.Sections.Add();
//Create an image object in the section
Aspose.Pdf.Image Tempimage = new Aspose.Pdf.Image(SectionTemp);
//Add image object into the Paragraphs collection of the section
SectionTemp.FirstLineIndent = 0;
SectionTemp.Paragraphs.Add(Tempimage);
//Set the path of image file
Tempimage.ImageInfo.File = IVSO.ImageViewerDocumentObject.FullImagePath;
Tempimage.ImageInfo.TiffFrame = page;
//Set the type of image using ImageFileType enumeration
Tempimage.ImageInfo.ImageFileType = ImageFileType.Tiff;
//Set image title
Tempimage.ImageInfo.Title = "Document image";
Tempimage.Margin.Left = 0;
Tempimage.ImageScale = 0.60F;
}
MemoryStream msPDF = new MemoryStream();
pdf1.Save(msPDF);
//Open a Pdf file
viewer.OpenPdfFile(msPDF);
viewer.PrintDocumentWithSetup();
//Close the current Pdf file
viewer.ClosePdfFile();
This message was posted using Page2Forum from PdfViewer - Aspose.Pdf.Kit for .NET