• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Digital Signature element image storage

mediaateam

Administrator
I am using the Digital Signature element, I need to pull the image, not the code it stores, into a PDF template. Does anyone know where it's storing the images? I believe it does convert it to a .png because it's in the php, but I can't find where to grab it.
 
The digsig element doesn't create and store an image. It stores the properietary JSON format of the data used by the 3rd party plugin we are using, which is essentially just a list of point coordinates.

I think the only way to do this would be to have a custom template, and use the URL we use in list or detail view, which tells our plugin to render the PNG for the digsig on the fly. You may have to write the file to a cache / tmp location, and load that.

-- hugh
 
OK, you just said in Skype that you had found a workaround, by the sound of it using something ike the the approach I outlined in my previous post.

Can you share the details of how you did it, for anyone else with the same question?

Or maybe contribute your solution to the wiki? :)

-- hugh
 
First I made the digital signature show in the list view. It generates an image on the fly in the list view. So, I copied the link that it used to the generated image using right click, Copy Link.

It looks something like this:
www.yoururl.com/index.php?option=com_fabrik&task=plugin.pluginAjax&plugin=digsig&method=ajax_signature_to_image&format=raw&element_id=1104&formid=28&rowid=34&repeatcount=0

It uses the rowid to pull it, so in my PDF template that I made, I get the id of the record I'm making the PDF for and assign to a variable:
Code:
$regInfo = $this->groups['Your Group Name'];
$regKeys = $regInfo->elements;
 
$digsigID = ($regKeys['id']->element_raw);

And then I dynamically filled the image src url like this in my template where I wanted it to appear:
<img src="https://www. yoururl.com/index.php?option=com_fabrik&amp;task=plugin.pluginAjax&amp;plugin=digsig&amp;method=ajax_signature_to_image&amp;format=raw&amp;element_id=1104&amp;formid=28&amp;rowid=<?php echo $digsigID; ?>&amp;repeatcount=0">
This makes the graphic and stores it in the PDF. Worked like a charm, and now with the new version of Fabrik, you can turn on validation for the digital signature so it has to be signed.
Word of warning, I couldn't get it to work without having the entire path, so, if you copy your site to a development copy of the site to work on, remember to go edit the path in the PDF template on your test site. I didn't and started getting the wrong signatures on the pdfs and thought I was losing my mind - but it was because the id on the live site was a different signature than my test site and it was hard coded to go to the live site.
 
  • Like
Reactions: rob
thanks for detailing that Robbie. I guess the issue with our current "render in pdf/details" code is that we are relying on JavaScript to render the image in a <canvas> element. I was going to add your instructions to the wiki, but then I thought it would probably be best to implement it into the code, as I can see a lot of people wanting to print a PDF of a signed form.

I'll take a look at adding that in now
 
Mea Culpa. I thought I'd set it up originally to render the sig in detail view the same way it does it in list view, but I didn't - as Rob says, the detail view used JS and canvas. But Uncle Rob is fixing that with his Code Hammer as I type, and should have it whipped in to shape, probably before I post this, so it does the same 'render as PNG image' in detail view as it does in list view. And probably add some extra sexy stuff like making it a JLayout, so the layout can be overridden.

--hugh
 
That's so awesome!! I totally appreciate it, I've already used my method on two different sites, so there is definitely a demand. :)

-Robbie
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top