Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Corrupted pdf fonts in batch class - catch RPC server error

(0) ShareShare
ReportReport
Posted on by 1,085

I'm running a custom class to create pdf files from SalesPackingSlip and SalesInvoice reports and email them to customers.

Sometimes (say a 5%) the files are corrupted, the fonts are completely screwed and unreadable (I already test file size and number of pages, because I also get 1KB files and single paged files instead of complete ones...)

On last run the infolog shows this error "OpenPrinter_1: rc:0 lastError:1722(0x6ba) The RPC server is unavailable." and I think that could be the cause. But I can't find the reason why no exception has been thrown after this error.
The error happens somewhere inside the fetch() method of SalesPackingSlip report, is there a proper way to check the RPC server status before running the report?

My code is something like:

try

{

...

args                =   new Args(reportStr(SalesPackingSlip));

...

reportRun.run()  //the error happens somewhere inside this call

}

catch

{

info("Report print error");

}

Thank you in advance

regards

args                =   new Args(reportStr(SalesPackingSlip));

*This post is locked for comments

  • Suggested answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Corrupted pdf fonts in batch class - catch RPC server error

    Hi win32,

    It looks like connected to print spooler service not running, please check this blog post technicalreflections.wordpress.com/.../dynamics-ax-openprinter-rpc-error

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans