Unsolved How to use both the properties of Qtextdocument
-
@JonB Its just a title where i want to place my company logo on the left and right top corner and the titke as my project .
-
@ManiRon
Not viaQTextDocument
. You'd have to look at manipulating the PDF output, which is a different matter.Something like https://forum.qt.io/topic/74643/qtextdocument-to-pdf-with-watermarks-and-header-footer-filesize-too-large might give you some ideas. I do not guarantee whether that is good/the right approach, but it might be.
-
-
@ManiRon This is my report with an example image inserted. the two images with the Name REPORT are the title of the document and that "sdvzfdvzsfdv" is the text that i wanted to insert.
-
@ManiRon
If you don't want to do this via thepaint()
suggested in the link I posted above, you could try with eitherQTextCursor::insertImage()
or you could try writing the whole thing in HTML and seeing ifQTextCursor::insertHtml()
accepts it or not, I don't know. -
@JonB Ok Sir . i will read about it and check with an example code.
-
@JonB but with this QTextCursor::insertImage() property whether i can place the image anywhere ?
-
@ManiRon
You can insert it wherever you can navigate aQTextCursor
to. Frankly I don't understand from what you have written where exactly it is you want it, so I don't know whether you can navigate there. -
@JonB I want it to be in the header section of a PDF file.
example: <Image> TITLE <Image> -
@ManiRon
Then like I said you can't, unless you want to work on getting at the PDF from theQTextDocument
before it gets sent to the printer and manipulate it from there. -
@JonB will there be any possibility or any idea because i am out of idea
-
@ManiRon
As I said, you will have to look, I think, at: instead of making theQTextDocument
send the PDF it can produce straight to the printer without change, rather you must "intercept" it and do whatever you need to the PDF header first.