Thanks Nayyer.
Attached are both original pdf and converted XPS files(since i did not have printer to test the print out), as you can see:
From first converted file, table and footer are extending out of printable area, also on some pages footer is missing.
From second converted file, i have used the Autoresize property set to true, which is better but it is leaving too much margin from all side specially bottom!
I am wondering how the conversion code will cope with variable types of Pdf files? as our customer will get some times transcript in pdf, some times CV in PDF etc from all over the world.
Code:
Byte[] bytes = client.DownloadData("http://vir-ukd-lbs-01:5555/AllDocuments/The Education Zone - Catalogue (full).pdf");
MemoryStream stream = new MemoryStream(bytes);
Document doc = new Document(stream);
Aspose.Pdf.Facades.PdfViewer pdfViewer = new Aspose.Pdf.Facades.PdfViewer(doc);
System.Drawing.Printing.PrinterSettings printerSetttings = new System.Drawing.Printing.PrinterSettings();
printerSetttings.Copies = 1;
PageSettings settings = new PageSettings(printerSetttings);
pdfViewer.AutoResize = true;
printerSetttings.PrinterName = "Microsoft XPS Document Writer";
pdfViewer.PrintDocumentWithSettings(settings,printerSetttings);
i have been running above from a console app for testing.
Can i run the above code from a class library project? by replacing following line:
printerSetttings.PrinterName = "Microsoft XPS Document Writer";
with for E.g.
printerSetttings.PrinterName = "HP Deskjet 2050 J510 series";
As my requirement is to run the code from a .net class library(called plugin for our Microsoft Dynamics Customer relationship management product) which resides on platform layer and executes when client performs some operation on Aspx pages of this application.
I tried running from plugin class library as a result of trigger on CRM page but nothing happened.
Upon debugging i can see file being downloaded from URI but nothing happens when actually code reaches on following line:
printerSetttings.PrinterName = "HP Deskjet 2050 J510 series";
Is it the limitation of .net class library project? of am i missing something.
Our class library can be registered in DB or disc or Gac!
Regards
Umer