Solved pdf attachment blank

ontarget

Active Member
Fabrik 4.4.1 J!4.4.9
Hi I am using the form option:
Attach as PDF - Attach the submitted record's detail view as a PDF document. The PDF is rendered using the form's PDF template.

When i submit the form there is a pdf attached but it is blank.
I have tried using both default and bootstrap options for the rendering.
This was working on the older version of fabrik 4.
Is anyone else having this issue?
 
I can't replicate (with F4.5).
F4.4.1 is not the latest one.

A PDF is attached but empty? Can you open it with an editor like Notepad++, does it contain something?

Did you try to create a PDF via PDF button?
 
Hi thanks for the reply.
I updated to 4.5 and php8.3
Global >PDF Library is set to DOMPDF

In the backend When i open list > view data >details view link > click pdf then it downloads the pdf with no issue.

In the frontend > details view > the link to the pdf is as follows
https://mywebsite.com/component/fabrik/details/1/5.pdf
But nothing happens when i click on it, it just reloads the details view of the form entry again.

PDF attachment in the email
I opened the pdf that was sent in the email - the pdf is blank if i open it in text editor /sublime text i can see the following code (see pdf-blank.txt file as i couldn't paste the code here)

So there is a problem with the pdf attachment and accessing pdf in the frontend it seems.
Thanks for any help in fixing this.
 

Attachments

  • pdf-blank.txt
    922 bytes · Views: 45
Yes it was the SEF URL's i turned them off and the pdf can be downloaded from the frontend, however the attachment is still blank in the email.
If i can't get the pdf attachment working in the email attachment is there any way i can craft a url to the users pdf output (they are logged in to the frontend of the website) so for example using {$my->id} in the link for example?
 
So each user has his 'own' record and must be logged in to see it?
Do you have a prefilter or a form with usekey= userelement and rowid=-1?

You can include the PDF link into the email (use e.g. rowid={rowid}) and a hint like "you must be logged in to use this link"

But actually the attachment should do...
 
Hi Troester
SOLVED - it was due to ACL settings so not a fabrik error.
On submission of the form the user is in the "registered" group, however the View records / View List / Edit Record level was set to another custom group (completed claims).

To handle it I created a third group called "pdf viewer" which includes "registered" + "completed claims" groups and set it to "View Records"

The attachment is now populated in the email.

Thank you for helping me with this, it hadn't occurred to me but your last post got me thinking!
 
Hi @ontarget,

Thank you so much for sharing your solution! If I understand correctly, the issue was related to the fact that users in the "Registered" group didn’t have sufficient permissions to access the records required for generating the PDF. By creating a new group ("PDF Viewer") that includes both "Registered" and "Completed Claims," you were able to resolve the permissions conflict.

Just to make sure I’ve understood everything correctly:

  • Did you configure these permissions (View Records / View List / Edit Record) in Joomla’s ACL section or directly within Fabrik’s ACL settings for the specific list/form?
  • Did you use the "PDF Viewer" group only in Fabrik, or did you apply it in other parts of Joomla as well?
I ask because, even after testing with a Super User account (which should bypass any permission issues), I’m still getting a blank PDF. At this point, I’m wondering if there might be some other configuration or detail I’m missing. Did you make any changes beyond the ACL settings?

Thank you again for the details and the inspiration!
 
(which should bypass any permission issues)
Don't know the whole background, but I quite often happened to be in the super users group, but if the super users didn't get assigned the correct access level, I couldn't access some parts. There's a difference between group and access level...
 
Exactly as @wezetel says - you need to make sure if you are creating a custom access level that you also include the super user in it.
  • Did you configure these permissions (View Records / View List / Edit Record) in Joomla’s ACL section or directly within Fabrik’s ACL settings for the specific list/form? You have to use Joomla ACL > then you can select the access level in Fabrik element or whatever
  • Did you use the "PDF Viewer" group only in Fabrik, or did you apply it in other parts of Joomla as well? Only needed for fabrik
 
Back
Top