![]() ![]() Now that Aspose.PDF for C++ has been integrated with Qt, we are ready to create a PDF document with some text and save it to disc. Build the application and you are done with the integration.pro project file will contain the following entries: Select the External Library option and browse paths to include and lib folders one by one. ![]() In order to add paths to lib and include folders, right-click on the project in LHS panel and select Add Library.Your project should like as shown in the following image. Copy and 2Cpp_vc14_20.4 folders from the extracted package of Aspose.PDF for C++ into the root of the project.Extract the Aspose.PDF for C++ archive that you have downloaded earlier.Select the appropriate kit and finish the wizard.Īt this point, you should have a workable executing Qt Console Application that should compile without issues.Select the QMake option from the Build System dropdown.Open Qt Creator and create a new Qt Console Application.See also title().This article assumes that you have properly installed Qt development environment and Qt Creator. Sets the title of the document being created to title. void QPdfWriter:: setTitle(const QString & title) This setting affects the coordinate system as returned by, for example QPainter::viewport(). void QPdfWriter:: setResolution( int resolution) Returns true if the page size was successfully set to pageSize. You should not call any painting methods between a call to setPageSize() and newPage() as the wrong paint metrics may be used. You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new page size to a new page. To get the current QPageSize use pageLayout(). bool QPdfWriter:: setPageSize(const QPageSize & pageSize) ![]() Returns true if the page orientation was successfully set to orientation. To get the current QPageLayout::Orientation use pageLayout().pageOrientation(). You should not call any painting methods between a call to setPageOrientation() and newPage() as the wrong paint metrics may be used. You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new orientation to a new page. The page orientation is used to define the orientation of the page size when obtaining the page rect. bool QPdfWriter:: setPageOrientation( QPageLayout::Orientation orientation) Set the PDF page margins defined in the given units. bool QPdfWriter:: setPageMargins(const QMarginsF & margins, QPageLayout::Unit units) Returns true if the page margins were successfully set to margins. To get the current page margins use pageLayout().pageMargins(). You should not call any painting methods between a call to setPageMargins() and newPage() as the wrong paint metrics may be used. You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new margins to a new page. Set the PDF page margins in the current page layout units. bool QPdfWriter:: setPageMargins(const QMarginsF & margins) Returns true if the page layout was successfully set to newPageLayout. You should not call any painting methods between a call to setPageLayout() and newPage() as the wrong paint metrics may be used. You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new page layout to a new page. Sets the PDF page layout to newPageLayout. ![]() bool QPdfWriter:: setPageLayout(const QPageLayout & newPageLayout) Sets the creator of the document to creator. void QPdfWriter:: setCreator(const QString & creator) Returns the resolution of the PDF in DPI. Reimplemented from QPaintDevice::paintEngine(). QPaintEngine *QPdfWriter:: paintEngine() const See also setPageLayout(), setPageSize(), setPageOrientation(), and setPageMargins(). Note that you cannot use the setters on the returned object, you must either call the individual QPdfWriter methods or use setPageLayout(). Use this method to access the current QPageSize, QPageLayout::Orientation, QMarginsF, fullRect() and paintRect(). QPageLayout QPdfWriter:: pageLayout() const Reimplemented from QPagedPaintDevice::newPage(). QPdfWriter:: ~QPdfWriter()ĭestroys the pdf writer. QPdfWriter:: QPdfWriter( QIODevice * device)Ĭonstructs a PDF writer that will write the pdf to device. Member Function Documentation QPdfWriter:: QPdfWriter(const QString & filename)Ĭonstructs a PDF writer that will write the pdf to filename. ![]()
0 Comments
Leave a Reply. |