My company is currently evaluating SmartPrint to see if it can meet our needs for a current project, but we're experiencing some difficulties.
I have a StackPanel that I need to create a PDF from. The StackPanel is populated at runtime with borders, labels, and images. When no dynamically created images are present in the StackPanel, it creates the document (although with a few issues, listed at the end). However, once an image has been added at runtime it throws the error in the title of this post:
"WriteableBitmap has protected content. Pixel access is not allowed."
Here is the code:
Quote:
PrintSettings ps = new PrintSettings();
ps.ElementsToPrint = new List<UIElement> {SP_Main};
SmartPrintManager printMgr = new SmartPrintManager("http://localhost:3557/SmartPrintHandler.ashx");
printMgr.AutoGeneratePrintDocumentViewer = true;
printMgr.Print(ps);
The error is being thrown by the last line.
Any thoughts on what's causing it or how to resolve it?
Lastly, the issues I'm facing when it does print the (almost) empty StackPanel is that (what I assume to be the header information) is missing. The document opens up inside my Silverlight App with about a one-inch space at the top that still contains my application. I assume this is where a print/back button should reside?
My ultimate goal would be to pop up the PDF in a separate window, but the documentation that came with the trial version (the .chm file) seems to be broken. None of the pages load.