/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // // PdfPublishPage.h // /////////////////////////////////////////////////////////////////////////////// #ifndef _PDF_PUBLISH_PAGE_INCLUDED_ #define _PDF_PUBLISH_PAGE_INCLUDED_ #include "PdfPublishBaseObject.h" #include "PdfPublishAnnotation.h" #include "PdfPublishText.h" #include "PdfPublishImage.h" #include "PdfPublishTextField.h" #include "PdfPublishSignatureField.h" #include "PdfPublishDropDownList.h" #include "PdfPublishListBox.h" #include "PdfPublishRadioButton.h" #include "PdfPublishCheckBox.h" #include "PdfPublishLink.h" #include "PdfPublishSlideTable.h" #include "PdfPublishButton.h" #include "PdfPublishTable.h" #include "PdfPublishTableCreator.h" #include "PdfPublish2dGeometryReference.h" #include "PdfPublishCADReference.h" #include "PdfPublishStickyNote.h" #include "PdfPublishWatermark.h" #include "PdfPublishStampAnnotation.h" #include "PdfPublishInkAnnotation.h" #include "PdfPublishLineAnnotation.h" #include "PdfPublishCircleAnnotation.h" #include "PdfPublishSquareAnnotation.h" #include "PdfPublishPolylineAnnotation.h" #include "PdfPublishPolygonAnnotation.h" /** \details Contains declarations for Publish SDK. */ namespace OdPdfPublish{ /** \details This class implements a page object for a .pdf document created with Publish SDK. A page is determined by two properties: format (size of its sides) and orientation (which side aligns horizontally) and can contain a set of different controls and fields (such as , , , , , etc.). */ class PDFPUBLISH_TOOLKIT OdPage : public OdObject { //DOM-IGNORE-BEGIN protected: OdPage(); //DOM-IGNORE-END public: //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdPage); ODRX_HEAP_OPERATORS(); //DOM-IGNORE-END /** \details Destroys a page object. */ ~OdPage() override; /** \details Sets the page format. \param format [in] A new page value. \sa . */ void setFormat(Page::Format format); /** \details Sets the page orientation. \param orientation [in] A new page orientation value. \sa . */ void setOrientation(Page::Orientation orientation); /** \details Sets a new page size. \param units [in] Paper size units. \param width [out] A paper width value. \param height [out] A paper height value. \sa . */ void setPaperSize(const Page::PaperUnits units, const double width, const double height); /** \details Adds a new to the page. \param annotation [in] A smart pointer to an annotation object that should be added. \param location [in] A rectangle that specifies the location of an added annotation within the page. It determines where the annotation will be placed on the page. \sa . */ void addAnnotation(const OdAnnotationPtr& annotation, const OdRect& location); /** \details Adds a label to the page. \param text [in] A smart pointer to a text label that should be added. \param location [in] A rectangle that specifies the location of an added text label within the page. It determines where the text will be placed on the page. \param rotation [in] A rotation angle value to be set. \remarks The location determines the bottom left position of the bounding box of text on the page. \sa . */ void addText(const OdTextPtr& text, const OdRect& location, const double rotation = 0.); /** \details Adds an to the page. \param image [in] A smart pointer to an image object that should be added. \param location [in] A rectangle that specifies the location of an added image within the page. It determines where the image will be placed on the page. \param rotation [in] A rotation angle value to be set. \sa . */ void addImage(const OdImagePtr& image, const OdRect& location, const double rotation = 0.); /** \details Adds a to the page. \param table [in] A smart pointer to a table object that should be added. \param location [in] A rectangle that specifies the location of an added table within the page. It determines where the table will be placed on the page. \sa . */ void addTable(const OdTablePtr& table, const OdRect& location); /** \details Adds a to the page. \param link [in] A smart pointer to a link object that should be added. \param location [in] A rectangle that specifies the location of an added link within the page. It determines where the link will be placed on the page. \sa . */ void addLink(const OdLinkPtr& link, const OdRect& location); /** \details Adds a to the page. \param button [in] A smart pointer to a button control that should be added. \param location [in] A rectangle that specifies the location of an added button control within the page. It determines where the button control will be placed on the page. \sa . */ void addButton(const OdButtonPtr& button, const OdRect& location); /** \details Adds a to the page. \param text_field [in] A smart pointer to a text field object that should be added. \param location [in] A rectangle that specifies the location of an added text field within the page. It determines where the text field will be placed on the page. \sa . */ void addTextField(const OdTextFieldPtr& text_field, const OdRect& location); /** \details Adds a to the page. \param slide_table [in] A smart pointer to a slide table object that should be added. \param location [in] A rectangle that specifies the location of an added slide table within the page. It determines where the slide table is placed on the page. \sa . */ void addSlideTable(const OdSlideTablePtr& slide_table, const OdRect& location); /** \details Adds a to the page. \param check_box [in] A smart pointer to a checkbox object that should be added. \param location [in] A rectangle that specifies the location of an added checkbox within the page. It determines where the checkbox is placed on the page. \sa . */ void addCheckBox(const OdCheckBoxPtr& check_box, const OdRect& location); /** \details Adds a to the page. \param radio_button [in] A smart pointer to a radio button object that should be added. \param location [in] A rectangle that specifies the location of an added radio button within the page. It determines where the radio button is placed on the page. \sa . */ void addRadioButton(const OdRadioButtonPtr& radio_button, const OdRect& location); /** \details Adds a to the page. \param list_box [in] A smart pointer to a list box object that should be added. \param location [in] A rectangle that specifies the location of an added list box within the page. It determines where the list box is placed on the page. \sa . */ void addListBox(const OdListBoxPtr& list_box, const OdRect& location); /** \details Adds a (combo box) to the page. \param drop_down_list [in] A smart pointer to a drop-down list object that should be added. \param location [in] A rectangle that specifies the location of an added drop-down list within the page. It determines where the drop-down list is placed on the page. \sa . */ void addDropDownList(const OdDropDownListPtr& drop_down_list, const OdRect& location); /** \details Adds a to the page. \param signature_field [in] A smart pointer to a signature field object that should be added. \param location [in] A rectangle that specifies the location of an added signature field within the page. It determines where the signature field is placed on the page. \sa . */ void addSignatureField(const OdSignatureFieldPtr& signature_field, const OdRect& location); /** \details Adds a two-dimensional geometry reference to the page. \param geom [in] A smart pointer to the 2D geometry reference to be added. \param location [in] A location where to place the geometry. */ void add2dGeometry(const Od2dGeometryReferencePtr& geom, const OdRect& location); /** \details Adds a two-dimensional geometry reference to the page. \param geom [in] A smart pointer to the 2D geometry reference to be added. \remarks The location and size of the geometry is defined by the transformation matrix in the geometry reference object passed to the method (geom parameter). */ void add2dGeometry(const Od2dGeometryReferencePtr& geom); /** \details Adds a CAD reference object to the page. \param CADreferense [in] A smart pointer to a CAD reference object. \param location [in] A rectangle that specifies the page area where the CAD reference should be added. \sa . */ void addCADReference(const OdCADReferencePtr& CADreferense, const OdRect& location); /** \details Adds a CAD reference object to the page. \param CADreferense [in] A smart pointer to a CAD reference object. \remarks The location and size of the CAD object is defined by the transformation matrix in the CAD reference object passed to the method (CADreference parameter). \sa . */ void addCADReference(const OdCADReferencePtr& CADreferense); /** \details Adds a object to the . \param note [in] A smart pointer to a object. \param location [in] A that specifies the page area where the appears. \remarks The size and appearance of the object icon is predefined and depends on the viewer application. The position of the icon is specified by the center of the specified rectangle. \sa . */ void addStickyNote(const OdStickyNotePtr& note, const OdRect& location); /** \details Adds a object to the . \param stamp [in] A smart pointer to a object. \param location [in] A that specifies the page area where the appears. \remarks The size and appearance of the object icon is predefined and depends on the viewer application. The position of the icon is specified by the center of the specified rectangle. \sa . */ void addStampAnnotation(const OdStampAnnotationPtr& stamp, const OdRect& location); /** \details Adds a object to the . \param ink [in] A smart pointer to a object. \param location [in] A that specifies the page area where the appears. \sa . */ void addInkAnnotation(const OdInkAnnotationPtr& ink, const OdRect& location); /** \details Adds a object to the . \param line [in] A smart pointer to a object. \param location [in] A that specifies the page area where the appears. \sa . */ void addLineAnnotation(const OdLineAnnotationPtr& line, const OdRect& location); /** \details Adds a object to the . \param circle [in] A smart pointer to a object. \param location [in] A that specifies the page area where the appears. \sa . */ void addCircleAnnotation(const OdCircleAnnotationPtr& circle, const OdRect& location); /** \details Adds a object to the . \param square [in] A smart pointer to a object. \param location [in] A that specifies the page area where the appears. \sa . */ void addSquareAnnotation(const OdSquareAnnotationPtr& square, const OdRect& location); /** \details Adds a object to the . \param polyline [in] A smart pointer to a object. \param location [in] A that specifies the page area where the appears. \sa . */ void addPolylineAnnotation(const OdPolylineAnnotationPtr& polyline, const OdRect& location); /** \details Adds a object to the . \param polygon [in] A smart pointer to a object. \param location [in] A that specifies the page area where the appears. \sa . */ void addPolygonAnnotation(const OdPolygonAnnotationPtr& polygon, const OdRect& location); /** \details Adds a label to the page. \param watermark [in] A smart pointer to a that should be added. \param location [in] A that specifies the location of the watermark object within the page. It determines where the watermark text is placed on the page. \remarks The inserted is scaled to the location rectangle size. \sa . */ void addWatermark(const OdWatermarkPtr& watermark, const OdRect& location); /** \details Adds a JavaScript scenario for a specified field on the page. \param field_name [in] A field name to add JavaScript scenario. \param source [in] JavaScript scenario source text. \param action_type [in] An action type that triggers the JavaScript scenario. \param source_type [in] A JavaScript scenario source type. \remarks The field_name parameter should contain the name of a , or other control object. The specified JavaScript scenario runs when the specified with the action_type occurs. \sa . . */ void addJavaScriptActionByField(const OdString& field_name, const OdString& source, const Action::Type action_type, const Source::Type source_type = Source::kCode); /** \details Returns the current page format. \param format [out] A placeholder for the value. The method stores the format value in this placeholder and returns it to the calling subroutine. \sa . */ void getFormat(Page::Format& format) const; /** \details Returns the current value. \param orientation [out] A placeholder for the orientation value. The method stores the page orientation value in this placeholder and returns it to the calling subroutine. \sa . */ void getOrientation(Page::Orientation& orientation) const; /** \details Returns the current page size. The method fills two passed double values with width and height values, then returns them to a calling subroutine. \param units [in] The unit. \param width [out] A placeholder for the paper width value. \param height [out] A placeholder for the paper height value. \sa . */ void getPaperSize(const Page::PaperUnits units, double& width, double& height) const; /** \details Returns all that the page contains and their locations. The method fills two passed arrays with annotation objects and their locations, then returns these arrays to a calling subroutine. \param annotations [out] A placeholder for the page annotations array. \param locations [out] A placeholder for the annotation locations array. \sa . */ void getAnnotations(OdAnnotationPtrArray& annotations, OdRectArray& locations) const; /** \details Returns all that the page contains and their locations. The method fills three passed arrays with text label objects, their locations, and their rotation angles, then returns these arrays to a calling subroutine. \param texts [out] A placeholder for the page text labels array. \param locations [out] A placeholder for the text label locations array. \param rotations [out] A placeholder for the array of rotation angles for text labels. \sa . */ void getTexts(OdTextPtrArray& texts, OdRectArray& locations, OdDoubleArray& rotations) const; /** \details Returns all that the page contains and their locations. The method fills three passed arrays with image objects, their locations, and their rotation angles, then returns these arrays to a calling subroutine. \param images [out] A placeholder for the page images array. \param locations [out] A placeholder for the image locations array. \param rotations [out] A placeholder for the array rotation angles for images. \sa . */ void getImages(OdImagePtrArray& images, OdRectArray& locations, OdDoubleArray& rotations) const; /** \details Returns all that the page contains and their locations. The method fills two passed arrays with table objects and their locations, then returns these arrays to a calling subroutine. \param tables [out] A placeholder for the page tables array. \param locations [out] A placeholder for the table locations array. . */ void getTables(OdTablePtrArray& tables, OdRectArray& locations) const; /** \details Returns all that the page contains and their locations. The method fills two passed arrays with link objects and their locations, then returns these arrays to a calling subroutine. \param links [out] A placeholder for the page links array. \param locations [out] A placeholder for the link locations array. \sa . */ void getLinks(OdLinkPtrArray& links, OdRectArray& locations) const; /** \details Returns all that the page contains and their locations. The method fills two passed arrays with button objects and their locations, then returns these arrays to a calling subroutine. \param buttons [out] A placeholder for the page buttons array. \param locations [out] A placeholder for the link locations array. \sa . */ void getButtons(OdButtonPtrArray& buttons, OdRectArray& locations) const; /** \details Returns all that the page contains and their locations. The method fills two passed arrays with checkbox objects and their locations, then returns these arrays to a calling subroutine. \param check_boxes [out] A placeholder for the page checkboxes array. \param locations [out] A placeholder for the checkbox locations array. \sa . */ void getCheckBoxes(OdCheckBoxPtrArray& check_boxes, OdRectArray& locations) const; /** \details Returns all that the page contains and their locations. The method fills two passed arrays with radio button objects and their locations, then returns these arrays to a calling subroutine. \param radio_buttons [out] A placeholder for the page radio buttons array. \param locations [out] A placeholder for the radio button locations array. \sa . */ void getRadioButtons(OdRadioButtonPtrArray& radio_buttons, OdRectArray& locations) const; /** \details Returns all that the page contains and their locations. The method fills two passed arrays with list box objects and their locations, then returns these arrays to a calling subroutine. \param list_boxes [out] A placeholder for the page list boxes array. \param locations [out] A placeholder for the list box locations array. \sa . */ void getListBoxes(OdListBoxPtrArray& list_boxes, OdRectArray& locations) const; /** \details Returns all that the page contains and their locations. The method fills two passed arrays with drop-down list objects and their locations, then returns these arrays to a calling subroutine. \param drop_down_lists [out] A placeholder for the page drop-down lists array. \param locations [out] A placeholder for the drop-down list locations array. . */ void getDropDownLists(OdDropDownListPtrArray& drop_down_lists, OdRectArray& locations) const; /** \details Returns all that the page contains and their locations. The method fills two passed arrays with signature field objects and their locations, then returns these arrays to a calling subroutine. \param signature_fields [out] A placeholder for the page signature fields array. \param locations [out] A placeholder for the signature field locations array. \sa . */ void getSignatureFields(OdSignatureFieldPtrArray& signature_fields, OdRectArray& locations) const; /** \details Returns all , which the page contains, and their locations. The method fills two passed arrays with text field objects and their locations, then returns these arrays to a calling subroutine. \param text_fields [out] A placeholder for the page text fields array. \param locations [out] A placeholder for the text field locations array. \sa . */ void getTextFields(OdTextFieldPtrArray& text_fields, OdRectArray& locations) const; /** \details Returns all , which the page contains, and their locations. The method fills two passed arrays with slide table objects and their locations, then returns these arrays to a calling subroutine. \param slide_tables [out] A placeholder for the page slide tables array. \param locations [out] A placeholder for the slide table locations array. \sa . */ void getSlideTables(OdSlideTablePtrArray& slide_tables, OdRectArray& locations) const; /** \details Returns all JavaScript scenarios previously added to the page's field. The method fills passed arrays with scenario source text, action types and source types, then returns these arrays to a calling subroutine. \param field_name [in] A field name. \param sources [out] A placeholder for JavaScript scenario source text. \param action_types [out] An placeholder for action types. \param source_types [out] An placeholder for source types. \sa . */ void getJavaScriptActionsByField(const OdString& field_name, OdStringArray& sources, OdActionTypeArray& action_types, OdSourceTypeArray& source_types) const; /** \details Returns two-dimensional geometry references previously added to the page. The method fills two passed arrays with geometry references and their locations, then returns these arrays to a calling subroutine. \param geoms [out] A placeholder for geometry references array. \param locations [out] A placeholder for geometry locations array. */ void get2dGeoms(Od2dGeometryReferencePtrArray& geoms, OdRectArray& locations) const; /** \details Returns all CAD references previously added to the page. The method fills two passed arrays with CAD references and their locations, then returns these arrays to a calling subroutine. \param CADreferenses [out] A placeholder for CAD references array. \param locations [out] A placeholder for geometry locations array. */ void getCADReferences(OdCADReferencePtrArray& CADreferenses, OdRectArray& locations) const; /** \details Returns an array of which the contains. The method fills two passed arrays with smart pointers to objects and their locations (represented with rectangles), then returns these arrays to a calling subroutine. \param notes [out] A placeholder for the array of smart pointers to . \param locations [out] A placeholder for the array of , which represent geometry locations of . */ void getStickyNotes(OdStickyNotePtrArray& notes, OdRectArray& locations) const; /** \details Returns all that the page contains and their locations. The method fills two passed arrays with and their locations, then returns these arrays to a calling subroutine. \param watermarks [out] A placeholder for the page watermark array. \param locations [out] A placeholder for the watermark locations array. \sa . */ void getWatermarks(OdWatermarkPtrArray& watermarks, OdRectArray& locations) const; /** \details Returns an array of which the contains. The method fills two passed arrays with smart pointers to objects and their locations (represented with rectangles), then returns these arrays to a calling subroutine. \param stamps [out] A placeholder for the array of smart pointers to . \param locations [out] A placeholder for the array of , which represent geometry locations of . */ void getStampAnnotations(OdStampAnnotationPtrArray& stamps, OdRectArray& locations) const; /** \details Returns an array of which the contains. The method fills two passed arrays with smart pointers to objects and their locations (represented with rectangles), then returns these arrays to a calling subroutine. \param inks [out] A placeholder for the array of smart pointers to . \param locations [out] A placeholder for the array of , which represent geometry locations of . */ void getInkAnnotations(OdInkAnnotationPtrArray& inks, OdRectArray& locations) const; /** \details Returns an array of which the contains. The method fills two passed arrays with smart pointers to objects and their locations (represented with rectangles), then returns these arrays to a calling subroutine. \param lines [out] A placeholder for the array of smart pointers to . \param locations [out] A placeholder for the array of , which represent geometry locations of . */ void getLineAnnotations(OdLineAnnotationPtrArray& lines, OdRectArray& locations) const; /** \details Returns an array of which the contains. The method fills two passed arrays with smart pointers to objects and their locations (represented with rectangles), then returns these arrays to a calling subroutine. \param circles [out] A placeholder for the array of smart pointers to . \param locations [out] A placeholder for the array of , which represent geometry locations of . */ void getCircleAnnotations(OdCircleAnnotationPtrArray& circles, OdRectArray& locations) const; /** \details Returns an array of which the contains. The method fills two passed arrays with smart pointers to objects and their locations (represented with rectangles), then returns these arrays to a calling subroutine. \param squares [out] A placeholder for the array of smart pointers to . \param locations [out] A placeholder for the array of , which represent geometry locations of . */ void getSquareAnnotations(OdSquareAnnotationPtrArray& squares, OdRectArray& locations) const; /** \details Returns an array of which the contains. The method fills two passed arrays with smart pointers to objects and their locations (represented with rectangles), then returns these arrays to a calling subroutine. \param polylines [out] A placeholder for the array of smart pointers to . \param locations [out] A placeholder for the array of , which represent geometry locations of . */ void getPolylineAnnotations(OdPolylineAnnotationPtrArray& polylines, OdRectArray& locations) const; /** \details Returns an array of which the contains. The method fills two passed arrays with smart pointers to objects and their locations (represented with rectangles), then returns these arrays to a calling subroutine. \param polygons [out] A placeholder for the array of smart pointers to . \param locations [out] A placeholder for the array of , which represent geometry locations of . */ void getPolygonAnnotations(OdPolygonAnnotationPtrArray& polygons, OdRectArray& locations) const; }; /** \details A data type that represents a smart pointer to an object. */ SMARTPTR(OdPage); } #endif // _PDF_PUBLISH_PAGE_INCLUDED_