When a link links to a page with a name containing an html-escaped character, the page name used by \DocBookExportAPI::getDocbookfromWikiPage will contain a "%" character, which is considered a malformed title. Consequently calling Title::newFromText on it will return null leading to
/w/api.php?action=getdocbook&outputformat=pdf&bookname=Test Error from line 346 of /var/www/html/w/extensions/DocBookExport/DocBookExportAPI.php: Call to a member function exists() on null Backtrace: #0 /var/www/html/w/extensions/DocBookExport/DocBookExportAPI.php(71): DocBookExportAPI->getDocbookfromWikiPage(string, ParserOptions, string, array, array) #1 /var/www/html/w/includes/api/ApiMain.php(1583): DocBookExportAPI->execute() #2 /var/www/html/w/includes/api/ApiMain.php(546): ApiMain->executeAction() #3 /var/www/html/w/includes/api/ApiMain.php(517): ApiMain->executeActionWithErrorHandling() #4 /var/www/html/w/api.php(94): ApiMain->execute() #5 {main}