• 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.

New PDF option

Status
Not open for further replies.

troester

Well-Known Member
Staff member
I would like to test it but I get

Notice: Constant DOMPDF_ENABLE_REMOTE already defined in ...\libraries\dompdf\dompdf_config.inc.php on line 196

Fatal error: Class 'DOMPDF' not found in ...\libraries\joomla\document\pdf\pdf.php on line 67

when clicking the PDF button.
 
(Fabrik-fabrik-3.0.5-509-g2f6a725.zip)

i can confirm the problems :
1. Notice: Constant DOMPDF_ENABLE_REMOTE already defined in ...libraries\dompdf\dompdf_config.inc.php on line 196

2. Fatal error: Class 'DOMPDF' not found in ...\libraries\joomla\document\pdf\pdf.php on line 67

Also, how can i setup show / hide pdf button with global parameter ?
 
Looks like I added the wrong DOMPDF lib to github ... I added 0.5.2 stable, instead of 0.6.0 Beta 3, which is what Rob was using to develop this.

Working on changing the lib in github now.

-- hugh
 
things should be updated now, both Hugh and I can create pdfs, would you mind re-updating and testing again please?
 
Yup, PDFs are created (list,form,details).
List PDF is looking really nice, form/details will need some template work.
 
Fatal error: Call to undefined method Page_Frame_Decorator::add_line() in /home/path/public_html/j25/libraries/dompdf/include/block_positioner.cls.php on line 32

Blank screen with this message appears after clicked on pdf icon.
 
Is it in list, form or details view?
Just updated to J!2.5.5 and PDF is still working; the details PDF can't be used (all info in the upper left corner) but it is created.

Do you have special elements or templates (I've only tested with some field, textarea and date elements and default template)?
 
Ok, I get this error if the list doesn't fit on one page. So maybe there have to be special PDF template set ups, is there any docu?

Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'Frame not found in cellmap' in C:\xampp\htdocs\j17fabrik\libraries\dompdf\include\cellmap.cls.php:212 Stack trace: #0 C:\xampp\htdocs\j17fabrik\libraries\dompdf\include\table_cell_renderer.cls.php(51): Cellmap->get_spanned_cells(Object(Table_Cell_Frame_Decorator)) #1 C:\xampp\htdocs\j17fabrik\libraries\dompdf\include\renderer.cls.php(283): Table_Cell_Renderer->render(Object(Table_Cell_Frame_Decorator)) #2 C:\xampp\htdocs\j17fabrik\libraries\dompdf\include\renderer.cls.php(117): Renderer->_render_frame('table-cell', Object(Table_Cell_Frame_Decorator)) #3 C:\xampp\htdocs\j17fabrik\libraries\dompdf\include\renderer.cls.php(185): Renderer->render(Object(Table_Cell_Frame_Decorator), false) #4 C:\xampp\htdocs\j17fabrik\libraries\dompdf\include\renderer.cls.php(185): Renderer->render(Object(Table_Row_Frame_Decorator), false) #5 C:\xampp\htdocs\j17fabrik\libraries\dompdf\include\renderer.cls.php(185): Renderer->render(Object(Table_Row_Group_Frame_Decorator), false) in C:\xampp\htdocs\j17fabrik\libraries\dompdf\include\cellmap.cls.php on line 212
 
@jaanus: have you checked that your pages' html is valid? This is an internal error in dompdf theres a couple of web pages I googled which suggest that the pdf render has a hard time if large numbers of floats are used, or complex html
http://code.google.com/p/dompdf/issues/detail?id=203
https://groups.google.com/forum/?fromgroups#!topic/dompdf/XiazeKinyXo

@troester - that seems to occur if your table flows over 2 pages, not sure what to suggest at the moment.
Both forms and lists have the option to set pdf templates. These work in the same way as normal html templates.
Ensure that the html is valid markup as dompdf is more fussy than a normal browser when it comes to rendering.
 
I've used the default templates.
I'll have a look at your links and play a bit (if get the time).

It's really nice to imagine of a sort of list div template (every row = one PDF page) to create reports from your filtered list.
 
- Joomla 2.5.5
- Fabrik-fabrik-3.0.5-548-g3ad0f26.zip

IF i click pdf button in a list i get errors :

1) Warning: Cannot use a scalar value as an array in
...\libraries\dompdf\include\font_metrics.cls.php on line 289

2) Warning: Invalid argument supplied for foreach() in
...\libraries\dompdf\include\font_metrics.cls.php on line 168

3) Fatal error: Uncaught exception 'DOMPDF_Exception'
with message 'Unable to find a suitable font replacement
for: 'arial, helvetica, sans-serif'' in
...\libraries\dompdf\include\style.cls.php:805 Stack trace: #0 ...\libraries\dompdf\include\style.cls.php(718):
Style->get_font_family() #1 ...\libraries\dompdf\include\text_frame_reflower.cls.php(165):
Style->__get('font_family') #2 ...\libraries\dompdf\include\text_frame_reflower.cls.php(333):
Text_Frame_Reflower->_layout_line() #3 ...\libraries\dompdf\include\frame_decorator.cls.php(556):
Text_Frame_Reflower->reflow(Object(Block_Frame_Decorator)) #4 ...\libraries\dompdf\include\block_frame_reflower.cls.php(722):
Frame_Decorator->reflow(Object(Block_Frame_Decorator)) #5 ...\libraries\dompdf\include\frame_decorator.cls.php(556):
Block_Frame_Reflower->reflow(NULL) #6 ...\libraries\dompdf\include\page_frame_reflower.cls.php(138):
Frame_Decorator->reflow() #7 D in ...\libraries\dompdf\include\style.cls.php on line 805
 
