bccampus / pressbooks-mpdf Goto Github PK
View Code? Open in Web Editor NEW[UNMAINTAINED] open source HTML to PDF conversion
License: GNU General Public License v2.0
[UNMAINTAINED] open source HTML to PDF conversion
License: GNU General Public License v2.0
I don't think any of these things are a priority, but there are a few style inconsistencies between the Prince PDFs and mPDF files. I'm writing them down so they don't get forgotten, but if we dicide to ignore then we can close this issue.
Prince PDF uses Arabic numerals only, and page numbering runs uninterrupted from the first page of the front matter to the last page of the back matter. Page numbers do not start over at the beginning of the main body.
In mPDF, the front matter is numbered with Roman numerals. At the beginning of the main body, numbers switch to Arabic numerals and start at 1.
In Prince PDF, there are spaces inserted between items in a list.
In mPDF, there are no spaces between list items. This applies to both ordered and unordered lists.
All of the textboxes appear without styling (shaded textboxes and all of the educational textboxes) in the mPDF format.
This means that all of these textboxes appear white, and the headings in educational textboxes are no longer set off from the rest of the textbox:
In Prince PDF, text wraps around images if they are right/left aligned.
Text will not wrap around images that are left/right-aligned in mPDF.
In Prince formats, the captions for tables appear bolded and centred.
In mPDF format, table captions appear centred but not bolded.
In Prince PDF, you can control what appears in running headers in PDF theme options. The default, however, is alternating author name and book title on each page.
In mPDF, only the book title appears in the running header (on each page), and there is not option to change running header options in mPDF theme options
mpdf > v7.0 has different configuration options than mpdf < 7.0. Ref https://mpdf.github.io/configuration/configuration-v7-x.html
Expected behaviour
User defined options from global configurations and mpdf configurations passed to the Mpdf class need to be reflected in the output.
Actual behaviour
Since these options are handled differently in the latest version, and there may be more configuration options available in 7.0+ these options will need to be handled differently as they're passed onto the Mpdf class.
depends on #30
We are using Pressbooks and the Pressbooks mPDF plugin on a hosting provider that does not allow the use of PHP's chmod()
function and has a single dedicated place where plugins can write files to.
Our workaround for this was to comment out the chmod()
line in pressbooks-mpdf.php
and to symlink the ttfontdata
, graph_cache
, and tmp
directories (in both vendor
and symbionts/mpdf
) to the directory our hosting provider allows write access to. All of this is to say that it works, but the solution we've implemented isn't ideal because it means we have to hack stuff in your code to make it work, and in the future when this plugin updates, we'll have to reimplement our changes.
My question is, why do the folders listed above need to be writable? What are they used for? Is there a way this plugin can work its magic without requiring write access to any files?
Using Mpdf > 7.0 requires certain things to be in place, including a minimum php version, certain php modules, and minimum PB version
Expected behaviour
User should be notified if any of these dependencies are missing and will prevent them from accessing the functionality.
Actual behaviour
The requirements have changed, notifications are no longer relevant, out of date. https://mpdf.github.io/about-mpdf/requirements-v7.html
depends on #30
Running Pressbooks 3.9.8 (dev code as of 23 March), the version of htmLawed
available is the one loaded by:
if ( file_exists( PB_PLUGIN_DIR . 'symbionts/htmLawed/htmLawed.php' ) ) {
require_once( PB_PLUGIN_DIR . 'symbionts/htmLawed/htmLawed.php' );
}
The later call to \htmlawed::filter()
then fails; the current version of htmLawed
expects to be called just as htmLawed()
. I’m not submitting a pull request because I’m not sure how to test this to work flexibly with the “vanilla” version of htmlawed
too.
Languages other than English exported as strange character. Example Language: Tamil
The book exporting properly in other options prince, ebook etc.
Expected behaviour
exporting actual unicode language
Actual behaviour
Strange characters exported
To be able of make the settings for superadmin
Expected behaviour
Some times, we need to have all the books in the same format. Like one school o publishing company with some style guides. Such situation requires to have all the boooks following the same settings.
As super admin, to be able to change the settings and sync across all books would help.
Examples of RCP for multisite: http://docs.restrictcontentpro.com/article/1584-using-restrict-content-pro-with-wordpress-multisite
Actual behaviour
Each book have independent settings. We need to open book by book and to change the settings
To have more information about the sizes of the papers.
Expected behaviour
To have in the settings page an info buttom with the sizes of the papers. One for all or one for each (maybe as an external link).
As you did in the last 2 types of papers
Actual behaviour
We have just the name of the types of paper
The readme files I did, was with the wordpress.org format on my mind. I think, the == Frequently Asked Questions == should stay, not in the .md file but in the .txt file. if the information is not direct inside of the settings page
Sidebar textboxes appear as regular textboxes in mPDF.
Expected behaviour
When I have a sidebar in my book, I expect that it will appear as a sidebar in mPDF format.
What the sidebar textbox looks like in Prince:
Actual behaviour
Textboxes that are added as sidebars appear as regular textboxes in mPDF.
What the sidebar textbox looks like in mPDF:
The images and its captions are not centred when exporting to PDF.
Expected behaviour
I expected the images and their captions be centred.
Actual behaviour
Images and captions are on the left-hand side of the page.
Export to PDF using mPDF on Pressbooks. mPDF Theme options are set to A5, left margin 15 and right margin 30.
If the web book have Display part and chapter numbers deactivated,
maybe we should match the table of contents of the pdf in the same way and not to show the numbers.
Expected behaviour
To not to have numbers in the left of the titles of the sidebar TOC
Actual behaviour
we have the numered TOC
[First Step, Second Step, etc]
I get a fatal error with the version 1.6.2.1 of Pressbooks mPDF while trying to export on pdf. I'm curretly using Pressbooks Version 3.9.8.1 and Wordpress version 4.7.3.
Fatal error: Cannot redeclare htmLawed() (previously declared in /var/www/vhosts/.../wp-content/plugins/pressbooks/symbionts/htmLawed/htmLawed.php:12) in /var/www/vhosts/.../wp-content/plugins/pressbooks/vendor/vanilla/htmlawed/src/htmLawed/htmLawed.php on line 147
The output of the PDF doesn't reflect the style choices defined by the theme.
Expected behaviour
There's a reasonable expectation that the output format would retain/reflect all or most of the styles determined by the chosen theme.
Actual behaviour
It resembles theme independence. There is very little (any?) relationship between a web theme and the look and feel of the PDF file
Assuming "Set as ebook start-point" has been enabled for first item in Front Matter...
Modifying Main Body title to something else such as "Part I" will disable Table of Contents generation.
(Reproduced on fresh install instance of Pressbooks)
If you create a new book and export an mPDF, it won't include the table of contents in the body of the PDF. However, if you then browse to mPDF options, you will notice that the checkbox for including the ToC is checked. If you simply click 'save' for the settings, the table of contents will show on next export.
Now we have two folders with fonts. The one of Pressbooks and another in Pressbooks mPDF.
90mb in Pressbooks mPDF
40mb in Pressbooks
As the fonts are not the same. Is necesary to have that duplicity? is not possible to load the fonts in Pressbooks mPDF from Pressbooks in order to have the same syle in web and in pdf? or just to have the same fonts in both folders for a better compatibility?
Are the fonts on Pressbooks selected for a specifical reason? a deep review of the fonts is necesary?
thanks
To be able to have a smaller file
Expected behaviour
To have an optimice fille
Actual behaviour
We have a file that is too big. No automatic proces for the optimization.
To export a file, then go to see the size (2.4mb my example) and after is created must be manually optimice (0,5mb my example).
Why we do not have an option like the ebook options about the compression of images?
Expected behaviour
To have a new feature: Compress Images | Reduce image size and quality.
I think in a soft way, nothing really agresive, as it would decrease too much the quality of the images some times.
Actual behaviour
Just ebook export have such feature.
To publish a book, export the book and the images are compress..
To have a way of exporting all the books in the superadmin dashboard.
Expected behaviour
At once, we export all the book of the site (and maybe download too)
Actual behaviour
We have to open site by site.
mPDF won’t export my table of contents when creating a PDF.
Will you be able to help point me in the right direction as to how to rectify this?
I have tried looking this up on the internet, but there has been no solution.
I’m using Pressbooks Version 4.5.1 and Pressbooks mPDF Version 3.0.0. and Wordpress Version 4.9.4.
I have ticked Display table of contents in the mPDF options tab in Theme Options.
The chapters have names and the parts are not hidden.
Thank you in advance.
Each situation requires a different aproach.
Expected behaviour
to have two options of exportation. Even if curently do nothing different, as we allow us to modify our site with common standart, so in the future it will be easy to merge the work of the branches if necesary.
Actual behaviour
just one version.
[First Step, Second Step, etc]
What are the possible reasons why a table of contents will not be generated even though the rest of the PDF is complete?
If i export a PDF i get a warming
Expected behaviour
Just to export
Actual behaviour
Export the book, and looks lik it works the pdf, but I have the warming in the exporting page
Just export the book
PB 3.9.6 / PBT 3.0.1 / mPDF 1.0.1
Clicking on mPDF in Export initiates a white screen with title of book in upper left-hand side of webpage. No emailed errors.
No mPDF output.
This issue also occurs with other themes than PBT.
As a branding/compliance/best-practice consideration, we must update the display names of our plugins in order to clarify the distinction between plugins maintained by the Pressbooks organization vs. us — This follows the naming pattern required by guideline 17 (link above)
requires support for chapter numbers, two level TOC and custom fonts.
depends on #13
Is there a debug setting to view the mPDF process?
I have found an inconsistency in TOC generation between different functioning Pressbooks instances and I am trying to narrow down why TOC is not being generated with the same content on different servers,
Regards,
Steve
To create a form of ex libris, passive watermark, for free output.
To have an option that by activate, each new site or old site that have activate mPDF will have a watermar.
To have an option for each book that can be independent activated or not as superadmin for each book (that would be the first step, so in the future, we can create if we wish an automatic way to have or not watermarks after the payment)
Expected behaviour
To have or not watermarks upon request
Actual behaviour
we have not watermarks
update our dev and production instance of PB to all the latest.
mPDF should ultimately use the same XHTML source as Prince to ensure feature parity.
When exporting PDFs, Table of contents is coming in incomplete. Some but not all chapters are not being displayed.
Expected behaviour
I would expect all the chapter titles in the table of contents.
Actual behaviour
I can't make out a pattern in the behavior. Some books have no chapter titles at all, some books have some but not all.
I network disabled all plugins except Pressbooks, Pressbooks Aldine, Pressbooks McLuhan, Pressbooks-MPDF
Export a book to PDF and PDF only.
A sequential numbering process places numbers in front of the title as the concatenated value of a bookmark as an inexpensive way to avoid collisions (two bookmarks with the same value).
Readme.txt (/pressbooks-mpdf/symbionts/mpdf/README.txt):
To test the installation, point your browser to the basic example file : [path_to_mpdf_folder]/mpdf/examples/example01_basic.php
Examples folder does not exist
WP 4.4.1, PB 3.1.2, PBT 2.1.2, PmPDF 1.0.1
Export to PDF does not create a TOC, even when Table of Contents > Display table of contents is enabled.
No errors generated.
When I try to change the margins in mPDF theme options, my changes are removed after I click "Save."
Expected behaviour
I expect that when I change the margins in mPDF theme options, that my changes will be preserved and applied to the next mPDF export when I click save.
Actual behaviour
I open mPDF theme options. I change the left and right margins. I click save. The values in the left and right margins are reverted to their original values.
When I try to export a book as a mPDF on pressbooksdev, the export fails and I get the following message:
This page isn’t working
pressbooksdev.bccampus.ca is currently unable to handle this request.
HTTP ERROR 500
Expected behaviour
When I select mPDF as an export option and try to export a book, Pressbooks creates an mPDF file for download.
Actual behaviour
When I try to export a book as an mPDF, I am shown a page with the following error message and no mPDF file is created:
This page isn’t working
pressbooksdev.bccampus.ca is currently unable to handle this request.
HTTP ERROR 500
pressbooksdev
Readme files provide useful information to users about installation and/or features. Neither of the two readme files are complete and/or accurate.
Expected behaviour
Readme needs should reflect the current status and features of the plugin.
Actual behaviour
They don't/won't — https://wordpress.org/plugins/pressbooks-mpdf/ https://github.com/BCcampus/pressbooks-mpdf
Some times, we have so many parts. All of them are for organization behaviour. We do not use in web view. So, maybe is good idea to have an option and to not export as pdf.
Expected behaviour
To export a book. To not export the parts of the book.
Actual behaviour
We export parts and chapters
export a book as pdf and take a look.
mpdf released v7.0.x last month https://github.com/mpdf/mpdf/releases
will be upgrading from 6.1.3 to 7.0.x and working through any breaking changes — https://mpdf.github.io/installation-setup/installation-v7-x.html#upgrading-from-older-mpdf-versions
Given our hosting solution, we are unable to upgrade beyond PHP 7.0, making the PHP ^7.1 requirement for installing dependencies impossible for us.
Expected behaviour
composer install
should install all of the dependencies
Actual behaviour
We get an error in the console as follows:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0].
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.19) does not satisfy that requirement.
Problem 2
- Installation request for symfony/yaml v4.0.1 -> satisfiable by symfony/yaml[v4.0.1].
- symfony/yaml v4.0.1 requires php ^7.1.3 -> your PHP version (7.0.19) does not satisfy that requirement.
Problem 3
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.19) does not satisfy that requirement.
- phpunit/phpunit-mock-objects 3.4.4 requires doctrine/instantiator ^1.0.2 -> satisfiable by doctrine/instantiator[1.1.0].
- Installation request for phpunit/phpunit-mock-objects 3.4.4 -> satisfiable by phpunit/phpunit-mock-objects[3.4.4].
Install PHP version 7.0.x and attempt to install dependencies for the plugin via composer install
To be able to see a preview of the PDF page for each chapter or part (by using the pdf settings for such preview).
To be able to export an independent chapter or part from the edit page.
Expected behaviour
To have in each page a buttom where we can see in a pop up how would be the exported current page.
Also a way to export just one chapter or part without export the full book.
Actual behaviour
Now, if we need to know how looks like a page, we need to export a full book and to take a look. Is important to know how looks like a PDF page, the current way is slow.
Also, some times we just need to give one chapter, to export each chapter as independent would give us more flexibility as in the current way, many settings are necesary for such purpose.
In Prince PDF formats, there is the option to increase the font size of all text via PDF theme options. This feature is often used in language-learning texts where people are learning to read, and larger text can increase the accessibility of a text for people with visual impairments.
Request: Add the ability to increase font size and line height of all text to mPDF theme options.
It's manual. It's time consuming. Smart people have created things to make this work better.
Expected behaviour
Posting to WP repo after a github release should be an integrated and/or semi-automatic process.
Actual behaviour
It's manual and time consuming.
Tag a release in Github. Then fiddle through an SVN release process.
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.