Hello,
I’m trying to insert an image into a Print Template based on a field in a CSV data file that contains a URL. If I insert an image, I can copy and paste the URL into the select image popup window and save it with the template. However, I can’t figure out how to do this as a variable. As an example, I would have a file below:
They are all different images and I need to pull the URL image on a record to record basis.
I can find similar topics but none that specifically relate to this one.
2.) And use a Standard Script like the following to change the value of the attribute “src”:
Name: Example
Selector: #example
var result = "";
var field = record.fields["filename"];
if (field != "") {
result = ("file:///C:/images/" + field);
if (resource(result)) {
results.attr("src", result);
}
}
I can get a static image to display if I save the image with the template. Otherwise I can’t get anything to display other than that X. I am using a URL not a stored image on disk.
Incognito still works for me. It also works for a few of my colleagues. Still not sure why Pres Connect won’t pick up the Image dynamically from the URL, only when it’s saved with the template, which is a manual process.
I’m working on a work around to download the images from the Web into a local folder, then pick these images up based on a filename…somehow. Just thought this would work inside the designer directly from the URL.
Can you let us know please when the issue with the image with the red cross does occur? Is that for example when you view your Print Context Section in Design mode or Preview mode?
In case it does occur only in Design mode then I would like to ask you kindly to change the value of the attribute “src” (of the image element) so that it points to a image which you would like to add to the Print Context Section when viewing it in Design mode, this can be for example:
src="images/default.png" - When the image has been added to the Images folder of the Template
src="file:///C:/images/default.png" - When the image is stored in a directory on your disk
We are not trying it from home over VPN, the connection fails when directly connected or remotely connected.
The Red Cross occurs in preview mode.
I have created a work around which now pulls the variable images. I download the images from the URL to a somewhat local folder using a batch cmd. I pull the name of the image from the URL in the data file with a simple script, add the local directory to the script and append the filename to pick up in the attribute “src”.
I can share code if you’d like, just let me know.
I am also using Pres Connect 1.7 still so this may an old bug that’s been since fixed in later releases.