/**
* Adds some <CODE>PdfContents</CODE> to this Writer.
* <P>
* The document has to be open before you can begin to add content
* to the body of the document.
*
* @return a <CODE>PdfIndirectReference</CODE>
* @param page the <CODE>PdfPage</CODE> to add
* @param contents the <CODE>PdfContents</CODE> of the page
* @throws PdfException on error
*/
internal virtual PdfIndirectReference Add(PdfPage page, PdfContents contents) {
if (!open) {
throw new PdfException(MessageLocalization.GetComposedMessage("the.document.is.not.open"));
}
PdfIndirectObject objecta;
objecta = AddToBody(contents);
page.Add(objecta.IndirectReference);
if (group != null) {
page.Put(PdfName.GROUP, group);
group = null;
}
else if (rgbTransparencyBlending) {
PdfDictionary pp = new PdfDictionary();
pp.Put(PdfName.TYPE, PdfName.GROUP);
pp.Put(PdfName.S, PdfName.TRANSPARENCY);
pp.Put(PdfName.CS, PdfName.DEVICERGB);
page.Put(PdfName.GROUP, pp);
}
root.AddPage(page);
currentPageNumber++;
return null;
}