c# - AmyuniPDF prints PDF document in wrong font (special characters) -


i using amyuni pdf creator .net print pdf using windows service.

windows service running under local system user account. when tried print using above library, prints pdf in wrong font. see attachment (wrong font in pdf printing).

this issue persists of printers such brother mfc-8890dw printer.

but same printer above windows service, prints pdf when unchecked enable advanced printing features setting in above printer properties. see attachment (disable advanced printing features).

using (filestream file1 = new filestream(pdffile, filemode.open, fileaccess.read)) {     using (iacdocument doc1 = new iacdocument())     {         doc1.open(file1, string.empty);         doc1.copies = 1;         bool printed = doc1.print(printer, false);     } } 

but same windows service prints pdf correctly other printers such hp laserjet p1005 either enable advanced printing features checked or unchecked.

without having access same printer using hard know happening. best guess driver of printer has issues dealing process-level fonts (those registered using gdi function addfontresourceex) when "enable advanced printing features" checked. how amyuni pdf creator uses fonts embedded in pdf file, case file have presented. possible workaround use attribute "printasimage" of document class.

the code this:

//set license key needed licensed version acpdfcreatorlib.setlicensekey("your company", "your activation code");  //create new document instance amyuni.pdfcreator.iacdocument doc = new amyuni.pdfcreator.iacdocument(null);  doc.attributebyname("printasimage").value =1;  //open file here (...)  //print default printer pdfcreator1.document.print("", false); 

another alternative save file xps using amyuni pdf creator send xps file printer:

// create print server , print queue. localprintserver localprintserver = new localprintserver(); printqueue defaultprintqueue = localprintserver.getdefaultprintqueue(); defaultprintqueue.addjob("my document", "c:\\temp\\mytempfile.xps", true); 

disclaimer: work amyuni technologies.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -