I just can’t seem to print pdf’s at all. You told me before to use the pdf.kit, and that worked okay on my machine (however the print dialog box appears behind all the other screens so you may never know it’s there, and there’s no way to bring it to the foreground, and it doesn’t allow page selecting), but wouldn’t work at all on the web server. I keep getting a Sys.WebForms.PageRequestManagerParserErrorException - something about Response filters and HttpModules. I even get this message on my own box when I try using just pdf as below.
Here’s my code for converting a TIF to a PDF and printing it (or trying to):
Pdf pdf1 = new Pdf();
for (int page = 0; page < xxx.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 = xxx.CLIENT_NAME + ": " + xxx.CurrentDCN;
Tempimage.Margin.Left = 0;
Tempimage.Margin.Right = 0;
Tempimage.ImageScale = 0.75F;
}
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = “application/pdf”;
pdf1.Save(“Document.pdf”, SaveType.OpenInAcrobat, Response);
HttpContext.Current.ApplicationInstance.CompleteRequest();
It hangs, then fails on the pdf1.Save line.
By the way, when I could get it to print using the kit on my PC, the PDF came out in the wrong place on the page and was cut off on one side. Either I had to make the whole image smaller, which was hard to read, or settle for it being off center and about 4/5ths of a page in size.
I’m not sure what version of aspose this is - when I try to open it it says Version 1 (neutral).
Thanks!
This message was posted using Page2Forum from Aspose Demo Browser - File format components, Word, Pdf, Excel, PowerPoint component demos