7. How Do I Set CSS & XSLT Stylesheets?

You can set CSS stylesheets either by referencing them in your document, setting or adding them using an API method, or inline in your document.

Defining a CSS Stylesheet in the "style" Section of the Document:

<head><style type="text/css">p { color: red }</style></head>

Referencing an external CSS Stylesheet using the <link> Element:

<link href="http://someServer/css/layout.css" 
  rel="stylesheet" type="text/css">...</link>

Defining CSS Styles Inline:

<table style="color: red">...</table>

Adding a CSS Stylesheet Using an API Method:

Java: pdfReactor.addUserStyleSheet("", "", "", "http://server/layout.css")
PHP:  pdfReactor->addUserStyleSheet("", "", "", "http://server/layout.css")
.NET: pdfReactor.AddUserStyleSheet("", "", "", "http://server/layout.css")
CLI:  -s "http://some/layout.css"
Java: pdfReactor.addUserStyleSheet("p { color: red }", "", "", "")
PHP:  pdfReactor->addUserStyleSheet("p { color: red }", "", "", "")
.NET: pdfReactor.AddUserStyleSheet("p { color: red }", "", "", "")
CLI:  -u "p { color: red }"

XSLT style sheets can be set either using an API method, or by referencing them in the document. They can not be specified directly inline as CSS stylesheets can be.

Adding an XSLT Stylesheet Using an API Method:

CLI:  java -jar pdfreactor.jar -a links bookmarks -s file:///C:/style.css 
-X file:///C:/xsl-style.xsl sample.html C:/sample.pdf
PHP:  $pdfreactor->addXSLTStyleSheet(null, "style.xsl");
Java: pdfReactor.addXSLTStyleSheet(null, "style.xsl");
.Net: pdfReactor.AddXSLTStyleSheet(null, "style.xsl");

Referencing an External XSLT Stylesheet <link> Element:

<link href="wizardOfOz.css" type="text/css" rel="stylesheet"/>