1 Reply Latest reply on Nov 13, 2015 4:56 AM by ravic131083

    How to send pdf as attachment using CQ Code

    ravic131083

      How to send pdf as attachment using CQ Code

        • 1. Re: How to send pdf as attachment using CQ Code
          ravic131083 Level 1

                         String fileName = "/content/dam/cnc/ui/pdfs/retail/test.pdf";

                          resource = resolver.getResource(fileName);

                          Node imageNode = resource.adaptTo(Node.class);

                          Node contentNode = imageNode.getNode("jcr:content");

                          Binary imageBinary = contentNode.getProperty("jcr:data")

                                  .getBinary();

                          InputStream imageStream = imageBinary.getStream();

           

           

          i am getting the exception as

           

          javax.jcr.PathNotFoundException: jcr:data not found on /content/dam/cnc/ui/pdfs/retail/test.pdf/jcr:content