Hello,
Hi Raman,
Hi,
Hi Raman,
Hi Fahad,
Hello Raman,
Hello Raman,
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 Asad,
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.
System.Reflection.Assembly
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.
System.Reflection.Assembly
assembly = System.Reflection.Assembly.LoadFrom(@“d:\MyApp\References\Aspose.Pdf.dll”);assembly.CreateInstance(“Aspose.Pdf.Document”);
var types =
assembly.GetTypes(); // <-- it works fine now.
Hi Raman,
Thanks for writing back.
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.
The reason of this behavior is, you are using Windows Form based print dialog in a Web Application and when it shows up, it cannot find its parent window due to web application and goes behind the browser. To make it on top most please check following work around where I create a Windows Form instance in web application and assign it to PrintDialog, so that dialog can be appeared above the browser.
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.BindPdf(filePath);
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.Show();
current.Activate();
current.TopMost = true;
current.Focus();
current.Visible = false;
if (printDialog.ShowDialog(current) == DialogResult.OK)
{
current.Close();
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);
viewer.PrintDocumentWithSettings(pgs, ps);
}
viewer.Close();
In case of any further assistance, please feel free to let us know.
Best Regards,
Thanks a lot Asad.
Hi Raman,
Hi,
Hi Raman,
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
Hi,
Hi Raman,
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?
Hi Raman,