You are here: Home » Help » Reference » Modifying your CNXML for Collection Printing

Modifying your CNXML for Collection Printing

Tips on how to modify the modules in your collection to change their printing in a collection.

If you are unsatisfied with the formatting of your collection PDF, you can modify the CNXML of the collection modules to change certain features of the printed collection. These tips primarily affect image display and table cells. Note that, if you do not see the effects of your edits using the module print-preview tool, you may have to publish the module and view it using the collection printing tool.

Changing the Size of Printed Images

You can easily modify the size of an image printed in your collection. Let's assume that you have only one version of the image --- the online version --- in your module (see below if you want to resize an alternate print image). To change that image's size, you only have to nest a <param name="print-width"/> tag inside of the <media></media> tag set for that image in your CNXML.

As an example, assume you want to set the print width for image "myimage.png" inside of figure "myfigure" to 5 inches. The CNXML for doing so is as follows:

<figure id="myfigure">
     <media type="image/png" src="myimage.png">          
          <param name="print-width" value="5in"/>  
     </media>
</figure> 

Providing an Alternate Image for Print

Sometimes, an image that displays well online will not look as good in print. If you would like, you can include an alternate, higher-resolution version of the image for print. Suppose that you want "myimage.png" to be the online image, and you'd like "myimage.eps" to be the display image. Once you've added the .eps version using the module's "Files" tab, you can include the alternate print image using the following bit of CNXML:

<figure id="myfigure">
     <media type="application/postscript" src="myimage.eps">
          <media type="image/png" src="myimage.png"/>
     </media>
</figure> 

Providing an Alternate Image for Print (with print sizing)

One of the advantages of including an alternate .eps file for print as described above is that you can tailor the image to look right on the printed page. This applies to both the image's resolution and its size. If you find yourself wishing to change the printed size of the image without modifying the .eps file itself, you can set the print width for the image in your CNXML as follows:

<figure id="myfigure">
     <media type="application/postscript" src="myimage.eps">
          <param name="print-width" value="5in"/>
          <media type="image/png" src="myimage.png"/>
     </media>
</figure> 

Changing Table Cell Widths

Finally, if you have created a table with mathematics in its cells, you may find that some expressions do not break properly and run out of their table cells. You can compensate for this by manually setting your table columns to be wide enough to contain the long expressions. For each column, a <colspec colwidth="Xin"/> is applied immediately after the table's <tgroup> element, where X gives the width in inches of the column. The order of these elements corresponds to the numbering of the columns. When using the Edit-in-Place table editing box, these elements will be the first ones in the box. Figure 1 shows an Edit-in-Place example of a two column table where the width of the first column is set to 3 inches and the width of the second is set to 1 inches.

Figure 1: Adding column widths to tables using Edit-in-Place.