问题
We are currently working on an pdf version of a newspaper at work, we have a .net website which captures the articles to publish, storing the content entered as html, so we can maintain styles like bold, underline, strike out.
Once this is stored in the database we are planning to use Indesign to create the pdf. We currently we have a template built, but when we generate an xml document and import into Indesign the html tags are just written out. Is there a way around this, to get Indesign to maintain the tags as they would be in html? We just need some simple ones, like bold, strikeout, underling, center align.
Thanks.
回答1:
You'll need to translate the HTML tags into CharacterStyles, and apply those to the XML on import.
The tricky thing is that CharacterStyles can't be applied nested like HTML can, so you need to make a CharacterStyle for each combination that might be present. Or you can apply styles to the specific run of text, with a script.
回答2:
Pandoc now support export to ICML (Adobe InCopy's XML format that can be "placed" in InDesign documents). To convert HTML to ICML:
pandoc --standalone -o output.icml input.html
See Importing Markdown in InDesign in the pandoc wiki for details around the workflow.
回答3:
We have had some bad experiences importing xml into InDesign directly.
If you are still having trouble with this issue, check out the open source Ickmull code library. It converts an xhtml file to an idml file, that can then be opened in InDesign. This might be a better web to print workflow for you.
http://code.google.com/p/ickmull/
回答4:
Maybe you can use a Markdown to InDesign translater as a starting point: http://www.jongware.com/markdownid.html
回答5:
Adobe products are "closed" for universal standards (!) importation, like to import XHTML.
How to PROTEST against Adobe?!
The biggest problem arises when we have many files...
A solution by batch processing (a lot of articles)
... The only way that I can use today (2013) is this (semi-automatic) procedure:
- [manual, prepare] Check my InDesign "template" file, that will be used as "importer": styles with legible names must by defined. PS: they are all visible (listed) in a HTML+CSS exporting.
- [manual, prepare] Adapt my (X)HTML files to express all relevant styles with CSS class names (not by style attribute neither by strange class names);
- [automatic, batch processing] Convert all my (X)HTML files to DOC, automatically using Python OpenDocument Converter.
- [InDesign assisted, final processing] Import each DOC from a "template" (item 1) file clone at InDesign. The classes (item 2) will be automatically transformed by InDesign styles.
This procedure is better than IDML because use directaly the XHTML as content source for InDesign. It is not perfect for all applications, but avoids use of non-standard conversion by IDML, avoid to learn IDML, avoid IDML limitations, and avoids risks of IDML bugs... So, I think is faster than try and try IDML procedures.
Another procedure — better, because it allows to express things like footnotes — is to prepare a direct convertion from XML to MS-Word, by a XSLT that transforms XML into DOCX or RFT... Do you have a link or clue for this kind of procedure?
回答6:
This tool is a decent HTML to InDesign importer: https://www.id-extras.com/html-import-script
It may take some rework, but it brings in styles that you can edit and has saved me a bunch of time.
来源:https://stackoverflow.com/questions/9518123/importing-html-into-adobe-indesign