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

I can't print to PDF for fabrik list and forms

Hi,

I restored my fabrik to my backup from 2013-03-01, it is backup before i install Phoca PDF.

Now, i have this fabrik from backup from my 2013-03-01 and i actualise to github version: 3.0.6.3-966-957b28f9.
(I have Joomla 2.5.9)

I try to print to PDF for fabrik lists and forms and i can't. It doesn't work for me both on front-side and in AdminPanel.

Here you have my screen shots from AdminPanel:
When click pdf icon on fabrik list i get the same without joomla and fabrik menu - it is html no pdf.

Is this function printing to pdf work for anyone? Is something i can do to print to pdf also?


second screen shot it is this what i get under browser when click "icon: print to pdf"
I used firefox and opera browser - doesn't work for both.
Doesn't work for forms also,
 

Attachments

  • 310.png
    310.png
    124.3 KB · Views: 928
  • Zaznaczenie_101.jpg
    Zaznaczenie_101.jpg
    142.2 KB · Views: 1,581
Now, i get fatal error:

linux/opera, list1
Code:
Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'Unable to find a suitable font replacement for: 'serif'' in /var/www/cc.joomla/libraries/dompdf/include/style.cls.php:848 Stack trace: #0 /var/www/cc.joomla/libraries/dompdf/include/style.cls.php(749): Style->get_font_family() #1 /var/www/cc.joomla/libraries/dompdf/include/text_frame_reflower.cls.php(164): Style->__get('font_family') #2 /var/www/cc.joomla/libraries/dompdf/include/text_frame_reflower.cls.php(332): Text_Frame_Reflower->_layout_line() #3 /var/www/cc.joomla/libraries/dompdf/include/frame_decorator.cls.php(690): Text_Frame_Reflower->reflow(Object(Block_Frame_Decorator)) #4 /var/www/cc.joomla/libraries/dompdf/include/block_frame_reflower.cls.php(750): Frame_Decorator->reflow(Object(Block_Frame_Decorator)) #5 /var/www/cc.joomla/libraries/dompdf/include/frame_decorator.cls.php(690): Block_Frame_Reflower->reflow(NULL) #6 /var/www/cc.joomla/libraries/dompdf/include/page_frame_reflower.cls.php(123): Frame_Decorator->reflow() #7 /var/www/cc.joomla/libra in /var/www/cc.joomla/libraries/dompdf/include/style.cls.php on line 848
windows/firefox, list2
Code:
Warning: Cannot use a scalar value as an array in  /var/www/cc.joomla/libraries/dompdf/include/font_metrics.cls.php on line  306  Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'Unable  to find a suitable font replacement for: 'arial, helvetica, sans-serif''  in /var/www/cc.joomla/libraries/dompdf/include/style.cls.php:848 Stack trace: #0 /var/www/cc.joomla/libraries/dompdf/include/style.cls.php(749):  Style->get_font_family() #1  /var/www/cc.joomla/libraries/dompdf/include/text_frame_reflower.cls.php(164):  Style->__get('font_family') #2  /var/www/cc.joomla/libraries/dompdf/include/text_frame_reflower.cls.php(332):  Text_Frame_Reflower->_layout_line() #3  /var/www/cc.joomla/libraries/dompdf/include/frame_decorator.cls.php(690):  Text_Frame_Reflower->reflow(Object(Block_Frame_Decorator)) #4  /var/www/cc.joomla/libraries/dompdf/include/block_frame_reflower.cls.php(750):  Frame_Decorator->reflow(Object(Block_Frame_Decorator)) #5  /var/www/cc.joomla/libraries/dompdf/include/frame_decorator.cls.php(690):  Block_Frame_Reflower->reflow(NULL) #6  /var/www/cc.joomla/libraries/dompdf/include/page_frame_reflower.cls.php(123):  Frame_Decorator->reflow() #7 / in /var/www/cc.joomla/libraries/dompdf/include/style.cls.php on  line 848
 

Attachments

  • Zaznaczenie_102.jpg
    Zaznaczenie_102.jpg
    109.9 KB · Views: 476
Troester added some stuff to the pdf code that might resolve that - could you update and test please?
 
Hi,
I have actualised to github version 3.0.6.3-976-985f0c44 from today.

