Forum How do I...?

PDF Not printing beyond 50 pages

pankaj_morajkar
Hello all,

I am trying to print a PDF from an Mindtouch page and it not printing beyond 50 pages. I am getting the following error.

<error><exception>MindTouch.Deki.Exceptions.ExportPDFTooManyPagesException</exception><resource>System.API.Error.pdf_too_many_pages</resource><arguments count="2"><argument>54</argument><argument>50</argument></arguments><message>This PDF has 54 pages. The limit is 50 pages.</message><data><pagecount>54</pagecount><pagelimit>50</pagelimit></data></error>

This is the code that we are using to generate the PDF.

var pdfLink = xml.text(wiki.api(uri.build(site.api, ['pages', string.cast(page.id)])), '/page/contents.alt/@href');
var pdfWithChildren = pdfLink .. "?stylesheet=default&deep=true&showtoc=true";
var pdfWithoutChildren = pdfLink .. "?stylesheet=default&deep=false";
<div id="pdf-book">
//<a href=(pdfWithoutChildren) rel="nofollow" target="_blank" title="Export page and child pages as a PDF"><span class="mt-icon-article-pdf"></span></a>
<a href=(pdfWithChildren) rel="nofollow" target="_blank" title="Export page and child pages as a PDF"><span class="mt-icon-book pdf"></span></a>;
//<span class="mt-icon-page-notification off"></span>
</div>

I am not a developer, hence not able to decode this. Can somebody help?
mikeday
Apparently MindTouch has a limit where at most 50 pages can be combined into a single PDF.
pankaj_morajkar
Hello Mike,

Is there any customization that can be done to resolve this? I have access to another site which is hosted on Mindtouch and I can see that they have configured to print it beyond 50 pages. Unfortunately I don't have the contact details of the admin of the site to verify how they have done it?
mikeday
A quick look around doesn't show any obvious setting for changing this, so you may need to ask a PHP guru to dig around in the templates and see where the limit is coming from. :(