Home Forums General XMetaL Discussion Display Default Image Reply To: Display Default Image

Derek Read

Reply to: Display Default Image

The SetRenderedContent API does not modify the XML source so something else must be going on with your code.

Our CSS selector support doesn't support that CSS3 selector $=, so you can't use that. Selector support is CSS2 only.

You can probably use CSS if you don't mind creating the CSS dynamically. There are APIs that will allow you to do that. (I'd really stick with SetRenderedContent though if you have it working already.) Please see the following in the Programmers Guide:

RefreshCssStyleToAppend()
RefreshCssStyle()

Off the top of my head I think the logic would need to be something like this:
1) Walk the document to find out all the references you have with *.pdf files. This can be done various ways. The fastest is probably to visit every element using a Range object. If you have SetRenderedContent working then you are already familiar with working with the DOM or nodes in general so I won't try to describe here.
2) Generate a string containing all the various graphic[fileref$=”mydoc.pdf”] based on step 1, so you end up with:
 graphic[fileref$="mydoc1.pdf"] {}
 graphic[fileref$="mydoc2.pdf"] {}
 etc...

3) Add that string on to the end of your CSS (in memory) using the APIs I've listed above.

Reply

Products
Downloads
Support