#include "NOPage.h"
Public Member Functions | |
UInt32 | getFonts (NOFontVector &pFonts) |
NOFont | getFont (const UTF8Char *pURI) |
NOFont | addFont (const NOFont &pFont) |
NOFont | addFont (const UTF8Char *pFontFile) |
UInt32 | getImages (NOImageVector &pImages) |
NOImage | getImage (const UTF8String &pURI) |
NOImage | addImage (const NOImage &pImage) |
NOPackage | getPackage () |
void | getPageSize (double &pWidth, double &pHeight) |
UInt32 | getPageNumber () const |
NODocument | getDocument () const |
void | copyResourcesFrom (const NOPage &pPage) |
void | normalizeContentStream () |
NOXFixedPage | getFixedPage () |
NOXFixedPage | createFixedPage () |
UInt32 | renderToImage (unsigned char *pBuffer, UInt32 pWidth, UInt32 pHeight, bool pAntiAliasing, bool pOutlineMode=false) |
UInt32 | renderToImagePartial (unsigned char *pImageBuffer, UInt32 pWidth, UInt32 pHeight, doubleRect pXPSRect, bool pAntiAliasing, bool pOutlineMode) |
UInt32 | renderToTiff (const UTF8Char *pFile, UInt32 pWidth, UInt32 pHeight, UInt32 pResolutionInPixelsPerInch, UInt32 pAntiAliasing) |
void | checkpoint () |
bool | undo () |
bool | redo () |
UInt32 | findObjectAt (UInt32 pX, UInt32 pY, UInt32 pWidth, UInt32 pHeight) |
bool | findAndSelectText (const UTF8String &pText, UInt32 pOccurrence) |
bool | hasTextSelection () |
void | clearTextSelection () |
void | selectTextMarquee (const doubleRect &pTextRectangle) |
UInt32 | getIDForTextSelection () |
void | replaceText (UInt32 pTextObjectID, const UTF8String &pSearch, const UTF8String &pReplace) |
NOTextSelection | getTextSelection () |
doubleRect | getBoundingBox (UInt32 pId) |
void | moveObject (UInt32 pId, double pDeltaX, double pDeltaY) |
void | removeObject (UInt32 pId) |
NOSelection | getCopyOfSelection () |
void | setSelection (UInt32 pId, bool pIsSelected) |
void | swapSelection (UInt32 pId) |
void | clearSelection () |
void | selectMarquee (UInt32Rect lRect, NCommon::UInt32 pWidth, NCommon::UInt32 pHeight, bool pSwap) |
docexample_createpackage.cpp, docexample_createpage.cpp, docexample_extractimage.cpp, docexample_nocontentstream.cpp, and docexample_render.cpp.
NCommon::UInt32 NiXPSObjects::NOPage::getFonts | ( | NOFontVector & | pFonts | ) |
Returns the count of the number of fonts on this page and a vector with all the fonts.
pFonts | The vector to put the fonts in |
NOFont NiXPSObjects::NOPage::getFont | ( | const UTF8Char * | pURI | ) |
Returns the font corresponding to the URI
pURI | The URI of the font to get as a zero terminated UTF8Char pointer |
Add a font to this page and returns a handler to the new font
pFont | The font to add |
NOFont NiXPSObjects::NOPage::addFont | ( | const UTF8Char * | pFontFile | ) |
Add a font to this page and returns a handler to the new font
pFontFile | The font file to add as font |
NCommon::UInt32 NiXPSObjects::NOPage::getImages | ( | NOImageVector & | pImages | ) |
Returns the count of the number of images on this page and a vector with all the images
pImages | The vector to put the images in |
NOImage NiXPSObjects::NOPage::getImage | ( | const UTF8String & | pURI | ) |
Returns the image corresponding to the URI
pURI | The URI of the image to get as a UTF8String |
Add an image to this page and returns a handler to the new image
pImage | The image to add |
NOPackage NiXPSObjects::NOPage::getPackage | ( | ) |
Return the package this page belongs to.
void NiXPSObjects::NOPage::getPageSize | ( | double & | pWidth, | |
double & | pHeight | |||
) |
Get the page size
pWidth | A reference to a float to fill in with the width. | |
pHeight | A reference to a float to fill in with the height. |
NCommon::UInt32 NiXPSObjects::NOPage::getPageNumber | ( | ) | const |
Get the page number of this page.
NODocument NiXPSObjects::NOPage::getDocument | ( | ) | const |
Returns the document this page belongs to.
void NiXPSObjects::NOPage::copyResourcesFrom | ( | const NOPage & | pPage | ) |
Copy over the resources from another page to this page
pPage | the Page to copy resources from |
void NiXPSObjects::NOPage::normalizeContentStream | ( | ) |
NOXFixedPage NiXPSObjects::NOPage::getFixedPage | ( | ) |
get the entry point to the object model for this page
NOXFixedPage NiXPSObjects::NOPage::createFixedPage | ( | ) |
create a Fixed page element, this is the entry point to the object model for this page
UInt32 NiXPSObjects::NOPage::renderToImage | ( | unsigned char * | pBuffer, | |
UInt32 | pWidth, | |||
UInt32 | pHeight, | |||
bool | pAntiAliasing, | |||
bool | pOutlineMode = false | |||
) |
Renders a page to an image buffer of specified width and height The renderer will put the image centralized in the image buffer if the aspect ratio of the buffer does not correspond to the aspect ratio of the page. Image buffer large enough to hold 3 bytes per pixel for an image of the specified width and height The width of the image to render to The height of the image to render to True or false indicating whether we should do (computationally intensive) antialiasing True or false controls rendering in outline mode
UInt32 NiXPSObjects::NOPage::renderToImagePartial | ( | unsigned char * | pImageBuffer, | |
UInt32 | pWidth, | |||
UInt32 | pHeight, | |||
doubleRect | pXPSRect, | |||
bool | pAntiAliasing, | |||
bool | pOutlineMode | |||
) |
Renders a part of a page to an image buffer of specified width and height The renderer will put the image centralized in the image buffer if the aspect ratio of the buffer does not correspond to the aspect ratio of the part of the page. Image buffer large enough to hold 3 bytes per pixel for an image of the specified width and height The width of the image to render to The height of the image to render to The rectangle in XPS space to render True or false indicating whether we should do (computationally intensive) antialiasing True or false controls rendering in outline mode
UInt32 NiXPSObjects::NOPage::renderToTiff | ( | const UTF8Char * | pFile, | |
UInt32 | pWidth, | |||
UInt32 | pHeight, | |||
UInt32 | pResolutionInPixelsPerInch, | |||
UInt32 | pAntiAliasing | |||
) |
Renders a page to an tiff file of specified width and height The renderer will put the image centralized if the aspect ratio of the buffer does not correspond to the aspect ratio of the page. Output Tiff file The width of the image to render to The height of the image to render to Resolution to be used in the file True or false indicating whether we should do (computationally intensive) antialiasing
void NiXPSObjects::NOPage::checkpoint | ( | ) |
Mark the current content of the page as a checkpoint for a future undo/redo.
bool NiXPSObjects::NOPage::undo | ( | ) |
Undo to last checkpoint, returns success or failure.
bool NiXPSObjects::NOPage::redo | ( | ) |
Redo to the next checkpoint, returns success or failure.
UInt32 NiXPSObjects::NOPage::findObjectAt | ( | UInt32 | pX, | |
UInt32 | pY, | |||
UInt32 | pWidth, | |||
UInt32 | pHeight | |||
) |
Find the topmost object at pX horizontal and pY vertical considering the page is rendered in an image of pWidth by pHeight pixels. The X-coordinate of the object to find The Y-coordinate of the object to find The width of the image to consider the coordinates in The height of the image to consider the coordinates in
bool NiXPSObjects::NOPage::findAndSelectText | ( | const UTF8String & | pText, | |
UInt32 | pOccurrence | |||
) |
Find text and select its pOccurrence'th occurrence Text to find and select Which occurrence to find and select
bool NiXPSObjects::NOPage::hasTextSelection | ( | ) |
Return whether or not there is a current text selection on the page.
void NiXPSObjects::NOPage::clearTextSelection | ( | ) |
Reset the text selection of the page.
void NiXPSObjects::NOPage::selectTextMarquee | ( | const doubleRect & | pTextRectangle | ) |
Select all text in the rectangle in XPS coordinates indicated by pTextRectangle This rectangle is interpreted as a text rectangle, so selecting a line can be done by dragging a narrow rectangle at the beginning of a line down to the beginning of the next line
UInt32 NiXPSObjects::NOPage::getIDForTextSelection | ( | ) |
Return the object ID for the selected text.
void NiXPSObjects::NOPage::replaceText | ( | UInt32 | pTextObjectID, | |
const UTF8String & | pSearch, | |||
const UTF8String & | pReplace | |||
) |
Replace the text in the object with ID pTextObjectID so that.
NOTextSelection NiXPSObjects::NOPage::getTextSelection | ( | ) |
Return an NOTextSelection object representing the current state of text selection.
NCommon::doubleRect NiXPSObjects::NOPage::getBoundingBox | ( | UInt32 | pId | ) |
Return the bounding box of an object in XPS-coordinate space.
void NiXPSObjects::NOPage::moveObject | ( | UInt32 | pId, | |
double | pDeltaX, | |||
double | pDeltaY | |||
) |
Move the object with ID pId by pDeltaX, pDeltaY points.
void NiXPSObjects::NOPage::removeObject | ( | UInt32 | pId | ) |
Remove the object with ID pId from the page.
NOSelection NiXPSObjects::NOPage::getCopyOfSelection | ( | ) |
Gets a copy of the selection. The returned object allows to query the selection.
void NiXPSObjects::NOPage::setSelection | ( | UInt32 | pId, | |
bool | pIsSelected | |||
) |
Set the selected state of object with ID pId to be pIsSelected.
void NiXPSObjects::NOPage::swapSelection | ( | UInt32 | pId | ) |
Invert the selected state of the object with ID pId.
void NiXPSObjects::NOPage::clearSelection | ( | ) |
Clear the selection on this page.
void NiXPSObjects::NOPage::selectMarquee | ( | UInt32Rect | lRect, | |
NCommon::UInt32 | pWidth, | |||
NCommon::UInt32 | pHeight, | |||
bool | pSwap | |||
) |
Select the objects within a rectangle considering the page is rendered in an image of pWidth by pHeight pixels
pSwap | When set to true it will not change the current selection but instead swap all the objects' selected state |