[QGIS-Developer] Save Log messages as pdf

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[QGIS-Developer] Save Log messages as pdf

Roberta Fagandini-2
Hi all,
I'm working on a plugin that prints a report at the end of the process in a log text area of the GUI. I'd like to add an option (maybe a checkbox) to save the content of the log and the image of the map area as a single multipage pdf file.

Is it possible with the standard libraries or it requires external dependencies? Do you have any documentation to suggest?

Thanks in advance

Roberta

_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Save Log messages as pdf

Nathan Woodrow
Sure. You would be able to do this with a QPainter. Have a search for print pdf using At and you should get something. We use the built on At libs to render layout prints.

On Fri., 12 Jul. 2019, 10:44 pm Roberta Fagandini, <[hidden email]> wrote:
Hi all,
I'm working on a plugin that prints a report at the end of the process in a log text area of the GUI. I'd like to add an option (maybe a checkbox) to save the content of the log and the image of the map area as a single multipage pdf file.

Is it possible with the standard libraries or it requires external dependencies? Do you have any documentation to suggest?

Thanks in advance

Roberta
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Save Log messages as pdf

Roberta Fagandini-2
Thank you Nathan,
I found some documentation about QPainter but I'm not able to find something interesting about At lib..do you have any specific link?

Using the solution that you suggested, is it possible to set graphic effects? for instance bold or italic characters, font size, text spacing and justification, ecc.

Thank you!

Roberta

Il giorno ven 12 lug 2019 alle ore 14:50 Nathan Woodrow <[hidden email]> ha scritto:
Sure. You would be able to do this with a QPainter. Have a search for print pdf using At and you should get something. We use the built on At libs to render layout prints.

On Fri., 12 Jul. 2019, 10:44 pm Roberta Fagandini, <[hidden email]> wrote:
Hi all,
I'm working on a plugin that prints a report at the end of the process in a log text area of the GUI. I'd like to add an option (maybe a checkbox) to save the content of the log and the image of the map area as a single multipage pdf file.

Is it possible with the standard libraries or it requires external dependencies? Do you have any documentation to suggest?

Thanks in advance

Roberta
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Save Log messages as pdf

Nathan Woodrow
Sorry that should have been Qt libs.  Phone auto correct doesn't understand "Qt".  

Here is a good example for you that should work out of the box.  This is C++ but it's the same logic for PyQt: https://wiki.qt.io/Exporting_a_document_to_PDF

- Nathan

On Fri, Jul 12, 2019 at 11:14 PM Roberta Fagandini <[hidden email]> wrote:
Thank you Nathan,
I found some documentation about QPainter but I'm not able to find something interesting about At lib..do you have any specific link?

Using the solution that you suggested, is it possible to set graphic effects? for instance bold or italic characters, font size, text spacing and justification, ecc.

Thank you!

Roberta

Il giorno ven 12 lug 2019 alle ore 14:50 Nathan Woodrow <[hidden email]> ha scritto:
Sure. You would be able to do this with a QPainter. Have a search for print pdf using At and you should get something. We use the built on At libs to render layout prints.

On Fri., 12 Jul. 2019, 10:44 pm Roberta Fagandini, <[hidden email]> wrote:
Hi all,
I'm working on a plugin that prints a report at the end of the process in a log text area of the GUI. I'd like to add an option (maybe a checkbox) to save the content of the log and the image of the map area as a single multipage pdf file.

Is it possible with the standard libraries or it requires external dependencies? Do you have any documentation to suggest?

Thanks in advance

Roberta
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Save Log messages as pdf

Roberta Fagandini-2
Oh sorry, I should have understood that you meant Qt..

Thank you so much, Nathan!  Your link seems to be exactly what I need.

Thanks again!
Roberta

Il giorno ven 12 lug 2019 alle ore 15:20 Nathan Woodrow <[hidden email]> ha scritto:
Sorry that should have been Qt libs.  Phone auto correct doesn't understand "Qt".  

Here is a good example for you that should work out of the box.  This is C++ but it's the same logic for PyQt: https://wiki.qt.io/Exporting_a_document_to_PDF

- Nathan

On Fri, Jul 12, 2019 at 11:14 PM Roberta Fagandini <[hidden email]> wrote:
Thank you Nathan,
I found some documentation about QPainter but I'm not able to find something interesting about At lib..do you have any specific link?

Using the solution that you suggested, is it possible to set graphic effects? for instance bold or italic characters, font size, text spacing and justification, ecc.

Thank you!

Roberta

Il giorno ven 12 lug 2019 alle ore 14:50 Nathan Woodrow <[hidden email]> ha scritto:
Sure. You would be able to do this with a QPainter. Have a search for print pdf using At and you should get something. We use the built on At libs to render layout prints.

On Fri., 12 Jul. 2019, 10:44 pm Roberta Fagandini, <[hidden email]> wrote:
Hi all,
I'm working on a plugin that prints a report at the end of the process in a log text area of the GUI. I'd like to add an option (maybe a checkbox) to save the content of the log and the image of the map area as a single multipage pdf file.

Is it possible with the standard libraries or it requires external dependencies? Do you have any documentation to suggest?

Thanks in advance

Roberta
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Save Log messages as pdf

