|
OpenWord 1.0.0
Modern C++17 library for parsing, manipulating, and saving DOCX files.
|
#include <Document.h>
Public Member Functions | |
| Paragraph (void *node) | |
| Run | addRun (const std::string &text="") |
| void | addRawXml (const std::string &xml) |
| Run | addPageNumber () |
Injects a dynamic PAGE field code to display the current page number. | |
| Run | addTotalPages () |
Injects a dynamic NUMPAGES field code to display the total document page count. | |
| void | addImage (gsl::czstring image_path, double scale=1.0, ImagePosition position=ImagePosition::Inline, long long xOffset=0, long long yOffset=0) |
| Adds an image to the paragraph. | |
| void | addEquation (const std::string &omml) |
| Adds a raw OMML (Office Math Markup Language) equation to the paragraph. | |
| Paragraph & | setStyle (gsl::czstring styleId) |
| Paragraph & | setOutlineLevel (int level) |
| Paragraph & | setAlignment (gsl::czstring align) |
| Paragraph & | setSpacing (int beforeTwips, int afterTwips, int lineSpacing=-1, gsl::czstring lineRule="auto") |
| Paragraph & | setIndentation (int leftTwips, int rightTwips, int firstLineTwips=0, int hangingTwips=0) |
| Paragraph & | setList (int numId, int level=0) |
| Paragraph & | setBorders (const BorderSettings &top, const BorderSettings &bottom, const BorderSettings &left, const BorderSettings &right) |
| Paragraph & | setBorders (const BorderSettings &all) |
| Paragraph & | setShading (const std::string &hexColor) |
| TextBox | addTextBox (long long widthEMU, long long heightEMU, long long xOffsetEMU=0, long long yOffsetEMU=0) |
| Run | addHyperlink (gsl::czstring text, gsl::czstring url) |
| Run | addInternalLink (gsl::czstring text, gsl::czstring bookmarkName) |
| void | insertBookmark (gsl::czstring name) |
| void | addFootnoteReference (int footnoteId) |
| void | addEndnoteReference (int endnoteId) |
| Section | appendSectionBreak () |
| std::string | styleId () const |
| std::string | alignment () const |
| bool | isList () const |
| int | listLevel () const |
| std::vector< Run > | runs () const |
| std::string | text () const |
| int | replaceText (const std::string &search, const std::string &replace) |
| void | remove () |
| Paragraph | cloneAfter () |
| Paragraph | insertParagraphAfter (const std::string &text="") |
| Table | insertTableAfter (int rows, int cols) |
|
explicit |
| void openword::Paragraph::addEndnoteReference | ( | int | endnoteId | ) |
| void openword::Paragraph::addEquation | ( | const std::string & | omml | ) |
Adds a raw OMML (Office Math Markup Language) equation to the paragraph.
| omml | The raw OMML XML string. |
| void openword::Paragraph::addFootnoteReference | ( | int | footnoteId | ) |
| Run openword::Paragraph::addHyperlink | ( | gsl::czstring | text, |
| gsl::czstring | url | ||
| ) |
| void openword::Paragraph::addImage | ( | gsl::czstring | image_path, |
| double | scale = 1.0, |
||
| ImagePosition | position = ImagePosition::Inline, |
||
| long long | xOffset = 0, |
||
| long long | yOffset = 0 |
||
| ) |
Adds an image to the paragraph.
| image_path | Path to the image file (JPEG or PNG). |
| scale | Optional scaling factor (e.g., 0.5 for half size, 2.0 for double size). Default is 1.0. |
| position | Defines how the image is positioned relative to text. |
| xOffset | Optional horizontal offset in EMU (English Metric Units). Only applicable if not Inline. |
| yOffset | Optional vertical offset in EMU (English Metric Units). Only applicable if not Inline. |
| Run openword::Paragraph::addInternalLink | ( | gsl::czstring | text, |
| gsl::czstring | bookmarkName | ||
| ) |
| Run openword::Paragraph::addPageNumber | ( | ) |
Injects a dynamic PAGE field code to display the current page number.
| void openword::Paragraph::addRawXml | ( | const std::string & | xml | ) |
| Run openword::Paragraph::addRun | ( | const std::string & | text = "" | ) |
| TextBox openword::Paragraph::addTextBox | ( | long long | widthEMU, |
| long long | heightEMU, | ||
| long long | xOffsetEMU = 0, |
||
| long long | yOffsetEMU = 0 |
||
| ) |
| Run openword::Paragraph::addTotalPages | ( | ) |
Injects a dynamic NUMPAGES field code to display the total document page count.
| std::string openword::Paragraph::alignment | ( | ) | const |
| Section openword::Paragraph::appendSectionBreak | ( | ) |
| Paragraph openword::Paragraph::cloneAfter | ( | ) |
| void openword::Paragraph::insertBookmark | ( | gsl::czstring | name | ) |
| Paragraph openword::Paragraph::insertParagraphAfter | ( | const std::string & | text = "" | ) |
| Table openword::Paragraph::insertTableAfter | ( | int | rows, |
| int | cols | ||
| ) |
| bool openword::Paragraph::isList | ( | ) | const |
| int openword::Paragraph::listLevel | ( | ) | const |
| void openword::Paragraph::remove | ( | ) |
| int openword::Paragraph::replaceText | ( | const std::string & | search, |
| const std::string & | replace | ||
| ) |
| std::vector< Run > openword::Paragraph::runs | ( | ) | const |
| Paragraph & openword::Paragraph::setAlignment | ( | gsl::czstring | align | ) |
| Paragraph & openword::Paragraph::setBorders | ( | const BorderSettings & | all | ) |
| Paragraph & openword::Paragraph::setBorders | ( | const BorderSettings & | top, |
| const BorderSettings & | bottom, | ||
| const BorderSettings & | left, | ||
| const BorderSettings & | right | ||
| ) |
| Paragraph & openword::Paragraph::setIndentation | ( | int | leftTwips, |
| int | rightTwips, | ||
| int | firstLineTwips = 0, |
||
| int | hangingTwips = 0 |
||
| ) |
| Paragraph & openword::Paragraph::setList | ( | int | numId, |
| int | level = 0 |
||
| ) |
| Paragraph & openword::Paragraph::setOutlineLevel | ( | int | level | ) |
| Paragraph & openword::Paragraph::setShading | ( | const std::string & | hexColor | ) |
| Paragraph & openword::Paragraph::setSpacing | ( | int | beforeTwips, |
| int | afterTwips, | ||
| int | lineSpacing = -1, |
||
| gsl::czstring | lineRule = "auto" |
||
| ) |
| Paragraph & openword::Paragraph::setStyle | ( | gsl::czstring | styleId | ) |
| std::string openword::Paragraph::styleId | ( | ) | const |
| std::string openword::Paragraph::text | ( | ) | const |