Hi,
I use your code from "http://www.telerik.com/help/aspnet-ajax/editor-printing-content-with-styles.html" to print the RadEditor html content and some additional custom information. In particular, I add some email information (sender, recipient, etc.) as the editor is used in an email web client.
A problem arises in the case of external images referenced in the html content, e.g. "<img width="1600" height="900" id="Grafik_x0020_1" src="/an_image_url_comes_here">". These images are not printed. However, the default RadEditor print function does work fine in this case.
How do I make the external images to be printed as well in the custom code?
My code looks like this:
Telerik.Web.UI.Editor.CommandList["CustomPrint"] = function (commandName, editor, args) {
var printIframe = document.createElement("IFRAME");
document.body.appendChild(printIframe);
var printDocument = printIframe.contentWindow.document;
printDocument.designMode = "on";
printDocument.open();
printDocument.write("<html><head></head><body>" + editor.get_html(true) + "</body></html>");
printDocument.close();
try {
if (document.all) {
printDocument.execCommand("Print");
}
else {
printIframe.contentWindow.print();
}
}
catch (ex) {
window.alert("error");
}
//document.body.removeChild(printIframe);
};
Many thanks!!!
Roland
I use your code from "http://www.telerik.com/help/aspnet-ajax/editor-printing-content-with-styles.html" to print the RadEditor html content and some additional custom information. In particular, I add some email information (sender, recipient, etc.) as the editor is used in an email web client.
A problem arises in the case of external images referenced in the html content, e.g. "<img width="1600" height="900" id="Grafik_x0020_1" src="/an_image_url_comes_here">". These images are not printed. However, the default RadEditor print function does work fine in this case.
How do I make the external images to be printed as well in the custom code?
My code looks like this:
Telerik.Web.UI.Editor.CommandList["CustomPrint"] = function (commandName, editor, args) {
var printIframe = document.createElement("IFRAME");
document.body.appendChild(printIframe);
var printDocument = printIframe.contentWindow.document;
printDocument.designMode = "on";
printDocument.open();
printDocument.write("<html><head></head><body>" + editor.get_html(true) + "</body></html>");
printDocument.close();
try {
if (document.all) {
printDocument.execCommand("Print");
}
else {
printIframe.contentWindow.print();
}
}
catch (ex) {
window.alert("error");
}
//document.body.removeChild(printIframe);
};
Many thanks!!!
Roland