I have still get an error when try print list to pdf:
Code:
Fatal error: Uncaught exception 'DOMPDF_Exception' 
with message 'Unable to find a suitable font replacement 
for: 'serif'' in /var/www/cc.joomla/libraries/dompdf/include/style.cls.php:
848 Stack trace: #0 /var/www/cc.joomla/libraries/dompdf/include/style.cls.php(749): 
Style->get_font_family() #1 /var/www/cc.joomla/libraries/dompdf/include/
text_frame_reflower.cls.php(164): 
Style->__get('font_family') #2 
/var/www/cc.joomla/libraries/dompdf/include/text_frame_reflower.cls.php(332):
 Text_Frame_Reflower->_layout_line() #3 
/var/www/cc.joomla/libraries/dompdf/include/frame_decorator.cls.php(690):
 Text_Frame_Reflower->reflow(Object(Block_Frame_Decorator)) 
#4 /var/www/cc.joomla/libraries/dompdf/include/block_frame_reflower.cls.php
(750): Frame_Decorator->reflow(Object(Block_Frame_Decorator))
 #5 /var/www/cc.joomla/libraries/dompdf/include/frame_decorator.cls.php(690):
 Block_Frame_Reflower->reflow(NULL) #6 
/var/www/cc.joomla/libraries/dompdf/include/page_frame_reflower.cls.php(123):
 Frame_Decorator->reflow() #7 
/var/www/cc.joomla/libra in /var/www/cc.joomla/libraries/dompdf/include/style.cls.php 
on line 848

It is similar when try print to pdf for forms.

------------------------------
There is one difference, for forms i have buttons:
email, print, pdf
for lists only button:
pdf
==========================
The only one what "works" is:
when use "print" button for form i get "new window" under browser with form - and when click "Print" on this form "in new window" i can print to printer
 

Attachments

  • Zaznaczenie_107.png
    Zaznaczenie_107.png
    176.7 KB · Views: 557
Can you check if there's a file
...\libraries\dompdf\lib\fonts\dompdf_font_family_cache.dist.php

I can create exactly your error message if renaming this file.
 
Hmm,
can you delete (or just rename) the files
dompdf_font_family_cache
dompdf_font_family_cache.dist

and try again?
 
i have renamed that 2 files,

Now i get pdf file for list - but without Pl (polish characters)

For form - i get pdf file also - but only header / title - without field names,
You have my form1 and pdf file for this form1 on screen shots.
 

Attachments

  • Zaznaczenie_109.png
    Zaznaczenie_109.png
    53.2 KB · Views: 510
  • Zaznaczenie_110.png
    Zaznaczenie_110.png
    125.2 KB · Views: 469
  • Zaznaczenie_111.png
    Zaznaczenie_111.png
    85.6 KB · Views: 489
ok, coming nearer;)

Polish characters:
create custom templates (list and form, just copy the ones you are using) and add custom_css.php with
* {font-family: arial!important;}

see
http://fabrikar.com/forums/showthread.php?p=165870#post165870

Form:
as far as I know dompdf normally doesn't handle float, there's a switch in
...\libraries\dompdf\dompdf_config.inc.php (about line 306), maybe this will help (or using ...\libraries\dompdf\dompdf_config.custom.inc.php, I don't know if it's loaded/working)

Maybe you'll have to tweak the custom form template (using tables instead of divs to get 2 columns)
 
Now i try to solve problem for fabrik lists. It still doesn't work well for me.


I copied.../views/list/tmpl/default to .../views/list/tmpl/default-pdf and then in custom_css.php i write:

Code:
<?php


header('Content-type: text/css');
$c = $_REQUEST['c'];
$buttonCount = (int) $_REQUEST['buttoncount'];
$buttonTotal = $buttonCount === 0 ? '100%' : 30 * $buttonCount ."px";
echo "

* {font-family: arial!important;}
";?>

But it doesn't work well
1.in header/list title i don't have polish characters
2. when print to pdf from "display: 5 records" then - datas are cut off within columns
3.when print to pdf from "display: all records" - then datas are also cut off within columns and appears "green background" for some data in columns, (see screen shots)

I don't exactly understand that pointed post/thread:


Ok , after a long time time of searching ad trying, we managed to get non-english characters in PDF file, through dompdf.

1st way.

a) U can try and use the load_font.php file, by running it from command line as

[your path to php]\php.exe [your path to joomla app]\libraries\dompdf\load_font.php Arial C:\WINDOWS\Fonts\ARIAL.TTF

