I have an image that I want to use. I want to upload the image to Sugar instead of hosting it somewhere else. How can I upload it to Sugar so it is available to the PDF manager?
I have an image that I want to use. I want to upload the image to Sugar instead of hosting it somewhere else. How can I upload it to Sugar so it is available to the PDF manager?
Hi John,
I think this documentation will help you out.
Thanks, Haiyin. My description wasn't very clear.
I want to replace the embedded Sugar image at the top of the PDF template. If you add an image to the header file, the image is distorted. I just want to replace the image that is already there.
{SugarClub Administrator Edit: We're sorry, but this image is no longer available}
While editing the template, if you click on the Sugar image the Insert/Edit Image option will highlight itself on the editing toolbar. Click that button and it will open up the image options where you can replace the Image URL with whatever you like.
It should work the same if you also delete the default Sugar image and insert your own in its place.
Similar steps are shown on the guide here, but instead of changing the size you can change the URL:
While editing the template, if you click on the Sugar image the Insert/Edit Image option will highlight itself on the editing toolbar. Click that button and it will open up the image options where you can replace the Image URL with whatever you like.
It should work the same if you also delete the default Sugar image and insert your own in its place.
Similar steps are shown on the guide here, but instead of changing the size you can change the URL:
The problem I'm having is that I want the image to be uploaded to the Sugar file structure. The image needs to be stored in Sugar. You can't just copy and paste an image into the PDF layout.
The default image is stored in ./themes/default/images/pdf_logo.jpg. I want to know how/if I can upload an image to that folder in Sugar.
{SugarClub Administrator Edit: We're sorry, but this image is no longer available}
Ah, are you on one of the commercial On-Demand versions? Seems like you could package up a Manifest with your logo file and upload it that way. Take a look here for copying files to Sugar using the Module Loader and creating manifest files:
Hi John,
One method to upload a new logo file is by going to Admin > PDF Manager. Once that page is loaded, click the 'PDF Manager' option in the top navigation bar and select 'Edit Report PDF Template'.
{SugarClub Administrator Edit: We're sorry, but this image is no longer available}
From that page, you can choose your desired image file and click 'Save' to upload it. Once the file is uploaded, it is renamed as pdf_logo_<original filename>.
In my example, the file I chose was named 'sugarcrm_support.png', so when it was uploaded, it was renamed as 'pdf_logo_sugarcrm_support.png'.
Now, with that file uploaded, you can edit your PDF template and change the image URL to:
./custom/themes/default/images/pdf_logo_<original filename>
So again, for my example, the path I entered was './custom/themes/default/images/pdf_logo_sugarcrm_support.png' and the image was immediately reflected in the template.
You can upload as many image files as you desire through this method as long as the image files have unique filenames. If an image file is uploaded with a previously used filename, it will just overwrite the previous image on the file system. Please remember that your last uploaded image will serve as the logo for any generated PDFs for the Reports module.
This isn't a clear solution for users coming across this hurdle, so I created the following idea: Provide a Utility for Managing Images for PDF Templates . I encourage you to vote on the idea and add any additional feedback you have on how we can make this a more useful utility for you in a future release of Sugar.
Kind regards,
Chris
Chris Raffle Thank you! This is exactly what I was looking for. My next step was to build and upload a Sugar package, which seems to be overkill to change an image.
I think the documentation should also be updated to include these instructions.
Hi Chris,
Following your instruction and inserting the path as the image source witing PDF manager I get the following error when tring to preview the PDF
TCPDF ERROR: [Image] No such file or directory in ./custom/themes/default/images/pdf_logo_pvalve1.png
any ideas why would be appreciated.
thank you
.
CRM Business Consultant