2
1
0

Can I prevent the URLs being added to the PDF for hyperlinked text or images in my form?

I don't want this to happen for images or if the link text is the URL.

    CommentAdd your comment...

    2 answers

    1.  
      4
      3
      2

      Ah... now I see.  Sorry it took a while to get it.

      If you put this code in a Form Load rule, does it give you the behavior you are after?

      if (Util.isReceipt) {
          $('a').removeAttr('href');
      }

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi,

        The URLs probably do not exist in the PDF.  It's the PDF viewers that scan for text like 'http://' and 'www' and automatically generate hyperlinks around the text on the fly.

        If you want to use a brute-force approach, you could do something like this in a form load rule, which just blindly removes all anchor elements from a receipt, taking the text with it:

        if (isReceipt) {
          $('a').remove();
        }

        If your URL strings are not actually anchor elements, you might need to wrap them in some element like <p> and remove them based on their content:

        if (isReceipt) {
          $('p:contains("www")').remove();
        }

        Given that it's the PDF viewers that are manufacturing hyperlinks on the fly, you don't have a lot of options other than to remove the text that triggers this behavior.

        1. Dan Cormick

          HI Bill,

          We have found that a form in Maestro will always put the full URL in the PDF receipt. Where as this will not occur in a Composer form. As you can see in the attached images, the URL has https://


        2. Bill Frost

          Hi Dan,

          Can you attach that particular PDF please?  (As long as it is not a live form with customer data in it)

        3. Lin VanOevelen

          20171011139910.pdf


          Here's one of our test files. I'd added hyperlinks to the header images. Had to remove them as they showed up in the PDF like that.

        4. Bill Frost

          Hi Dan,

          I'm seeing links in that form:

        5. Dan Cormick

          That's the issue. It should be hyperlinked text, not the full URL. That was what Maestro output.

          Here is a PDF from Composer (last page has a correctly hyperlinked piece of text):

          joint-loan-card-appl-21.pdf

        6. Dan Cormick

          Actually, it seems that is not hyperlinked at all. At least in the Maestro output you can click on the URL. Whereas in the Composer result there is no link. I'm guessing this is a feature, not a bug? It would still be good to have an option to not display the URL.

        7. Lin VanOevelen

          The issues for us is not whether or not they are hyperlinked in the PDF. It's the fact that the hyperlink URL automatically gets added behind the link text. (Or under the image in my case.)

        8. Lin VanOevelen

          Yes, this works! It removes the hyperlink and the URL text in the PDF.

          And I had never used form load rules so it is very handy to know about them.

          Thanks,

          Lin

        9. Dan Cormick

          Thanks Bill. This worked for us. Also, is there any documentation containing isReceipt? I can't find it anywhere in the Maestro API docs here.

        10. Bill Frost

          Form Load is a very handy place to do a lot of magic.

          Glad to have helped you out.

        11. Bill Frost

          Technically it should be Util.isReceipt, and it is so far undocumented.  I'll raise a ticket to have it added to the documentation.  I'll edit the answer to show Util.isReceipt.

        CommentAdd your comment...