Announcement

Collapse
No announcement yet.

Workaround to TCPDF css limitations

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • telecastg
    replied
    Hi MATO

    Thanks for your kind words.

    Unfortunately there doesn't seem to be a better alternative than TCPDF which meets Espo criteria at present.

    In the meantime, this capability (render to window and use the browser's PDF engine instead of TCPDF) is now included in the eSignature extension which is compatible with Espo 7.x https://payhip.com/b/DgICV
    Last edited by telecastg; 01-27-2022, 03:54 PM.

    Leave a comment:


  • MATO
    replied
    Hi Telecastg

    I use your extension and will not be upgrading to 7.x unless they improve/add a print to pdf function.

    Thank you for your efforts so far.

    MATO

    Leave a comment:


  • espcrm
    commented on 's reply
    Now I'm even more bit hesitant to upgrade.

  • telecastg
    replied
    Update: Unfortunately Espo 7.x has made many custom implementations incompatible thus this extension is no longer available.

    If time permits, I might release a new commercial version that works with Espo 7.x in the future.

    Leave a comment:


  • item
    replied
    Hello espcrm,
    Any log files ?


    Leave a comment:


  • espcrm
    replied
    It might just be me, but this is a warning for those who using this services.

    I'm getting an error 500 and blank page with this service after updating to v6.0.0.

    Don't have time to investigate further at the moment as I just want to fix my Installation; it got to do with the Real Estate extension which I use this Service (code) with.
    Last edited by espcrm; 10-23-2020, 03:54 AM.

    Leave a comment:


  • telecastg
    replied

    custom/Espo/Custom/Services/PrintToWindow/Service.php is a typo, I apologize.

    The file name is PrintToWindowService.php the folder path is custom/Espo/Custom/Services/

    I corrected the post.

    I suggest that you look at the error log to see what might be the problem. These logs are located at the data/logs folder. If there is a 404 error the log will tell you at which script and even the line number in the script where the error is being thrown.

    I also suggest, if you are not familiar with the concept of Single Page Application (which Espo is one), that you check this article https://dzone.com/articles/how-singl...-actually-work to better understand the interactions between front end scripts and back end scripts.

    For further understanding of front end scripts, if you are not familiar with the concept of views, models and collections, you can read this article about Backbone.js https://adrianmejia.com/backbone-dot...tting-started/ which is the base library upon which Espo's front end is built, although bear in mind that Espo is NOT "just Backbone" Espo is a highly developed platform with its front end derived from Backbone.js.

    An analogy of comparing Espo to Backbone could be to compare jquery to javascript, jquery is written in Javascript but it is far more than plain javascript.

    Last edited by telecastg; 07-02-2020, 07:28 PM.

    Leave a comment:


  • espcrm
    replied
    Hi telecastg
    Sorry if I didn't make it clear. The .zip file I upload only contain 4 files, in particular these 4 files:

    custom/Espo/Custom/Resources/metadata/clientDefs/Contact.json
    client/custom/src/views/contact/record/detail.js
    custom/Espo/Custom/EntryPoints/PrintToWindow.php
    custom/Espo/Custom/Services/PrintToWindow/Service.php

    It does not contain any other file except for these 4 files in those 4 folders. All file is a copy/paste except for "/Contact.json' which have my icon/colors (looking at my code, I don't think this file affect the error)

    I just notice one thing that may explain why it not working: your previous post the filename is like this:

    Code:
    [B]custom\Espo\Custom\Services\PrintToWindowService.php[/B]
    But your new post it is this:

    Code:
    custom/Espo/Custom/Services/PrintToWindow/Service.php
    This could explain why? The PrintToWindow is the folder, the Service.php is the file

    ---

    Noted, I will give a local server a try in the future but your step:
    "7) Upload each script individually using FTP to the correct folder in your online Espo installation."

    This step should not matter in relation to these 4 files I believe, as long as I can extract 4 files to those 4 folders location everything should work as intended?

    For my first trial, All file was manually created in those folder. I only made the ZIP with the file because may help, maybe somewhere in those file or folder I create was wrong and can't see it. It looked at the filepath and filename and everything seem to be right. My copy/paste not missing starting and ending line either.
    ---

    Anyway I go see if my hunches is correct.

    Update. My hunches is incorrect. Adding the PrintToWindow folder and creating a Service.php file does not change anything. Still getting Error 404.

    I attached my screenshot, hopefully anyone with eagle eyes might be able to spot the issue. If my ZIP file work for anyone then it mean this is an isolated problem with my system.

    Click image for larger version  Name:	PrintToWindow error.png Views:	0 Size:	1.32 MB ID:	60098
    Last edited by espcrm; 07-02-2020, 09:08 AM.

    Leave a comment:


  • telecastg
    replied
    Hi espcrm

    Originally posted by espcrm View Post
    I decided to upload the whole customized file if you have the chance to look at it.
    Sorry but I can't help with code debugging.

    This is NOT an extension or package that will self install so you should not compress and upload anything. What you need to do is to write 4 different scripts and save them to the correct file path.

    The correct procedure is:

    1) If you haven't done it yet, set up a local server (xampp for example) and install Espo in a local website

    2) Use your code editor or IDE to create each script exactly as written and save it in the exact specified folder (path) within the Espo installation.

    The correct names and paths for each script are: (I use forward slashes because otherwise the forum's markdown inserts unwanted spaces)

    custom/Espo/Custom/Resources/metadata/clientDefs/Contact.json

    client/custom/src/views/contact/record/detail.js

    custom/Espo/Custom/EntryPoints/PrintToWindow.php

    custom/Espo/Custom/Services/PrintToWindowService.php

    If you are not familiar with Espo's file structure you can open the installation in your IDE or use windows explorer to get a better idea of where everything goes.

    3) Clear cache and rebuild the local installation

    4) Test

    5) Make any modifications that you want

    6) Test again

    7) Upload each script individually using FTP to the correct folder in your online Espo installation.

    8) Clear cache and rebuild the online installation

    9) Test again.
    Last edited by telecastg; 07-02-2020, 02:34 PM. Reason: Corrected typo in file name PrintToWindowService.php

    Leave a comment:


  • espcrm
    replied
    Hi telecastg,

    Thank you. I decided to upload the whole customized file if you have the chance to look at it. It pretty much a copy/paste job, only change I made was to the: custom\Espo\Custom\Resources\metadata\clientDefs\C ontact.json
    File, I also update my previous post so I think you post your message before you read my update.

    Please check: https://www93.zippyshare.com/v/GgHXaVLr/file.html OR https://github.com/espcrm/EspoCRM-Customize/tree/master
    I also made the folder tree/location as per guide, and also upload the file and extract it to my CRM incase I made a type with file or folder name.

    But still no luck, not why where I went wrong at the moment.
    Last edited by espcrm; 07-02-2020, 03:34 AM.

    Leave a comment:


  • telecastg
    replied
    Please post the whole code and the name with full path of the script that you are editing.

    The first step is to create a custom Contact,json clientDefs metadata file in the "Custom" namespace so it will not interfere with the core Contact.json clientDef metadata file.

    Leave a comment:


  • espcrm
    replied
    telecastg


    I'm getting a 404 Page Not Found after click "Print to Window", digging around a little and I notice that the URL is ?entryPoint but in some of the code is ?entryPoints (with a "s"), so I tried create a folder call entryPoint but that doesn't work either.

    From the look of it, it can't find this file?: custom\Espo\Custom\Services\PrintToWindowService.p hp
    But I'm sure the file exist and it in the right location with the correct filename. Also changed a couple of File Permission see if that help.
    Also change filename to see if it case sensitive (e.g. printToWindow.php)

    Not sure what the issue at this point.


    My Old Post:
    Never gotten around to this but seeing as I'm learning how to create button I decide to give it a try.

    Unfortunately I'm stuck in the first step and need help on what to do.

    For my Contact.json file there is already code in there so I'm getting a Syntax error, not sure how do I paste it so it will work and don't receive syntax error

    I probably need to add a comma or semi-colon somewhere don't I?

    Here is what I have at the moment:

    edit: I think I figure it out. I added the code after the icon class and add a ", comma" at the end"
    Code:
    "iconClass": "fas fa-id-badge",
    "recordViews": {
    "detail": "custom:views/contact/record/detail"
    },
    Last edited by espcrm; 07-02-2020, 12:49 AM.

    Leave a comment:


  • emillod
    replied
    We've created small workaround for that. We create PDF template in EspoCRM entity and after that we can create PDF as html template in FTP. Of course this html template can be connected with header and footer from templates entity. Also you can put all fields in this html template like in template entity, so for example {{name}}

    Leave a comment:


  • telecastg
    commented on 's reply
    You're very welcome :-)

    As you do different things with Espo please share your findings and solutions in the forum so everybody benefits.

    Cheers !

  • jc63
    replied
    Hi telecastg,

    I just wanted to say thank you very much for this! I'm new to EspoCRM and your post has helped me a great deal in customizing the app for our use case.

    Cheers!

    Leave a comment:

Working...
X