class-pb-pdf.php not working

93 views
Skip to first unread message

jero...@gmail.com

unread,
Jan 9, 2015, 3:47:35 PM1/9/15
to press...@googlegroups.com
Installed Pressbooks 2.4. Exporting to PDF does not work. Prince installed and running well from Terminal, but nothing happens when exporting using class-pb-pdf.php: no writing to logs, only this general error 'Error: The export failed. See logs for more details.'.

Tried many things and still not working. Last thing I did was to replace code 'class-bp-pdf.php' with another version from 'http://pressbooks.googlecode.com/svn-history/r2/trunk/includes/modules/export/prince/class-pb-pdf.php'. If fails to export to pdf, but at least something is written into debug.log: 

PHP Strict standards:  Declaration of PressBooks\Export\Prince\Pdf::logError() should be compatible with PressBooks\Export\Export::logError($message, array $more_info = Array) in /wp-content/plugins/pressbooks/includes/modules/export/prince/class-pb-pdf.php on line 214

and

PressBooks\Export\Prince\Pdf
Array
(
    [time] => Fri Jan  9 20:27:25 2015
    [user] => user
    [blog_id] => 15
    [theme] => PressBooks Custom CSS
)
$this->exportStylePath must be set before calling convert().

Many thanks in advance for your help.

bdolor

unread,
Jan 9, 2015, 4:19:37 PM1/9/15
to press...@googlegroups.com
Is this a new installation of PressBooks that you're working on? 

Can you confirm the following? 
  • that wp-config.php has something like `define( 'PB_PRINCE_COMMAND', '/usr/local/bin/prince' );`
  • that wp-config.php has both `define('WP_DEBUG', true);` and `define('WP_DEBUG_LOG', true);`
  • that /wp-content/debug.log is the log file you're looking at for log entries?
  • that your apache log file is also generating some meaningful error messages. 
that should get us going in the same direction. I've tested the PDF export on my two instances after the recent upgrade and everything is working as it should. 

Brad. 

jero...@gmail.com

unread,
Jan 9, 2015, 5:49:32 PM1/9/15
to press...@googlegroups.com
Many thanks for your reply, Brad. 
  • wp-config.php has `define( 'PB_PRINCE_COMMAND', '/usr/local/bin/prince' ); `define('WP_DEBUG', true);` and `define('WP_DEBUG_LOG', true);`
  • wp-content/debug.log is the log file
  • apache log file is not generating any error message
Please advice on how to debug this php. I tried different approaches and nothing worked yet.

bdolor

unread,
Jan 9, 2015, 7:30:23 PM1/9/15
to press...@googlegroups.com
You say you have Prince working in Terminal. When you type `which prince` is that value the same as what you've defined in wp-config.php? 

Has PDF export ever worked for you, or is this a new install? 

Can you think of any file permission issues that would prevent apache from writing to certain directories? 


jero...@gmail.com

unread,
Jan 10, 2015, 3:53:42 AM1/10/15
to press...@googlegroups.com
This is a new install. First time exporting to pdf from pressbooks. 'Which Prince' replies /usr/local/bin/prince as expected. File permission issues considered too. This is what I found in /log/system.log:

Jan 10 09:47:31 MacBook-Pro.local sharingd[203]: 09:47:31.379 : Stopping Handoff advertising
Jan 10 09:47:36 MacBook-Pro com.apple.xpc.launchd[1] (com.apple.ReportCrash.Root[60595]): Endpoint has been activated through legacy launch(3) APIs. Please switch to XPC or bootstrap_check_in(): com.apple.ReportCrash.DirectoryService
Jan 10 09:47:37 MacBook-Pro.local ReportCrash[60595]: Saved crash report for prince[60594] version ??? to /Library/Logs/DiagnosticReports/prince_2015-01-10-094737_MacBook-Pro.crash
Jan 10 09:47:37 MacBook-Pro.local ReportCrash[60595]: Removing excessive log: file:///Library/Logs/DiagnosticReports/prince_2015-01-09-202507_MacBook-Pro.crash
Jan 10 09:47:40 MacBook-Pro.local sharingd[203]: 09:47:40.169 : Stopping Handoff advertising
Jan 10 09:47:44 MacBook-Pro.local sharingd[203]: 09:47:44.094 : Stopping Handoff advertising
Jan 10 09:47:46 MacBook-Pro.local sharingd[203]: 09:47:46.099 : Stopping Handoff advertising

No crash reports or files saved to DiagnosticsReports folder.

jero...@gmail.com

unread,
Jan 10, 2015, 6:38:07 AM1/10/15
to press...@googlegroups.com
Found a log file named prince_2015_01_10...crash with the following message:

Dyld Error Message:

  Symbol not found: _sqlite3_intarray_bind

  Referenced from: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData

  Expected in: /Applications/XAMPP/*/libsqlite3.dylib

 in /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData


Any idea?

jero...@gmail.com

unread,
Jan 11, 2015, 4:57:36 AM1/11/15
to press...@googlegroups.com
It seems this error is related to XAMPP installation and will be solved after uploading to web server. Does it make sense?

jero...@gmail.com

unread,
Feb 3, 2015, 5:04:45 AM2/3/15
to press...@googlegroups.com
Problem still unsolved. After uploading to web server it turns out that sharing host (Godaddy here) does not let you install XSLT functionality required for exports. At least, they said you need an expensive dedicated host.

In summary, if a key priority for Pressbooks is to let authors/readers to easily export books in different formats (EPUB and PDF mainly) there is a lot of work ahead yet.

Many thanks.

Hugh McGuire

unread,
Feb 3, 2015, 10:28:10 AM2/3/15
to jero...@gmail.com, press...@googlegroups.com
Hi, 

Options would be: 
a) use pressbooks.com (no need to fiddle with servers, we do it for you)
b) find a different/better hosting provider than GoDaddy

In the case of b) note that you will still need to install: 
- KindleGen (free) - to export MOBI
- PrinceXML (expensive) - to export PDF.

Hugh.



--
You received this message because you are subscribed to the Google Groups "PressBooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pressbooks+...@googlegroups.com.
Visit this group at http://groups.google.com/group/pressbooks.



--
---------------------------------------------------------------
hughmcguire.net | twitter.com/hughmcguire 
skype. h.mcguire | tel. +1.514.464.2047
---------------------------------------------------------------

bdolor

unread,
Feb 3, 2015, 12:20:25 PM2/3/15
to press...@googlegroups.com, jero...@gmail.com
Using XSLT as leverage to get you into a more expensive plan is an indication that the only work ahead is finding a new hosting provider. XSLT is a standard defined by the W3C. It is also free, easy to configure and the furthest thing from new or even exceptional. I would question why they are not configuring PHP to use the XSL extension and if you don't like the answer, take your business elsewhere. 
Reply all
Reply to author
Forward
0 new messages