This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Being selective about what content goes into the PDF

Andynashmobile wrote on 2014-10-29:
Loving the simplicity of PDF crowd.
Just wanted to know whether it can be configured to show/hide content based on HTML markup such as classes?
We control desktop and mobile view from a single page, using a hidefrommobile and hidefromdesktop class.
At the moment using PDF crowd does not distinguish and creates a PDF with all the code (often duplicating content in the file as a result - displaying both the desktop and mobile variants).

Do I have any options currently?
Are there any plans for development in the future along these kinds of lines?


support wrote on 2014-10-30:

You can use the @media rule for this purpose.

@media print {
  .screen-only { display:none }
@media screen {
  .pdf-only { display:none }

<p class="screen-only">This won't be printed</p>
<p class="pdf-only">This won't be rendered in the browser, only in PDF</p>

// use the print media type, default is screen
Andynashmobile wrote on 2014-10-31:
Many thanks!