mpdf / mpdf-examples Goto Github PK
View Code? Open in Web Editor NEWExample scripts for mPDF
Example scripts for mPDF
See mpdf/mpdf#848
Hello,
I'm have a difficult time trying to style a sup tag to fix line height issue. I see in your basic example https://github.com/mpdf/mpdf-examples/blob/development/pdf/sample_basic.pdf that the sup tag did not add any extra space above the line that its on. When I use tag in my html document I see extra spacing above the line that its on (see attachments). I have tried applying css to the mpdf stylesheet but it does not take effect, not even background color or borders work for me..
I have tried using this css code in the mpdf stylesheet but none of the properties take effect.
sup, .sup { line-height: .7em; top: -10px; font-size: 0.63em; padding-bottom: 20px; margin-bottom: 10px; border-bottom: solid 1px #000000; display: inline-block; background: yellow; }
Dynamic HTML (eg. random italics every 10-ish word in example14_page_numbers_ToC_Index_Bookmarks.php) makes comparing result files after codebase change rather difficult if not impossible.
Besides a syntax error in the file, the method $mpdf->ConvertSize()
isn't available in latest development
version of Mpdf.
We was using mPDF without issues in a server but needed to move to a new Debian 8 server, but now mPDF is unable to show the same SVG and throws next message:
error: Uncaught exception 'Mpdf\MpdfException' with message 'Cannot read an undeclared property Mpdf\Writer\BackgroundWriter::$gradients' in /var/www/mpdf/vendor/mpdf/mpdf/src/Strict.php:54 Stack trace: #0 /var/www/mpdf/vendor/mpdf/mpdf/src/Writer/BackgroundWriter.php(149): Mpdf\Writer\BackgroundWriter->__isset('gradients') #1 /var/www/mpdf/vendor/mpdf/mpdf/src/Writer/ResourceWriter.php(134): Mpdf\Writer\BackgroundWriter->writePatterns() #2 /var/www/mpdf/vendor/mpdf/mpdf/src/Mpdf.php(9838): Mpdf\Writer\ResourceWriter->writeResources() #3 /var/www/mpdf/vendor/mpdf/mpdf/src/Mpdf.php(2015): Mpdf\Mpdf->_enddoc() #4 /var/www/mpdf/vendor/mpdf/mpdf/src/Mpdf.php(9329): Mpdf\Mpdf->Close() #5 /var/www/mpdf/boletin_completo.php(335): Mpdf\Mpdf->Output('/var/www/mpdf/g...', 'F') #6 {main} thrown in /var/www/mpdf/vendor/mpdf/mpdf/src/Strict.php on line 54
What could be the problem? Any ideas?
Thank you
My mpdf version is 6.0
I tried example05_tables.php
worked fine but when I tried adding border-radius: 7px 7px 0 0;
in style that didn't work. Is there anything else I need to add to add radius in table border? or this is a bug?
I have read the readme file which says to install composer and I did. Then I ran the command 'composer install' which returned no error:
$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
$ echo $?
0
Then I ran the first script:
$ php ./example01_basic.php
PHP Warning: require_once(/Users/xxx/Documents/www/pdf2/mpdf-examples/../../../vendor/autoload.php): failed to open stream: No such file or directory in /Users/xxx/Documents/www/pdf2/mpdf-examples/example01_basic.php on line 171
Warning: require_once(/Users/xxx/Documents/www/pdf2/mpdf-examples/../../../vendor/autoload.php): failed to open stream: No such file or directory in /Users/xxx/Documents/www/pdf2/mpdf-examples/example01_basic.php on line 171
PHP Fatal error: require_once(): Failed opening required '/Users/xxx/Documents/www/pdf2/mpdf-examples/../../../vendor/autoload.php' (include_path='.:') in /Users/xxx/Documents/www/pdf2/mpdf-examples/example01_basic.php on line 171
Fatal error: require_once(): Failed opening required '/Users/xxx/Documents/www/pdf2/mpdf-examples/../../../vendor/autoload.php' (include_path='.:') in /Users/xxx/Documents/www/pdf2/mpdf-examples/example01_basic.php on line 171
$ echo $?
255
I get the same result in the browser...
Am I missing something?
MathJaxProcess.php doesn't work with mpdf 8.0, Mpdf-->SizeConverter needs 4 parameter in mpdf 8.0
In example04_images.php
, the images returned by tiger.php
don't work.
When executing from the command line php example04_images.php > out.pdf
, the file will contain [X]
type of images, meaning that they failed to load.
When loading the script from the browser, it will get stuck forever loading.
Hey Guys,
I found a possible bug in MPDF 7 where if we populate the PDF file with enough content to fit one page, whether it's one table or 7, it works without an issue, but as soon as my 3rd table for example reaches the end of the page (by which point it should create a second page), The script no longer generates the PDF file, and I am met with an error message which reads: must precede in a table
I did notice while playing around, if I add a page break tag right before the table, it generates the PDF fine without any issues...
From what I can see, it look's like the issue pops up as soon as the data becomes longer than 1 page, and the page is not broken by me, so it would appear to be a bug in the auto page break?
Please let me know if you need any more info from me, and/or what a possible solution to the issue might be?
I have this string in a sentence stored in the database:
"vóór"
but it will display as:
"vÃ3Ã3r"
while the same string hard coded in the html will display correctly.
Any help with this issue will be appreciated
Franco
The following properties are references in the example, but because of the refractor these are no longer directly accessible.
$mpdf->formUseZapD = false;
$mpdf->formUseZapD = false;
$mpdf->formSubmitNoValueFields = true;
$mpdf->formExportType = 'xfdf'; // 'html' or 'xfdf'
$mpdf->formSelectDefaultOption = true; // for Select drop down box; if no option is explicitly maked as selected,
// this determines whether to select 1st option (as per browser)
// - affects whether "required" attribute is relevant
$mpdf->form_border_color = '0.0 0.820 0.0';
$mpdf->form_background_color = '0.941 0.941 0.941';
$mpdf->form_border_width = '1';
$mpdf->form_border_style = 'S';
$mpdf->form_radio_color = '0.0 0.820 0.0';
$mpdf->form_radio_background_color = '0.941 0.5 0.5';
$mpdf->form_button_border_color = '0.0 0.820 0.0';
$mpdf->form_button_background_color = '0.941 0.941 0.941';
$mpdf->form_button_border_width = '1';
$mpdf->form_button_border_style = 'S';
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.