Support EPUB style resources (embed images and fonts used in custom CSS file)

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@108 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2011-06-07 09:01:15 +00:00
parent 2ad8f3b7a2
commit ef05312e21
14 changed files with 342 additions and 97 deletions

View file

@ -15,9 +15,9 @@
<set oor:name="Resources" oor:node-type="Resource" />
</group>
<group oor:name="Resource">
<prop oor:name="MediaType" oor:type="xs:string" />
<prop oor:name="FileName" oor:type="xs:string" />
<prop oor:name="URL" oor:type="xs:string" />
<prop oor:name="FileName" oor:type="xs:string" />
<prop oor:name="MediaType" oor:type="xs:string" />
</group>
<group oor:name="Template">
<prop oor:name="TemplateName" oor:type="xs:string" />

View file

@ -3,19 +3,25 @@
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Stylesheets" dlg:left="139" dlg:top="84" dlg:width="260" dlg:height="185" dlg:closeable="true" dlg:moveable="true" dlg:title="Stylesheets" dlg:withtitlebar="false">
<dlg:bulletinboard>
<dlg:text dlg:id="IncludedCustomStylesheetLabel" dlg:tab-index="0" dlg:left="5" dlg:top="8" dlg:width="245" dlg:height="12" dlg:value="Custom style sheets"/>
<dlg:checkbox dlg:id="LinkCustomStylesheet" dlg:tab-index="1" dlg:left="10" dlg:top="22" dlg:width="240" dlg:height="12" dlg:value="Insert link to custom style sheet (XHTML export)" dlg:checked="false" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:LinkCustomStylesheet">
<dlg:checkbox dlg:id="LinkCustomStylesheet" dlg:tab-index="1" dlg:left="10" dlg:top="22" dlg:width="240" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:LinkCustomStylesheet" dlg:value="Insert link to custom style sheet (XHTML export)" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:LinkCustomStylesheetChange" script:language="UNO"/>
</dlg:checkbox>
<dlg:text dlg:id="CustomStylesheetURLLabel" dlg:tab-index="2" dlg:left="19" dlg:top="36" dlg:width="55" dlg:height="12" dlg:value="URL"/>
<dlg:textfield dlg:id="CustomStylesheetURL" dlg:tab-index="3" dlg:left="80" dlg:top="34" dlg:width="170" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:CustomStylesheetURL"/>
<dlg:checkbox dlg:id="UseCustomStylesheet" dlg:tab-index="4" dlg:left="10" dlg:top="50" dlg:width="240" dlg:height="12" dlg:value="Include custom style sheet (EPUB export)" dlg:checked="false" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:UseCustomStylesheet">
<dlg:checkbox dlg:id="UseCustomStylesheet" dlg:tab-index="4" dlg:left="10" dlg:top="50" dlg:width="140" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:UseCustomStylesheet" dlg:value="Include custom style sheet (EPUB export)" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:UseCustomStylesheetChange" script:language="UNO"/>
</dlg:checkbox>
<dlg:textfield dlg:id="CustomStylesheet" dlg:tab-index="5" dlg:left="18" dlg:top="64" dlg:width="232" dlg:height="84" dlg:hscroll="true" dlg:vscroll="true" dlg:multiline="true" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:UseCustomStylesheet"/>
<dlg:button dlg:id="LoadStylesheetButton" dlg:tab-index="6" dlg:left="18" dlg:top="156" dlg:width="60" dlg:height="12" dlg:value="Load..." dlg:help-url="org.openoffice.da.writer2xhtml.oxt:LoadStylesheet">
<dlg:textfield dlg:id="CustomStylesheet" dlg:tab-index="5" dlg:left="18" dlg:top="64" dlg:width="135" dlg:height="84" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:CustomStylesheet" dlg:hscroll="true" dlg:vscroll="true" dlg:multiline="true"/>
<dlg:button dlg:id="LoadStylesheetButton" dlg:tab-index="6" dlg:left="18" dlg:top="156" dlg:width="60" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:LoadStylesheet" dlg:value="Load...">
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:LoadStylesheetClick" script:language="UNO"/>
</dlg:button>
<dlg:text dlg:id="ResourceLabel" dlg:tab-index="8" dlg:left="160" dlg:top="50" dlg:width="90" dlg:height="12" dlg:value="Style resources"/>
<dlg:menulist dlg:id="Resources" dlg:tab-index="7" dlg:left="160" dlg:top="64" dlg:width="90" dlg:height="84" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:Resources"/>
<dlg:button dlg:id="NewResourceButton" dlg:tab-index="9" dlg:left="160" dlg:top="156" dlg:width="40" dlg:height="12" dlg:value="New..." dlg:help-url="org.openoffice.da.writer2xhtml.oxt:NewResource">
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:NewResourceClick" script:language="UNO"/>
</dlg:button>
<dlg:button dlg:id="DeleteResourceButton" dlg:tab-index="10" dlg:left="209" dlg:top="156" dlg:width="40" dlg:height="12" dlg:value="Delete..." dlg:help-url="org.openoffice.da.writer2xhtml.oxt:DeleteResource">
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:DeleteResourceClick" script:language="UNO"/>
</dlg:button>
</dlg:bulletinboard>
</dlg:window>

View file

@ -7,7 +7,7 @@
</topic>
</meta>
<body>
<paragraph role="heading" level="1" xml-lang="en-US">Stylesheets</paragraph>
<paragraph role="heading" level="1" xml-lang="en-US">Style sheets</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Use this page to provide your own style sheets for the exported documents.</paragraph>
<section id="howtoget" xml-lang="en-US">
@ -33,9 +33,37 @@
<paragraph role="heading" level="3" xml-lang="en-US">Include custom style sheet (EPUB export)</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Check this to include a custom style sheet in the EPUB document.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:CustomStylesheet" id="bm_configcustomstylesheet"/>
<paragraph role="heading" level="3" xml-lang="en-US">Custom style sheet</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Enter the CSS code for your custom style sheet here.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:LoadStylesheet" id="bm_configloadstylesheet"/>
<paragraph role="heading" level="3" xml-lang="en-US">Load...</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Click to load the style sheet from a file.</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Click to load the style sheet from a file.
This will create a copy of the original file. If you change, move or delete the original file, nothing
will happen to the style sheet. If you want to update the style sheet with a new version of the original file, click
this button again.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:Resources" id="bm_configresources"/>
<paragraph role="heading" level="3" xml-lang="en-US">Style resources</paragraph>
<paragraph role="paragraph" xml-lang="en-US">This is a list of resource files to include with the custom style sheet.
You can refer to these files from your style sheet. The reference should be by file name only, as the resource files
are placed in the same directory as the style sheet. For example:</paragraph>
<paragraph role="code" xml-lang="en-US">body { background-image:url('myimage.jpg'); }</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Note that changes to this list will <emph>not</emph> be undone if
you click <emph>Cancel</emph>.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:NewResource" id="bm_newresource"/>
<paragraph role="heading" level="3" xml-lang="en-US">New...</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Click this to add a new resource file to the list. Select the file and press
<emph>Open</emph>. This will create a copy of the original file. If you change, move or delete the original file, nothing
will happen to the resource file. If you want to update the resource file with a new version of the original file, click
this button again.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:DeleteResource" id="bm_deleteresource"/>
<paragraph role="heading" level="3" xml-lang="en-US">Delete...</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Click this to delete the currently selected resource file from the list.
This will not affect the original file.</paragraph>
</body>
</helpdocument>