Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

Corrupted pdf fonts in batch class - catch RPC server error

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));

  • Suggested answer
    Mea_ Profile Picture
    Mea_ 60,274 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

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,326 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,166 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans