Jump to content

RockPdf - pdf filename format and option to sign documents


PavelRadvan
 Share

Recommended Posts

Hi.
I am sorry I did not have time sooner.
Regarding my questions in pub I created topic for them here.

So first was about pdf filename format.
I have in ready.php this:

// add hook after page has been saved -  pdf pro ks
$wire->addHookAfter("Pages::saved(template=ks-import-hlavicka)", function ($event) {
    $page = $event->arguments(0);
  
    /** @var RockPdf $pdf */
    $pdf = $event->wire->modules->get('RockPdf');
    $pdf
        ->load("/site/templates/ks-tisk.php", [
        // make saved page available as $page
        // in the loaded document file
        'page' => $page,
      ]) 
        ->saveToField(
        page: $page,
        field: 'pdf',
        filename: $page->name,
        append: false,
      );
  });

$page->name is for example nz-0556-24 and when I look for file in page editor it shows this:
image.png.ad010828fedbd0bc6aee4b2f197519ce.png

It is filename with "." at the end.
When I click on it and save it I have file named "nz-0556-24_.pdf"
Is possible to eliminate that "." and "_" ????

Next question was just how to integrate some secure form of electronic sign of PDF documents.
I could include image with sign but there could be nice to have some option to include digital signatures and certificates same way as is possible to normal PDF documents.
I searched for mPDF about it but there is no option there.
There is info that mPDF is not supporting it on github : https://github.com/mpdf/mpdf/issues/184

So for me it would be nice to have it in RockPdf but it is not crucible now.

Just let me know what could be done with that filename...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...