Do the same with the other files that consist the font arial such as ARIALi.TTf etc.
U can find all these files attached some posts above from troaster.

I do not know if the steps below are necessary, using this way but I am gonna write them, as they are necessary for way number 2.

b) Unzip and Upload the dompdf_font_family_cache.dist.zip (../libraries/dompdf/lib/fonts/) attached few posts before, as it contains the reference for the files to be used from dompdf, accoding to the new font.

c)Create a new template that will be used as template for the "PDF template" i your list options. (../components/com_fabrik/views/list/tmpl/). U can do this by copying all files from a template(e.g. default) and name it e.g. PDF_default. In this new template Create a custom CSS (http://fabrikar.com/wiki/index.php/3.x_List_Templates) and in file custom_css.php type the code below:

PHP:
<?php

header('Content-type: text/css');
$c = $_REQUEST['c'];
$buttonCount = (int) $_REQUEST['buttoncount'];
$buttonTotal = $buttonCount === 0 ? '100%' : 30 * $buttonCount ."px";
echo "


* {font-family: arial!important;}  

";?>

This is happening because list name is not covered by #listform...



2nd way:

a) Copy all the files attached concerning the font to ../libraries/dompdf/lib/fonts. MAKE SURE THE "ARIAL" part of the filename is in CAPITAL and ll the other in NON-capital. For example i must be ARIALi.ttf

b) Follow steps b and c from the 1st way



Ok,if you think this must go to the wiki part, feel free to do it and of course correct any of my mistakes or fill in all the necessary "gaps" I have in my explanation.

Thnk u guys!!



Should i copy any files / fonts - from where, where to?
 

Attachments

  • Zaznaczenie_112.png
    Zaznaczenie_112.png
    81.9 KB · Views: 478
  • Zaznaczenie_113.png
    Zaznaczenie_113.png
    139.5 KB · Views: 476
Hello,
Does it work for anyone?
My problem (apart from problem with polish national characters) is this "highlighting" and that values in column - for example "Date"(Data) is not fully displayed:
it is: 2013-03
instead of: 2013-03-19

it is similar for other columns that are "field" or "text area" or "user" or "fileupload" type - values are not fully displayed - there is no "end" of values
other example (field: user type)
it is: ccc.pracowni
instead of: ccc.pracownik1


Can anyone help me with this?
 
The columns:
it seems your list doesn't fit to your paper size.
Did you try to set PDF paper size to e.g. a3 (and maybe orientation to landscape) in list settings/layout?
 
troester:
problem with columns persist also when change-increase size to "a1".
It is the same - see screen shoots for size "a1" orientation: landscape
 

Attachments

  • 1003-pdf.JPG
    1003-pdf.JPG
    72.3 KB · Views: 487
  • 1004-pdf-a1.JPG
    1004-pdf-a1.JPG
    81.2 KB · Views: 481
  • 1005-pdf-a1.JPG
    1005-pdf-a1.JPG
    133.1 KB · Views: 471
  • Rejestr zapotrzebowań.pdf
    855.5 KB · Views: 439
  • 1006-pdf-a1-all-records-is-highlighted-when-all-records.JPG
    1006-pdf-a1-all-records-is-highlighted-when-all-records.JPG
    126.1 KB · Views: 454
seems its something to do with the dompdf library.
I did a quick search and there seems to be a potential issue with PHP versions less than 5.2.6 - what version of PHP are you using?
 
My Joomla is on this server:
Code:
[B]System operacyjny[/B]  
Linux debianbodzio2 2.6.32-5-amd64 #1 SMP Mon Jan 16 16:22:28 UTC 2012 x86_64               
[B]Wersja bazy danych[/B]    (-----> MySQL version)  
5.1.49-3 
[B]Porz?dek znak?w w MySQL
[/B]  utf8_general_ci  
[B]Wersja PHP (-----> PHP version)[/B] 
   5.3.3-7+squeeze8 
[B]Serwer WWW[/B]    
 Apache/2.2.16 (Debian) 
[B]PHP dzia?a na[/B] 
 apache2handler
[B]Wersja Joomla![/B]
Joomla! 2.5.9 Stable [ Ember ] 4-February-2013 14:00 GMT                 
[B]Wersja platformy Joomla![/B]
Joomla Platform 11.4.0 Stable [ Brian Kernighan ] 03-Jan-2012 00:00 GMT
[B]Klient u?ytkownika[/B]               
Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top