Better PDFs than PdfManager?

I have a custom module and need to create PDF documents from that module and data from related modules.

Much to my dismay Sugar's PdfManager is not even close to WYSIWYG and I have no way to use css to clean up the output.

in PdfManager Detail view, Edit view and Preview are all different!

Furthermore I have the need to have merge fields from modules which are related to related modules. E.g. I relate a quote to the custom module, I need to include information from the quote line items (it's not a Quote, it's a custom document that will go with the quote).

Any thoughts on how best to tackle this?

thanks,

Francesca

Parents
  • I solved this by creating a custom sugarpdf for my custom module which outputs the html with the added link to the specific css I wish to use.

    The html is fed to wkhtmltopdf to produce a beautiful output.

     

    The downside of this approach is that the document template has to be edited in HTML if any modifications are needed.

    I also added  the css to the tinymce window in custom/include/tinyMCEDefaultConfig.php

    so the content would be viewed as much as possible with the correct formatting in editor.

    The downside is this applies to all tinymce windows including email compose windows and may not be ideal depending on the css.

    For the detail view, I added the css to detailviewdefs.php in the customCode for the body_html field in the PdfManager module conditional to my module:

                'customCode' => '{if $fields.base_module.value == "wcont_WContracts"}<link rel="stylesheet" type="text/css" href="custom/contract_resources/css/contract.css" />{/if}{$fields.body_html.value|from_html}',

    This is far from ideal but works for current scenarios.

    I'm open to better ideas.

    thanks,
    FrancescaS

Reply
  • I solved this by creating a custom sugarpdf for my custom module which outputs the html with the added link to the specific css I wish to use.

    The html is fed to wkhtmltopdf to produce a beautiful output.

     

    The downside of this approach is that the document template has to be edited in HTML if any modifications are needed.

    I also added  the css to the tinymce window in custom/include/tinyMCEDefaultConfig.php

    so the content would be viewed as much as possible with the correct formatting in editor.

    The downside is this applies to all tinymce windows including email compose windows and may not be ideal depending on the css.

    For the detail view, I added the css to detailviewdefs.php in the customCode for the body_html field in the PdfManager module conditional to my module:

                'customCode' => '{if $fields.base_module.value == "wcont_WContracts"}<link rel="stylesheet" type="text/css" href="custom/contract_resources/css/contract.css" />{/if}{$fields.body_html.value|from_html}',

    This is far from ideal but works for current scenarios.

    I'm open to better ideas.

    thanks,
    FrancescaS

Children
No Data