Link in Zwischenablage kopieren
Kopiert
Hi,
I'm really new to the xml import part for indesign, but i'm going to need it extensively.
How do I format the xml to be able to import images from a local path or a url path from my server?
I can do everything with text but it doesn't work for image files.
I tried the <image href="localimagepath"></image> but this doesn't work, it says there is an error in my code when importing.
This is on osx and the path is from my terminal.
Hi,
The correct syntax for file path is <image href="File:///Path/to/file"></image>
A pretty complete reference can be found here.
Hope it helped.
Link in Zwischenablage kopieren
Kopiert
Hi,
The correct syntax for file path is <image href="File:///Path/to/file"></image>
A pretty complete reference can be found here.
Hope it helped.
Link in Zwischenablage kopieren
Kopiert
Hello i'm having the same problem.
I've tried your syntax but it doesn't work, sayng there is an error.
With this sintax there is no error, but also no image: <image>href=“file:///img/123456.png”</image>
The image folder is in the same xml folder.
Thanks in advance.
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
You have unnecessary ">" after the image - which makes text after that - as text - not an argument for "image".
Link in Zwischenablage kopieren
Kopiert
I have tried with this, <image href=“File:///img/123456.png”></image>
but indesign reports a sintax error.
Link in Zwischenablage kopieren
Kopiert
Probably because you've different double quotes.
Link in Zwischenablage kopieren
Kopiert
You need to prepare your mockup / test file in the plain-text ASCII editor - Notepad on Windows - not RTF editor.
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
You need to replace RED ones with the GREEN ones:
Link in Zwischenablage kopieren
Kopiert
Finally, it works!
Thank you a lot Robert.
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
I'm sorry Robert, i'm here again with another issue:
I've edited another xml file, the image are imported, but indesign opens the window to select the image for every image istance. So, i have to select the image every time for every instance.
The file seems good to me, i don't know why. The file is attached, can you please check it?
Another question: what is the right sintax in the xml reference file to get a string like this,
<image href="File:///img/DSC_0005.JPG"></image>?
Now i'm using <image>DATA</image, but i have to modify the results manually to get the string above.
What is the right sintax to recall an image?
Thank you a lot!
Link in Zwischenablage kopieren
Kopiert
I'm sorry Robert, i'm here again with another issue:
I've edited another xml file, the image are imported, but indesign opens the window to select the image for every image istance. So, i have to select the image every time for every instance.
The file seems good to me, i don't know why. The file is attached, can you please check it?
By @LMR78
No idea why? You've had PNGs before? Now JPGs? Are you sure you've those JPGs there?
Another question: what is the right sintax in the xml reference file to get a string like this,
<image href="File:///img/DSC_0005.JPG"></image>?
Now i'm using <image>DATA</image, but i have to modify the results manually to get the string above.
What is the right sintax to recall an image?
By @LMR78
Not sure what do you mean?
href="..." is an argument / parameter for InDesign's XML to place image.
<image>DATA</image> will be treated as a "text" with "DATA" as contents - as you've experienced before.
Link in Zwischenablage kopieren
Kopiert
Yes i'm sure about the jpg.
The image import works, the strange thing is that indesign opens the window to select the image to import for every image. (attached a little video to show what happens)
About the second issue, i try to explain: the colums "Image" in the excel file contains all the paths like: href="File:///img/DSC_0005.JPG". This rapresent my data.
What is the right syntax to recall this data in the xml file using image tags??
Thank you Robert.
Link in Zwischenablage kopieren
Kopiert
Was it working with PNG files?
[...]
About the second issue, i try to explain: the colums "Image" in the excel file contains all the paths like: href="File:///img/DSC_0005.JPG". This rapresent my data.
What is the right syntax to recall this data in the xml file using image tags??
By @LMR78
I still don't understand what do you mean? "href" represents file path and InDesign should use it to import image - what do you mean by "right syntax to recall this data"?
How exactly are you preparing your XML files?
(most often I respond from my phone, so would be great if you could post screenshots instead of XML files - sometimes my phone do not open them so I can't see their contents)
Link in Zwischenablage kopieren
Kopiert
Yes, with png files no troubles. It happens only with jpg, really strange.
The situation is: i have to do a catalogue. I have an xcel with all the data, also images name.
About the image issue: i would like to know what i have to write in my xml, and what i have to write in the colum image of my xcel file to directly import the image in my indesign.
i use this xml to pilot the extraction from the xcel file.
Then, this is the result with the data merged, as you can see the syntax of the image tag is not correct:
Maybe i'm not running the right way to do this. Is the first time for me, i dont know.
Thank you.
Link in Zwischenablage kopieren
Kopiert
Sorry, i have to say that the image import window appear also with the png format.
In the previous file this issue wasn't present. I don't know why.
Link in Zwischenablage kopieren
Kopiert
Sorry, i have to say that the image import window appear also with the png format.
In the previous file this issue wasn't present. I don't know why.
By @LMR78
Are your files located on the server or locally?
Can you prepare a sample package - short XML file + PNGs and JPEGs?
Link in Zwischenablage kopieren
Kopiert
Can you try with JPEG instead of JPG extension? Or stick with PNG?
Looks like you've a template that you fill with data from Excel, right?
But here is the problem:
Your "Image" field from Excel - is placed in the wrong place - it should be directly after "<image" and before ">":
<image Image></image>
Otherwise, is treated as a text contents of the XML tag - not an Attribute of this XML tag.
Link in Zwischenablage kopieren
Kopiert
Hello Robert,
sorry for the late reply.
Can you try with JPEG instead of JPG extension? Or stick with PNG?
Looks like you've a template that you fill with data from Excel, right?
But here is the problem:
Your "Image" field from Excel - is placed in the wrong place - it should be directly after "<image" and before ">":
<image Image></image>
Otherwise, is treated as a text contents of the XML tag - not an Attribute of this XML tag.
By @Robert at ID-Tasker
No, my image files are located in a local folder.
"Can you try with JPEG instead of JPG extension? Or stick with PNG?"
I've tried, same problem. The issue happens also with png.
Looks like you've a template that you fill with data from Excel, right?
That's right.
Your "Image" field from Excel - is placed in the wrong place - it should be directly after "<image" and before ">"...
This is what i was tring to ask to you, thanks! I will try following your precoius hints, i will come back soon.
Thanks a lot Robert!
Link in Zwischenablage kopieren
Kopiert
You're welcome and good luck.
Weitere Inspirationen, Events und Ressourcen finden Sie in der neuen Adobe Community
Jetzt ansehen