Do you have Aspose.Fonts.DLL on the computer that where you can make it work. When I try to print or render a PDF with Aspose.PDF.DLL version greater than 12.0 it fails with a message that it can’t load Aspose.Fonts.DLL. What is this Aspose.Fonts.DLL.
Hi Matthew,mcrose:Do you have Aspose.Fonts.DLL on the computer that where you can make it work. When I try to print or render a PDF with Aspose.PDF.DLL version greater than 12.0 it fails with a message that it can’t load Aspose.Fonts.DLL. What is this Aspose.Fonts.DLL.
assembly = System.Reflection.Assembly.LoadFrom(@“d:\MyApp\References\Aspose.Pdf.dll”);var types =
assembly.GetExportedTypes(); // <-- it works fine
now and returns all public exported non-obfuscated classes.
assembly = System.Reflection.Assembly.LoadFrom(@“d:\MyApp\References\Aspose.Pdf.dll”);
assembly.CreateInstance(“Aspose.Pdf.Document”);var types =
assembly.GetTypes(); // <-- it works fine now.
rnidamar:Looks like the ‘Print’ dialog is opening behind the browser. Unless the user minimizes the browser window to desktop view, Print dialog is not visible.Is there anyway to show the ‘Print’ dialog on top of the current browser window? Behavior right now is not user friendly.
Aspose.Pdf.Facades.PdfViewer viewer = new Aspose.Pdf.Facades.PdfViewer();<o:p></o:p>
string filePath = System.Web.HttpContext.Current.Server.MapPath("Test.pdf");
viewer.AutoResize = true;
viewer.Resolution = 600;
viewer.AutoRotate = true;
viewer.PrintPageDialog = true;
PrintDialog printDialog = new PrintDialog();
System.Windows.Forms.Form current = new System.Windows.Forms.Form();
current.TopMost = true;
current.Visible = false;
if (printDialog.ShowDialog(current) == DialogResult.OK)
System.Drawing.Printing.PrinterSettings ps = printDialog.PrinterSettings;
System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();
pgs.PaperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);
pgs.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);
In case of any further assistance, please feel free to let us know.
Thanks a lot Asad.
As per my understanding, you need to print the document using printer installed on staging server or the machine on which you access the application/page. Please note printers are usually installed on user’s profile (especially if it’s a network printer, not a physically connected one such as on USB or parallel cable). When Administrator sees a printer it doesn’t necessarily mean they will be available when other user is logging on the same machine. ASP.NET applications runs as ApplicationPoolIdentity or NerworkService credential by default so the web application is unlikely to see the printers there.
More information about application pool usage - http://www.iis.net/learn/manage/configuring-security/application-pool-identities
rnidamar:When I run this code from local machine, I see the ‘Print’ dialog in browser and I can select my local printer.I would like the same behavior when after we have deployed code to remote server (Staging site). When I browse to the page hosted on remote server. And I click ‘Print’, will the Print dialog not show-up my local printer?