Well... with such Joomla templates as JAPurity II and Beez5:

Warning: Cannot use a scalar value as an array in /home/np11988/domains/nurmoja.net.ee/public_html/j25/libraries/dompdf/include/font_metrics.cls.php on line 289

Warning: file_put_contents(/home/...../libraries/dompdf/lib/fonts/716ae7fe018f10b7d8f48f43f45f2e84.ttf) [function.file-put-contents0]: failed to open stream: Permission denied in /home/..../libraries/dompdf/include/font_metrics.cls.php on line 315

Warning: file_get_contents(/home/np11988/domains/nurmoja.net.ee/public_html/j25/libraries/dompdf/lib/fonts/716ae7fe018f10b7d8f48f43f45f2e84.ttf) [function.file-get-contents0]: failed to open stream: No such file or directory in /home/..../libraries/dompdf/lib/php-font-lib/classes/font.cls.php on line 23

Warning: file_get_contents(/home/.../libraries/dompdf/lib/fonts/716ae7fe018f10b7d8f48f43f45f2e84.ttf) [function.file-get-contents0]: failed to open stream: No such file or directory in /home/.../libraries/dompdf/lib/php-font-lib/classes/font.cls.php on line 43

Fatal error: Call to undefined method Page_Frame_Decorator::add_line() in /home/.../libraries/dompdf/include/block_positioner.cls.php on line 32

With Phoca Wallpapers and Beez2 only

Fatal error: Call to undefined method Page_Frame_Decorator::add_line() in /home/.../libraries/dompdf/include/block_positioner.cls.php on line 32
 
Are you sure you are running the very latest github? One of your errors above shows DOMPDF trying to write it's font cache file to your libraries/dompdf/lib/fonts folder, which is something we changed last night, so it should use J!'s tmp folder for the font cache, so it doesn't need write access to your libraries.

-- hugh
 
I tried using this just to test it out and all was well except that there was an "image not found" message where the print icon should be. I doubt you intended any of those (print, email, pdf) icons to even show on a PDF printout anyhow - but just to let you know what happened when I tried. (screen print attached)

Using the default template, the list-style was putting (in my case) little squares ahead of each element in the LI and the element value appeared on a separate line below the Label (though offset to the right) . I'm not sure if that is the intended style or not - but just to let you know that is how it appeared for me.

My first thought was that each element group should be on one line and floated left - e.g. with a "clear:both;" between each label/value pair, such as... Label: value. But the more I thought about it, the way it is now makes sense, as some labels might be quite long.

So the only thing I'd like to see changed is perhaps adding a small top-margin to each element group to better distinguish each Label, Value pair?

Or is this PDF styling format using the defined form group layout? (e.g. # of columns and column width specs). In that case I suppose I can make the changes in the form css myself - nevermind.:-[
 

Attachments

  • pdfsample.PNG
    pdfsample.PNG
    749.5 KB · Views: 777
The admin form template seems to be a quite good PDF template.

Which one did you select? The square in front of the labels may be <li> settings coming from your Joomla template.

On my site default, bluesky ... are displaying all elements in the upper left corner (I assume because of some position:absolute settings)

I think a default_pdf template would be nice.
 
Are you sure you are running the very latest github? One of your errors above shows DOMPDF trying to write it's font cache file to your libraries/dompdf/lib/fonts folder, which is something we changed last night, so it should use J!'s tmp folder for the font cache, so it doesn't need write access to your libraries.
-- hugh

Yes, updated with forced overwrite. Even deleted the same unnecessary files and folders that were deleted from github.
Just now updated once more. And still
Fatal error: Call to undefined method Page_Frame_Decorator::add_line() in /home/.../libraries/dompdf/include/block_positioner.cls.php on line 32
Even setting this fonts folder to be writable didn't help
 
The admin form template seems to be a quite good PDF template.

Which one did you select? The square in front of the labels may be <li> settings coming from your Joomla template.

On my site default, bluesky ... are displaying all elements in the upper left corner (I assume because of some position:absolute settings)

I think a default_pdf template would be nice.
As mentioned, that is with the default template.

And I agree - a default_pdf template (or Print and PDF templates for each Form template) would make it easier to configure the PDF layout on a per-form basis.

That seems like an easy fix - with no special changes to the backend configuration - just change the rules so that during PDF creation, Fabrik looks for the pdf template in the selected Form template folder. (Oh, and that's not a "demand" - it's just a suggestion - just in case anyone "reads" my suggestion the wrong way.;) )
 
Yup, I think the plan is to create a default PDF template, if we can't get the standard templates to render reliably.

This update was simply laying the groundwork, and getting the basics for a PDF view type in place, which took a lot of work. The PDF commit was merging a branch back in to the master that Rob has been working on for a month or so. If you look at the view layouts, you'll see we now have a view.base.php, which forms the common view for all the specific view types (view.html.php, view.pdf.php, view.raw.php, etc).

Now that we have a usable PDF library, J! document type and workable form / list view in place, we'll start iterating through the usual process of thrashing out bugs, and making it look pretty. If we can't do that through the standard templates, we'll look at a specific default PDF template.

Bottom line - PDF is "work in progress", we'll chip away at it as hard as we can. And obviously we'll see if we can replicate and fix the issues you are reporting.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top