I'm really having trouble getting my head around Aspose.
My latest problem is trying to output a pdf to an outputstream. I'm sending my documents to a HttpHandler window and trying to load the window with the document.
For TIF's I'm doing:
Pdf pdf1 = new Pdf();for (int page = 0; page < MyDocument.PAGE_COUNT; page++)
and adding a section for each page and placing an image in that page from the TIF.
Finally, I'm outputting the pdf:
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.ClearHeaders();HttpContext.Current.Response.ContentType = "application/pdf";pdf1.Save(
HttpContext.Current.Response.OutputStream);HttpContext.Current.ApplicationInstance.CompleteRequest();
However, if my input file is already a PDF I'm confused. I'm trying:
System.IO.MemoryStream ms = new System.IO.MemoryStream();PdfConverter pdfConv = new PdfConverter();
pdfConv.BindPdf(MyDocument.FullImagePath);
pdfConv.DoConvert();
pdfConv.SavaAsTIFF(ms);
Pdf pdf1 = new Pdf(ms);
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.ClearHeaders();HttpContext.Current.Response.ContentType = "application/pdf";pdf1.Save(
HttpContext.Current.Response.OutputStream);HttpContext.Current.ApplicationInstance.CompleteRequest();
but I'm getting an error on the pdf1.Save - something about being in output only mode and I have to close it, not save it.
In any case, the outputting to the Response.OutputStream is very very slow.
Are there better solutions?
Thanks!!!
This message was posted using Aspose.Live 2 Forum