Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to print PDF files from AX7 to specific printer

(0) ShareShare
ReportReport
Posted on by 2,953

Hi all,

Requirement: 

1. We will get a pdf file from web service.

2. This PDF file has to be sent to specific printer. 

This task might seems similar to below blog which is for AX 2012. we are looking for D365FO

http://www.agermark.com/2008/01/print-pdf-files-from-ax-to-specific.html

Highly appreciate your suggestions.

*This post is locked for comments

  • krishna.rao@dax Profile Picture
    krishna.rao@dax 2,953 on at
    RE: How to print PDF files from AX7 to specific printer

    Hi peers,

    any suggestions.

  • krishna.rao@dax Profile Picture
    krishna.rao@dax 2,953 on at
    RE: How to print PDF files from AX7 to specific printer

    we also need to send PDF label to Zebra printer. It seems objects/classes are not available what you mentioned DocumentContractFactory ,ZebraDocumentContract ..etc.  in AX & getting error. Also the link  https://ds11.pdffiller.com/ seems not relevant to us (related to passport).

    Here we are discussing about "How to send pdf file to printer" in D365FO(AX7) through x++ , after configuring Document routing agent.

    Highly appreciate if anyone could share their experience on this.

    Thank you..

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to print PDF files from AX7 to specific printer

    This question had appeared here before. As far as I remember, the point is, you should use the regular document routing agent. Like, for a regular printing, so setup should be the same regular as well. Then from code, build your zebra commands into a str, like this;

    DocumentContractFactory factory = DocumentContractFactory::Instance;

    ZebraDocumentContract documentContract = factory.Create(DocumentContractType::Zebra);

    documentContract.TargetType = TargetType::Printer;

    documentContract.Settings = 'printer path';

    documentContract.Name = "AXLabel";

    documentContract.Contents = SerializationHelper::ConvertStringToByteArray(your str, System.Text.Encoding::ASCII);

    SrsReportRunPrinter::sendDocumentContractToDocumentRouter(documentContract);

    I'm not a huge fan of dealing with that this way and more prefer to use basic editing tools with no code https://ds11.pdffiller.com/ but this solution above is free and more relevant to you, I guess

  • krishna.rao@dax Profile Picture
    krishna.rao@dax 2,953 on at
    RE: How to print PDF files from AX7 to specific printer

    we need to print in AX, after posting of sales packing slip(has dependency with packing slip posting). getting pdf file from web service will be taken care by other person.

    Here our job is how to send this pdf file to printer.

    I think we may ignore about web service since our requirement mainly how to send pdf file to printer. like in below link

    www.agermark.com/.../print-pdf-files-from-ax-to-specific.html

    Thank you.

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to print PDF files from AX7 to specific printer

    Why do you need AX then ? Just build app that receives files and print them to a printer.

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,329 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans