PDFSerial - Securing Generated PDFs Against Editing

  • Posts: 595
  • Thank you received: 23
  • Hikaserial Subscription Hikashop Multisite
2 months 4 days ago #366606

-- HikaSerial version -- : 5

Dear HikaShop team,

We are currently using the PDFSubscription and PDF serial plugin to generate and send personalized PDF tickets to our customers. This works very well for our needs — thank you!

We would like to know if there is currently a way to secure the generated PDFs against editing or modification. Specifically, we're interested in features such as:

Disabling editing of the PDF content
Restricting copying or modification
(Optionally) setting a password for changes[/li]

If this is already possible using the existing plugin or through template customization?, we would appreciate some guidance or an example of how to implement this.

If this functionality is not yet supported, would you consider adding it in a future version of the plugin? We believe it would be a valuable addition for many users who wish to protect the integrity of their generated documents.

Looking forward to your feedback.

Best regards,
Lumiga


Kind regards,
Lumiga

Please Log in or Create an account to join the conversation.

  • Posts: 26251
  • Thank you received: 4040
  • MODERATOR
2 months 3 days ago #366611

Hello,

It requires a specific development in the plugin in order to add such feature.
It is possible to set the protection in TCPDF. For FPDF it requires to add an extra "plugin" for that.
Since the "PDF Serial" plugin can use both libraries, handling the "protection" should be available for the two implementation.
Unfortunately, it is not possible to do so via an override ; if you want to add it yourself, best would be to "duplicate" the actual plugin and force the usage of TCPDF (which is easier for the protection support).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 33
  • Thank you received: 3
  • Hikaserial Subscription Hikashop Business
2 weeks 1 day ago #367374

Hello,
I would like to help with the creation of this function, but I can't get to grips with the developer documentation.
is it a big effort to overwrite a plugin?

The following user(s) said Thank You: Lumiga

Please Log in or Create an account to join the conversation.

  • Posts: 26251
  • Thank you received: 4040
  • MODERATOR
1 week 6 days ago #367406

Hello,

In my message I was talking about "duplicating" the plugin and not overwrite it.
If you modify the actual PDFSerial plugin, the next update of HikaSerial and your modifications will be lost.
So the best is to create a new plugin and copy the code, like a duplication.
The most important is to change the plugin name so it won't collide.
docs.joomla.org/J4.x:Creating_a_Plugin_for_Joomla

PDF Serials uses a trigger

onCustomPdfSerialFormat($format, $format_ex, $content, &$pdf, &$d)
which gives you access to the `$pdf` object (TCPDF or FPDF) ; you can detect which one using
$isFPDF = (bool)(class_exists('FPDF') && $pdf instanceof FPDF);
In the next release, we will add another trigger to create your own PDF actions (which will be far better for such kind of need).

In order to add new formats and new types into the PDF Serial configuration screen ; there is also a trigger for that
onGetCustomPdfSerialFormats(&$new_types, &$new_formats)
The two parameters are arrays and you need to add JHTML into, like
$new_formats[] = JHTML::_('selection.option', 'custom_format', JText::_('MY_CUSTOM_FORMAT'));

Regarding the `SetProtection` support, we have some internal tests but the support of multiple librairies is difficult.
Since the usage of PDF Templates forces to uses the FPDI lib ; we need to load the FPDI_Protection lib and use its specific functions.
Otherwise, TCPDF has a SetProtection method but FPDF do not.

Since it's a "work in progress", it was not added in the last release ; but we do hope that all tests will be successful for the next one.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: Lumiga, michael.koch@breisig.live

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.063 seconds
Powered by Kunena Forum