Roberta Fagandini-2
Hi all, 
I'm still trying to save a simple text report created by a plugin as a pdf file. I'm using QTextDocument().setHtml() because I want to set some text effects (bold, italic, font size, ecc.) but it seems to support only a subset of HTML. For instance, I tried to add a table border using the attribute style but it doesn't work.
Do you know any alternatives to QTextDocument().setHtml()? Do you have any suggestions?

Thanks in advance,
Roberta

Il giorno ven 12 lug 2019 alle ore 16:01 Roberta Fagandini <[hidden email]> ha scritto:
Oh sorry, I should have understood that you meant Qt..

Thank you so much, Nathan!  Your link seems to be exactly what I need.

Thanks again!
Roberta

Il giorno ven 12 lug 2019 alle ore 15:20 Nathan Woodrow <[hidden email]> ha scritto:
Sorry that should have been Qt libs.  Phone auto correct doesn't understand "Qt".  

Here is a good example for you that should work out of the box.  This is C++ but it's the same logic for PyQt: https://wiki.qt.io/Exporting_a_document_to_PDF

- Nathan

On Fri, Jul 12, 2019 at 11:14 PM Roberta Fagandini <[hidden email]> wrote:
Thank you Nathan,
I found some documentation about QPainter but I'm not able to find something interesting about At lib..do you have any specific link?

Using the solution that you suggested, is it possible to set graphic effects? for instance bold or italic characters, font size, text spacing and justification, ecc.

Thank you!

Roberta

Il giorno ven 12 lug 2019 alle ore 14:50 Nathan Woodrow <[hidden email]> ha scritto:
Sure. You would be able to do this with a QPainter. Have a search for print pdf using At and you should get something. We use the built on At libs to render layout prints.

On Fri., 12 Jul. 2019, 10:44 pm Roberta Fagandini, <[hidden email]> wrote:
Hi all,
I'm working on a plugin that prints a report at the end of the process in a log text area of the GUI. I'd like to add an option (maybe a checkbox) to save the content of the log and the image of the map area as a single multipage pdf file.

Is it possible with the standard libraries or it requires external dependencies? Do you have any documentation to suggest?

Thanks in advance

Roberta
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Save Log messages as pdf

Raymond Nijssen
Hi Roberta,

I don't know how to do this in Qt, but could you use a QgsPrintLayout
with an html frame and then export that to pdf?

Kind regards,
Raymond




On 20-08-19 13:55, Roberta Fagandini wrote:

> Hi all,
> I'm still trying to save a simple text report created by a plugin as a
> pdf file. I'm using QTextDocument().setHtml() because I want to set some
> text effects (bold, italic, font size, ecc.) but it seems to support
> only a subset of HTML. For instance, I tried to add a table border using
> the attribute style but it doesn't work.
> Do you know any alternatives to QTextDocument().setHtml()? Do you have
> any suggestions?
>
> Thanks in advance,
> Roberta
>
> Il giorno ven 12 lug 2019 alle ore 16:01 Roberta Fagandini
> <[hidden email] <mailto:[hidden email]>> ha scritto:
>
>     Oh sorry, I should have understood that you meant Qt..
>
>     Thank you so much, Nathan!  Your link seems to be exactly what I need.
>
>     Thanks again!
>     Roberta
>
>     Il giorno ven 12 lug 2019 alle ore 15:20 Nathan Woodrow
>     <[hidden email] <mailto:[hidden email]>> ha scritto:
>
>         Sorry that should have been Qt libs.  Phone auto correct doesn't
>         understand "Qt".
>
>         Here is a good example for you that should work out of the box.
>         This is C++ but it's the same logic for PyQt:
>         https://wiki.qt.io/Exporting_a_document_to_PDF
>
>         - Nathan
>
>         On Fri, Jul 12, 2019 at 11:14 PM Roberta Fagandini
>         <[hidden email] <mailto:[hidden email]>> wrote:
>
>             Thank you Nathan,
>             I found some documentation about QPainter but I'm not able
>             to find something interesting about At lib..do you have any
>             specific link?
>
>             Using the solution that you suggested, is it possible to set
>             graphic effects? for instance bold or italic characters,
>             font size, text spacing and justification, ecc.
>
>             Thank you!
>
>             Roberta
>
>             Il giorno ven 12 lug 2019 alle ore 14:50 Nathan Woodrow
>             <[hidden email] <mailto:[hidden email]>> ha scritto:
>
>                 Sure. You would be able to do this with a QPainter. Have
>                 a search for print pdf using At and you should get
>                 something. We use the built on At libs to render layout
>                 prints.
>
>                 On Fri., 12 Jul. 2019, 10:44 pm Roberta Fagandini,
>                 <[hidden email]
>                 <mailto:[hidden email]>> wrote:
>
>                     Hi all,
>                     I'm working on a plugin that prints a report at the
>                     end of the process in a log text area of the GUI.
>                     I'd like to add an option (maybe a checkbox) to save
>                     the content of the log and the image of the map area
>                     as a single multipage pdf file.
>
>                     Is it possible with the standard libraries or it
>                     requires external dependencies? Do you have any
>                     documentation to suggest?
>
>                     Thanks in advance
>
>                     Roberta
>                     _______________________________________________
>                     QGIS-Developer mailing list
>                     [hidden email]
>                     <mailto:[hidden email]>
>                     List info:
>                     https://lists.osgeo.org/mailman/listinfo/qgis-developer
>                     Unsubscribe:
>                     https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
> _______________________________________________
> QGIS-Developer mailing list
> [hidden email]
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer