function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
textualtextual 

deploying a package the allows customer customization

I want to build in two flexible pieces to a document renderer

 - allow for custom logos

 - allow for customizng a css file

 

currently the logo is storde as a document and displayed as an apex image:

 

<apex:image value="/servlet/servlet.ImageServer?id={!imageSrc}&oid={!$Organization.Id}"/>

 And the css file is a static resource

<apex:stylesheet value="{!URLFOR($Resource.PDFStyles, 'default.css')}"/>

 I'm hoping that customres will be able to upload to their own documents repository their logo for the pdf, and they can overwrite the static resource if they want to change pdf style.

 

A) are both of those editable from a managed package?

B) can the CSS file be a document as well, or is this a best practice?

 

It feels kinda odd have one resource in one place and another somewhere else

izayizay

Hi,

 

I would do this by creating a style object with the styles and image url. Then, allow the user to make chages to this values through a vf page. Use the values in this object to set the style on your page renderer. Simply have a field per style attribute or a longtextarea with the entire css for the user to edit.

 

Hope this helps!

textualtextual
I tried using a field for css and it didnt affect the layout so I quickly
dropped it (deadlines...) and stuck with the static resource. If you have
some code that shows losing a text area into the head / style / css portion
of a pdf (that works) I'd be interested to see if theres any difference
between what you and I did