Support cover images in EPUB export + some full screen image improvements

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@112 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2011-06-19 13:39:56 +00:00
parent 63e9c4c66d
commit e09d61f6ee
16 changed files with 202 additions and 117 deletions

View file

@ -2,6 +2,9 @@ Changelog for Writer2LaTeX version 1.0 -> 1.2
---------- version 1.1.8 ----------
[w2x] New option cover_image with values true and false (default). In EPUB export, if this option is set the true the very
first image found in the document is used as cover image
[w2x] New option image_split with values "none" or a percentage. In EPUB export, if image_size is "relative", an image
of width greater than or equal to this percentage is placed in a separate file as a full screen image.
This takes effect only if the aspect ratio is at least 3:4

Binary file not shown.

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2011-06-16)
* Version 1.2 (2011-06-19)
*
*/
@ -102,6 +102,7 @@ public class EpubOptionsDialog extends OptionsDialogBase {
loadListBoxOption(xProps, "PageBreakSplit");
loadCheckBoxOption(xProps, "UseImageSplit");
loadNumericOption(xProps, "ImageSplit");
loadCheckBoxOption(xProps, "CoverImage");
loadCheckBoxOption(xProps, "UseSplitAfter");
loadNumericOption(xProps, "SplitAfter");
@ -175,6 +176,8 @@ public class EpubOptionsDialog extends OptionsDialogBase {
helper.put("image_split", "none");
}
}
saveCheckBoxOption(xProps, helper, "CoverImage", "cover_image");
boolean bUseSplitAfter = saveCheckBoxOption(xProps, "UseSplitAfter");
int nSplitAfter = saveNumericOption(xProps, "SplitAfter");
@ -206,9 +209,6 @@ public class EpubOptionsDialog extends OptionsDialogBase {
else if (sMethod.equals("UseDefaultFontChange")) {
useDefaultFontChange();
}
else if (sMethod.equals("ImageSizeChange")) {
imageSizeChange();
}
else if (sMethod.equals("EditMetadataClick")) {
editMetadataClick();
}
@ -270,6 +270,8 @@ public class EpubOptionsDialog extends OptionsDialogBase {
setControlEnabled("ImageSplit",!isLocked("image_split") && bUseImageSplit);
setControlEnabled("ImageSplitPercentLabel",!isLocked("image_split") && bUseImageSplit);
setControlEnabled("CoverImage", !isLocked("cover_image"));
boolean bUseSplitAfter = getCheckBoxStateAsBoolean("UseSplitAfter");
setControlEnabled("UseSplitAfter",!isLocked("split_after"));
setControlEnabled("SplitAfterLabel",!isLocked("split_after") && bUseSplitAfter);
@ -298,13 +300,6 @@ public class EpubOptionsDialog extends OptionsDialogBase {
}
}
private void imageSizeChange() {
if (!isLocked("image_split")) {
setControlEnabled("UseImageSplit", getListBoxSelectedItem("ImageSize")==1);
useImageSplitChange();
}
}
private void editMetadataClick() {
Object dialog;
try {
@ -324,7 +319,7 @@ public class EpubOptionsDialog extends OptionsDialogBase {
private void useImageSplitChange() {
if (!isLocked("image_split")) {
boolean bEnable = getCheckBoxStateAsBoolean("UseImageSplit") && (getListBoxSelectedItem("ImageSize")==1);
boolean bEnable = getCheckBoxStateAsBoolean("UseImageSplit");
setControlEnabled("ImageSplitLabel",bEnable);
setControlEnabled("ImageSplit",bEnable);
setControlEnabled("ImageSplitPercentLabel",bEnable);

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2011-06-16)
* Version 1.2 (2011-06-19)
*
*/
@ -33,7 +33,7 @@ public class ConverterFactory {
// Version information
private static final String VERSION = "1.1.8";
private static final String DATE = "2011-06-16";
private static final String DATE = "2011-06-19";
/** Return the Writer2LaTeX version in the form
* (major version).(minor version).(patch level)<br/>

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2010 by Henrik Just
* Copyright: 2002-2011 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.2 (2010-04-13)
* Version 1.2 (2011-06-19)
*
*/
@ -105,6 +105,14 @@ public interface ConverterResult {
*/
public ContentEntry getBibliographyFile();
/** Get the entry which contains the cover image
*
* @return the entry or null if a cover image does not exist
*/
public ContentEntry getCoverImageFile();
/** Write all files of the <code>ConverterResult</code> to a directory.
* Subdirectories are created as required by the individual
* <code>OutputFile</code>s.

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2010 by Henrik Just
* Copyright: 2002-2011 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.2 (2010-04-13)
* Version 1.2 (2011-06-19)
*
*/
@ -53,6 +53,7 @@ public class ConverterResultImpl implements ConverterResult {
private ContentEntry lotFile;
private ContentEntry indexFile;
private ContentEntry bibliographyFile;
private ContentEntry coverImageFile;
private MetaData metaData = null;
@ -77,6 +78,7 @@ public class ConverterResultImpl implements ConverterResult {
lotFile = null;
indexFile = null;
bibliographyFile = null;
coverImageFile = null;
metaData = null;
nMasterCount = 0;
}
@ -209,6 +211,18 @@ public class ConverterResultImpl implements ConverterResult {
return bibliographyFile;
}
/** Define the entry which contains the cover image
*
* @param entry the entry
*/
public void setCoverImageFile(ContentEntry entry) {
coverImageFile = entry;
}
public ContentEntry getCoverImageFile() {
return coverImageFile;
}
/** Set the meta data of this <code>ConverterResult</code>
*
* @param metaData the meta data

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2010 by Henrik Just
* Copyright: 2002-2011 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.2 (2010-10-27)
* Version 1.2 (2011-06-16)
*
*/
@ -308,6 +308,9 @@ public class OfficeReader {
// The main content element
private Element content = null;
// The first image in the document
private Element firstImage = null;
// Identify OASIS OpenDocument format
private boolean bOpenDocument = false;
@ -705,6 +708,14 @@ public class OfficeReader {
public TableReader getTableReader(Element node) {
return new TableReader(this,node);
}
/** Get the very first image in this document, if any
*
* @return the first image, or null if no images exists
*/
public Element getFirstImage() {
return firstImage;
}
/** Constructor; read a document */
public OfficeReader(OfficeDocument oooDoc, boolean bAllParagraphsAreSoft) {
@ -1122,6 +1133,11 @@ public class OfficeReader {
}
}
// todo: other indexes
else if (firstImage==null && sName.equals(XMLString.DRAW_FRAME)) {
// This may be an image (note that a replacement image for an object is OK by this definition)
Element image = Misc.getChildByTagName(node, XMLString.DRAW_IMAGE);
if (image!=null) { firstImage=image; }
}
// Traverse the children
Node child = node.getFirstChild();

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2011-06-07)
* Version 1.2 (2011-06-19)
*
*/
@ -217,6 +217,10 @@ public class Converter extends ConverterBase {
converterResult.setIndexFile(new ContentEntryImpl(l10n.get(L10n.INDEX),1,htmlDoc,sTarget));
nAlphabeticalIndex = nOutFileIndex;
}
protected void setCoverImageFile(String sTarget) {
converterResult.setCoverImageFile(new ContentEntryImpl("Cover image",0,htmlDoc,sTarget));
}
protected Element createElement(String s) { return htmlDOM.createElement(s); }

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2011-06-16)
* Version 1.2 (2011-06-19)
*
*/
@ -97,6 +97,7 @@ public class DrawConverter extends ConverterHelper {
private boolean bConvertToPx;
private int nImageSize;
private String sImageSplit;
private boolean bCoverImage;
// Frames in spreadsheet documents are collected here
private Vector<Element> frames = new Vector<Element>();
@ -106,7 +107,7 @@ public class DrawConverter extends ConverterHelper {
// Large images (for full screen) in EPUB export are collected here
private Vector<Element> fullscreenFrames = new Vector<Element>();
// This flag determines whether to collect full screen images or insert them immediately
private boolean bCollectFullscreenFrames = false;
private boolean bCollectFullscreenFrames = true;
public DrawConverter(OfficeReader ofr, XhtmlConfig config, Converter converter) {
super(ofr,config,converter);
@ -122,8 +123,9 @@ public class DrawConverter extends ConverterHelper {
bConvertToPx = config.xhtmlConvertToPx();
nImageSize = config.imageSize();
sImageSplit = config.imageSplit();
bCoverImage = config.coverImage();
}
///////////////////////////////////////////////////////////////////////
// Complete Draw documents/presentations
@ -230,20 +232,36 @@ public class DrawConverter extends ConverterHelper {
else return onode;
}
// Add cover image (the first image in the document is taken out of context)
public Element insertCoverImage(Element hnode) {
Element currentNode = hnode;
if (bCoverImage) {
Element cover = ofr.getFirstImage();
if (cover!=null) {
converter.setCoverImageFile(null);
bCollectFullscreenFrames = false;
handleDrawElement(cover,currentNode,null,FULL_SCREEN);
bCollectFullscreenFrames = true;
currentNode = getTextCv().doMaybeSplit(hnode, 0);
}
}
return currentNode;
}
// Flush all full screen images, returning the new document node
public Element flushFullscreenFrames(Element hnode) {
Element currentFrame = hnode;
Element currentNode = hnode;
if (converter.isTopLevel() && !fullscreenFrames.isEmpty()) {
bCollectFullscreenFrames = false;
currentFrame = getTextCv().doMaybeSplit(hnode, 0);
currentNode = getTextCv().doMaybeSplit(hnode, 0);
for (Element image : fullscreenFrames) {
handleDrawElement(image,currentFrame,null,FULL_SCREEN);
currentFrame = getTextCv().doMaybeSplit(hnode, 0);
handleDrawElement(image,currentNode,null,FULL_SCREEN);
currentNode = getTextCv().doMaybeSplit(hnode, 0);
}
fullscreenFrames.clear();
bCollectFullscreenFrames = true;
}
return currentFrame;
return currentNode;
}
public void flushFrames(Element hnode) {
@ -400,23 +418,28 @@ public class DrawConverter extends ConverterHelper {
private void handleDrawImage(Element onode, Element hnodeBlock, Element hnodeInline, int nMode) {
Element frame = getFrame(onode);
// First check to see if we should treat this image as a "full screen" image
// This is only supported for EPUB documents with relative image size
// (Currently only images are handled like this, hence the code is here rather than in handleDrawElement)
if (bCollectFullscreenFrames && converter.isOPS() && nImageSize==XhtmlConfig.RELATIVE && !"none".equals(sImageSplit)
&& converter.isTopLevel()) {
StyleWithProperties style = ofr.getFrameStyle(frame.getAttribute(XMLString.DRAW_STYLE_NAME));
String sWidth = getFrameWidth(frame, style);
String sHeight = getFrameHeight(frame, style);
// It is if the image width exceeds a certain percentage of the current text width and the height is
// greater than 1.33*the width (recommended by Michel "Coolmicro")
if (sWidth!=null && sHeight!=null &&
Misc.sub(Misc.multiply("133%",sWidth), sHeight).startsWith("-") &&
Misc.sub(Misc.multiply(sImageSplit,converter.getContentWidth()),
Misc.multiply(sScale,Misc.truncateLength(sWidth))).startsWith("-")) {
fullscreenFrames.add(onode);
// For EPUB document some images require special treatment: Cover image and full screen images
if (bCollectFullscreenFrames && converter.isOPS()) {
// First check whether this is the cover image
if (bCoverImage && onode==ofr.getFirstImage()) {
return;
}
// Next check to see if we should treat this image as a "full screen" image
// (Currently only images are handled like this, hence the code is here rather than in handleDrawElement)
else if (!"none".equals(sImageSplit) && converter.isTopLevel()) {
StyleWithProperties style = ofr.getFrameStyle(frame.getAttribute(XMLString.DRAW_STYLE_NAME));
String sWidth = getFrameWidth(frame, style);
String sHeight = getFrameHeight(frame, style);
// It is if the image width exceeds a certain percentage of the current text width and the height is
// greater than 1.33*the width (recommended by Michel "Coolmicro")
if (sWidth!=null && sHeight!=null &&
Misc.sub(Misc.multiply("133%",sWidth), sHeight).startsWith("-") &&
Misc.sub(Misc.multiply(sImageSplit,converter.getContentWidth()),
Misc.multiply(sScale,Misc.truncateLength(sWidth))).startsWith("-")) {
fullscreenFrames.add(onode);
return;
}
}
}
// Get the image from the ImageLoader
@ -462,7 +485,7 @@ public class DrawConverter extends ConverterHelper {
StyleInfo info = new StyleInfo();
String sStyleName = Misc.getAttribute(frame, XMLString.DRAW_STYLE_NAME);
if (nMode!=FULL_SCREEN) { getFrameSc().applyStyle(sStyleName,info); }
applyImageSize(frame,info.props,false);
applyImageSize(frame,info.props,nMode,false);
// Apply placement
applyPlacement(frame, hnodeBlock, hnodeInline, nMode, image, info);
@ -513,7 +536,7 @@ public class DrawConverter extends ConverterHelper {
case INLINE:
break;
case ABSOLUTE:
sContentWidth = applyImageSize(frame,info.props,false);
sContentWidth = applyImageSize(frame,info.props,nMode,false);
info.props.addValue("margin-left","auto");
info.props.addValue("margin-right","auto");
applyPosition(frame,info.props);
@ -523,10 +546,10 @@ public class DrawConverter extends ConverterHelper {
info.props.addValue("margin-bottom","2px");
info.props.addValue("margin-left","auto");
info.props.addValue("margin-right","auto");
sContentWidth = applyImageSize(frame,info.props,true);
sContentWidth = applyImageSize(frame,info.props,nMode,true);
break;
case FLOATING:
sContentWidth = applyImageSize(frame,info.props,true);
sContentWidth = applyImageSize(frame,info.props,nMode,true);
StyleWithProperties style = ofr.getFrameStyle(sStyleName);
if (style!=null) {
String sPos = style.getProperty(XMLString.STYLE_HORIZONTAL_POS);
@ -918,28 +941,25 @@ public class DrawConverter extends ConverterHelper {
// TODO: For absolute placement, only absolute size makes sense
// TODO: How to handle NONE in case of text boxes? (currently using browser default, usually 100% width)
private String applyImageSize(Element node, CSVList props, boolean bOnlyWidth) {
if (bCollectFullscreenFrames) { // Normal image
switch (nImageSize) {
case XhtmlConfig.ABSOLUTE:
return applySize(node, props, bOnlyWidth);
case XhtmlConfig.RELATIVE:
private String applyImageSize(Element node, CSVList props, int nMode, boolean bOnlyWidth) {
switch (nImageSize) {
case XhtmlConfig.ABSOLUTE:
return applySize(node, props, bOnlyWidth);
case XhtmlConfig.RELATIVE:
if (nMode==FULL_SCREEN) {
props.addValue("max-width","100%");
props.addValue("height","100%");
}
else {
String sWidth = getFrameWidth(node, ofr.getFrameStyle(node.getAttribute(XMLString.DRAW_STYLE_NAME)));
if (sWidth!=null) {
props.addValue("width", Misc.divide(Misc.multiply(sScale,Misc.truncateLength(sWidth)),converter.getContentWidth()));
}
return sWidth;
case XhtmlConfig.NONE:
// Nothing to do :-)
return getFrameWidth(node, ofr.getFrameStyle(node.getAttribute(XMLString.DRAW_STYLE_NAME)));
}
}
else { // Full screen image
props.addValue("max-width","100%");
props.addValue("height","100%");
props.addValue("display","block");
props.addValue("margin-left","auto");
props.addValue("margin-right","auto");
case XhtmlConfig.NONE:
// Nothing to do :-)
return getFrameWidth(node, ofr.getFrameStyle(node.getAttribute(XMLString.DRAW_STYLE_NAME)));
}
return null;
}
@ -990,7 +1010,10 @@ public class DrawConverter extends ConverterHelper {
break;
case FULL_SCREEN:
if (hnodeBlock!=null) {
hnodeBlock.appendChild(object);
Element div = converter.createElement("div");
div.setAttribute("style", "text-align:center");
hnodeBlock.appendChild(div);
div.appendChild(object);
}
break;
case FLOATING:

View file

@ -189,6 +189,9 @@ public class TextConverter extends ConverterHelper {
hnode = form;
}
}
// Add cover image
hnode = getDrawCv().insertCoverImage(hnode);
// Convert content
hnode = (Element)traverseBlockText(onode,hnode);

View file

@ -41,7 +41,7 @@ import writer2latex.util.Misc;
public class XhtmlConfig extends writer2latex.base.ConfigBase {
// Implement configuration methods
protected int getOptionCount() { return 55; }
protected int getOptionCount() { return 56; }
protected String getDefaultConfigPath() { return "/writer2latex/xhtml/config/"; }
// Override setOption: To be backwards compatible, we must accept options
@ -136,19 +136,20 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
private static final int PAGE_BREAK_SPLIT = 39;
private static final int SPLIT_AFTER = 40;
private static final int IMAGE_SPLIT = 41;
private static final int CALC_SPLIT = 42;
private static final int DISPLAY_HIDDEN_SHEETS = 43;
private static final int DISPLAY_HIDDEN_ROWS_COLS = 44;
private static final int DISPLAY_FILTERED_ROWS_COLS = 45;
private static final int APPLY_PRINT_RANGES = 46;
private static final int USE_TITLE_AS_HEADING = 47;
private static final int USE_SHEET_NAMES_AS_HEADINGS = 48;
private static final int XSLT_PATH = 49;
private static final int SAVE_IMAGES_IN_SUBDIR = 50;
private static final int UPLINK = 51;
private static final int DIRECTORY_ICON = 52;
private static final int DOCUMENT_ICON = 53;
private static final int ZEN_HACK = 54; // temporary hack for ePub Zen Garden styles
private static final int COVER_IMAGE = 42;
private static final int CALC_SPLIT = 43;
private static final int DISPLAY_HIDDEN_SHEETS = 44;
private static final int DISPLAY_HIDDEN_ROWS_COLS = 45;
private static final int DISPLAY_FILTERED_ROWS_COLS = 46;
private static final int APPLY_PRINT_RANGES = 47;
private static final int USE_TITLE_AS_HEADING = 48;
private static final int USE_SHEET_NAMES_AS_HEADINGS = 49;
private static final int XSLT_PATH = 50;
private static final int SAVE_IMAGES_IN_SUBDIR = 51;
private static final int UPLINK = 52;
private static final int DIRECTORY_ICON = 53;
private static final int DOCUMENT_ICON = 54;
private static final int ZEN_HACK = 55; // temporary hack for ePub Zen Garden styles
protected ComplexOption xheading = addComplexOption("heading-map");
protected ComplexOption xpar = addComplexOption("paragraph-map");
@ -258,6 +259,7 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
}
};
options[IMAGE_SPLIT] = new Option("image_split","none");
options[COVER_IMAGE] = new BooleanOption("cover_image","false");
options[CALC_SPLIT] = new BooleanOption("calc_split","false");
options[DISPLAY_HIDDEN_SHEETS] = new BooleanOption("display_hidden_sheets", "false");
options[DISPLAY_HIDDEN_ROWS_COLS] = new BooleanOption("display_hidden_rows_cols","false");
@ -383,6 +385,7 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
public int pageBreakSplit() { return ((IntegerOption) options[PAGE_BREAK_SPLIT]).getValue(); }
public int splitAfter() { return ((IntegerOption) options[SPLIT_AFTER]).getValue(); }
public String imageSplit() { return options[IMAGE_SPLIT].getString(); }
public boolean coverImage() { return ((BooleanOption) options[COVER_IMAGE]).getValue(); }
public boolean xhtmlCalcSplit() { return ((BooleanOption) options[CALC_SPLIT]).getValue(); }
public boolean xhtmlDisplayHiddenSheets() { return ((BooleanOption) options[DISPLAY_HIDDEN_SHEETS]).getValue(); }
public boolean displayHiddenRowsCols() { return ((BooleanOption) options[DISPLAY_HIDDEN_ROWS_COLS]).getValue(); }

View file

@ -75,6 +75,7 @@
<prop oor:name="PageBreakSplit" oor:type="xs:short" />
<prop oor:name="UseImageSplit" oor:type="xs:boolean" />
<prop oor:name="ImageSplit" oor:type="xs:int" />
<prop oor:name="CoverImage" oor:type="xs:boolean" />
<prop oor:name="UseSplitAfter" oor:type="xs:boolean" />
<prop oor:name="SplitAfter" oor:type="xs:int" />
<!-- Table of contents -->

View file

@ -115,6 +115,9 @@
<prop oor:name="ImageSplit" oor:type="xs:int">
<value>30</value>
</prop>
<prop oor:name="CoverImage" oor:type="xs:boolean">
<value>false</value>
</prop>
<prop oor:name="UseSplitAfter" oor:type="xs:boolean">
<value>true</value>
</prop>

View file

@ -76,7 +76,7 @@
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:DateUpClick" script:language="UNO"/>
</dlg:button>
<dlg:button dlg:id="DateDownButton" dlg:tab-index="17" dlg:left="145" dlg:top="152" dlg:width="25" dlg:height="12" dlg:value="Down">
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:DateDownClick" script:language="UNO"/>
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:DateDownClick" script:language="UNO"/>
</dlg:button>
</dlg:bulletinboard>
</dlg:window>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="EpubOptions" dlg:left="139" dlg:top="84" dlg:width="360" dlg:height="240" dlg:closeable="true" dlg:moveable="true" dlg:title="EPUB Options (Writer2xhtml)">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="EpubOptions" dlg:left="139" dlg:top="84" dlg:width="360" dlg:height="250" dlg:closeable="true" dlg:moveable="true" dlg:title="EPUB Options (Writer2xhtml)">
<dlg:bulletinboard>
<dlg:text dlg:id="StyleLabel" dlg:tab-index="0" dlg:left="5" dlg:top="8" dlg:width="160" dlg:height="12" dlg:value="Style"/>
<dlg:text dlg:id="ConfigLabel" dlg:tab-index="1" dlg:left="10" dlg:top="22" dlg:width="60" dlg:height="12" dlg:value="Use style"/>
@ -16,15 +16,15 @@
<dlg:text dlg:id="ScalingPercentLabel" dlg:tab-index="5" dlg:left="155" dlg:top="36" dlg:width="10" dlg:height="12" dlg:value="%"/>
<dlg:text dlg:id="ColumnScalingLabel" dlg:tab-index="6" dlg:left="10" dlg:top="50" dlg:width="100" dlg:height="12" dlg:value="Column scaling"/>
<dlg:numericfield dlg:id="ColumnScaling" dlg:tab-index="7" dlg:left="120" dlg:top="48" dlg:width="30" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsColumnScaling" dlg:strict-format="true" dlg:decimal-accuracy="0" dlg:value="100" dlg:value-min="1" dlg:value-max="1000" dlg:value-step="10" dlg:spin="true"/>
<dlg:text dlg:id="ColumnScalingPercentLabel" dlg:tab-index="28" dlg:left="155" dlg:top="50" dlg:width="10" dlg:height="12" dlg:value="%"/>
<dlg:text dlg:id="ColumnScalingPercentLabel" dlg:tab-index="29" dlg:left="155" dlg:top="50" dlg:width="10" dlg:height="12" dlg:value="%"/>
<dlg:checkbox dlg:id="ConvertToPx" dlg:tab-index="12" dlg:left="10" dlg:top="120" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsConvertToPx" dlg:value="Convert units to px (pixels)" dlg:checked="true"/>
<dlg:text dlg:id="SpecialContentLabel" dlg:tab-index="29" dlg:left="185" dlg:top="8" dlg:width="160" dlg:height="12" dlg:value="Special content"/>
<dlg:text dlg:id="SpecialContentLabel" dlg:tab-index="30" dlg:left="185" dlg:top="8" dlg:width="160" dlg:height="12" dlg:value="Special content"/>
<dlg:checkbox dlg:id="Notes" dlg:tab-index="18" dlg:left="190" dlg:top="36" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsNotes" dlg:value="Export notes" dlg:checked="true"/>
<dlg:text dlg:id="AutoCorrectLabel" dlg:tab-index="30" dlg:left="5" dlg:top="148" dlg:width="160" dlg:height="12" dlg:value="AutoCorrect"/>
<dlg:text dlg:id="AutoCorrectLabel" dlg:tab-index="31" dlg:left="5" dlg:top="148" dlg:width="160" dlg:height="12" dlg:value="AutoCorrect"/>
<dlg:checkbox dlg:id="IgnoreHardLineBreaks" dlg:tab-index="14" dlg:left="10" dlg:top="162" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreHardLineBreaks" dlg:value="Ignore hard line breaks" dlg:checked="false"/>
<dlg:checkbox dlg:id="IgnoreEmptyParagraphs" dlg:tab-index="15" dlg:left="10" dlg:top="176" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreEmptyParagraphs" dlg:value="Ignore empty paragraphs" dlg:checked="false"/>
<dlg:checkbox dlg:id="IgnoreDoubleSpaces" dlg:tab-index="16" dlg:left="10" dlg:top="190" dlg:width="155" dlg:height="15" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreDoubleSpaces" dlg:value="Ignore double spaces" dlg:checked="false"/>
<dlg:text dlg:id="SplitLevelLabel" dlg:tab-index="32" dlg:left="190" dlg:top="78" dlg:width="90" dlg:height="12" dlg:value="At heading level"/>
<dlg:text dlg:id="SplitLevelLabel" dlg:tab-index="33" dlg:left="190" dlg:top="78" dlg:width="90" dlg:height="12" dlg:value="At heading level"/>
<dlg:menulist dlg:id="SplitLevel" dlg:tab-index="20" dlg:left="285" dlg:top="76" dlg:width="60" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsSplitLevel" dlg:spin="true" dlg:linecount="7">
<dlg:menupopup>
<dlg:menuitem dlg:value="None"/>
@ -36,23 +36,23 @@
<dlg:menuitem dlg:value="6"/>
</dlg:menupopup>
</dlg:menulist>
<dlg:button dlg:id="ExportButton" dlg:tab-index="33" dlg:left="5" dlg:top="216" dlg:width="55" dlg:height="12" dlg:value="Export" dlg:button-type="ok"/>
<dlg:button dlg:id="CancelButton" dlg:tab-index="34" dlg:left="70" dlg:top="216" dlg:width="55" dlg:height="12" dlg:value="Cancel" dlg:button-type="cancel"/>
<dlg:button dlg:id="HelpButton" dlg:tab-index="35" dlg:left="290" dlg:top="216" dlg:width="55" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptions" dlg:value="Help" dlg:button-type="help"/>
<dlg:fixedline dlg:id="FixedLine1" dlg:tab-index="36" dlg:left="175" dlg:top="9" dlg:width="2" dlg:height="190" dlg:value="&amp;143.XhtmlOptions.FixedLine1.Label" dlg:align="vertical"/>
<dlg:button dlg:id="ExportButton" dlg:tab-index="34" dlg:left="5" dlg:top="230" dlg:width="55" dlg:height="12" dlg:value="Export" dlg:button-type="ok"/>
<dlg:button dlg:id="CancelButton" dlg:tab-index="35" dlg:left="70" dlg:top="230" dlg:width="55" dlg:height="12" dlg:value="Cancel" dlg:button-type="cancel"/>
<dlg:button dlg:id="HelpButton" dlg:tab-index="36" dlg:left="290" dlg:top="230" dlg:width="55" dlg:height="12" dlg:value="Help" dlg:button-type="help"/>
<dlg:fixedline dlg:id="FixedLine1" dlg:tab-index="37" dlg:left="175" dlg:top="9" dlg:width="2" dlg:height="190" dlg:value="&amp;143.XhtmlOptions.FixedLine1.Label" dlg:align="vertical"/>
<dlg:checkbox dlg:id="RelativeFontSize" dlg:tab-index="8" dlg:left="10" dlg:top="64" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsRelativeFontSize" dlg:value="Use relative font size" dlg:checked="true">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:RelativeFontSizeChange" script:language="UNO"/>
</dlg:checkbox>
<dlg:text dlg:id="FontScalingLabel" dlg:tab-index="37" dlg:left="19" dlg:top="78" dlg:width="90" dlg:height="12" dlg:value="Scaling"/>
<dlg:text dlg:id="FontScalingLabel" dlg:tab-index="38" dlg:left="19" dlg:top="78" dlg:width="90" dlg:height="12" dlg:value="Scaling"/>
<dlg:numericfield dlg:id="FontScaling" dlg:tab-index="9" dlg:left="120" dlg:top="76" dlg:width="30" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsFontScaling" dlg:strict-format="true" dlg:decimal-accuracy="0" dlg:value="100" dlg:value-min="1" dlg:value-max="1000" dlg:value-step="10" dlg:spin="true"/>
<dlg:text dlg:id="FontScalingPercentLabel" dlg:tab-index="38" dlg:left="155" dlg:top="78" dlg:width="10" dlg:height="12" dlg:value="%"/>
<dlg:text dlg:id="FontScalingPercentLabel" dlg:tab-index="39" dlg:left="155" dlg:top="78" dlg:width="10" dlg:height="12" dlg:value="%"/>
<dlg:checkbox dlg:id="UseDefaultFont" dlg:tab-index="10" dlg:left="10" dlg:top="92" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseDefaultFont" dlg:value="Use a single font for the entire document" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:UseDefaultFontChange" script:language="UNO"/>
</dlg:checkbox>
<dlg:text dlg:id="DefaultFontNameLabel" dlg:tab-index="39" dlg:left="19" dlg:top="106" dlg:width="50" dlg:height="12" dlg:value="Font name"/>
<dlg:text dlg:id="DefaultFontNameLabel" dlg:tab-index="40" dlg:left="19" dlg:top="106" dlg:width="50" dlg:height="12" dlg:value="Font name"/>
<dlg:combobox dlg:id="DefaultFontName" dlg:tab-index="11" dlg:left="75" dlg:top="104" dlg:width="90" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsDefaultFontName" dlg:spin="true"/>
<dlg:checkbox dlg:id="DisplayHiddenText" dlg:tab-index="17" dlg:left="190" dlg:top="22" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsDisplayHiddenText" dlg:value="Display hidden text" dlg:checked="false"/>
<dlg:text dlg:id="PageBreakSplitLabel" dlg:tab-index="40" dlg:left="190" dlg:top="92" dlg:width="90" dlg:height="12" dlg:value="At page breaks"/>
<dlg:text dlg:id="PageBreakSplitLabel" dlg:tab-index="41" dlg:left="190" dlg:top="92" dlg:width="90" dlg:height="12" dlg:value="At page breaks"/>
<dlg:menulist dlg:id="PageBreakSplit" dlg:tab-index="21" dlg:left="285" dlg:top="90" dlg:width="60" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsPageBreakSplit" dlg:spin="true" dlg:linecount="4">
<dlg:menupopup>
<dlg:menuitem dlg:value="None"/>
@ -61,14 +61,14 @@
<dlg:menuitem dlg:value="All"/>
</dlg:menupopup>
</dlg:menulist>
<dlg:checkbox dlg:id="IncludeToc" dlg:tab-index="27" dlg:left="190" dlg:top="190" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsIncludeToc" dlg:value="Also include original table of contents" dlg:checked="false"/>
<dlg:checkbox dlg:id="UseSplitAfter" dlg:tab-index="24" dlg:left="190" dlg:top="134" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseEpubAutoSplit" dlg:value="Automatic split of long documents" dlg:checked="false">
<dlg:checkbox dlg:id="IncludeToc" dlg:tab-index="28" dlg:left="190" dlg:top="204" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsIncludeToc" dlg:value="Also include original table of contents" dlg:checked="false"/>
<dlg:checkbox dlg:id="UseSplitAfter" dlg:tab-index="25" dlg:left="190" dlg:top="148" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseEpubAutoSplit" dlg:value="Automatic split of long documents" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:UseSplitAfterChange" script:language="UNO"/>
</dlg:checkbox>
<dlg:text dlg:id="SplitAfterLabel" dlg:tab-index="41" dlg:left="199" dlg:top="148" dlg:width="90" dlg:height="12" dlg:value="After (in 1000 characters)"/>
<dlg:numericfield dlg:id="SplitAfter" dlg:tab-index="25" dlg:left="300" dlg:top="146" dlg:width="45" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsEpubAutoSplit" dlg:strict-format="true" dlg:decimal-accuracy="0" dlg:value-min="10" dlg:value-max="1000" dlg:value-step="10" dlg:spin="true"/>
<dlg:text dlg:id="ExternalTocDepthLabel" dlg:tab-index="42" dlg:left="190" dlg:top="176" dlg:width="100" dlg:height="12" dlg:value="Number of heading levels to include"/>
<dlg:menulist dlg:id="ExternalTocDepth" dlg:tab-index="26" dlg:left="300" dlg:top="174" dlg:width="45" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsExternalTocDepth" dlg:spin="true" dlg:linecount="10">
<dlg:text dlg:id="SplitAfterLabel" dlg:tab-index="42" dlg:left="199" dlg:top="162" dlg:width="90" dlg:height="12" dlg:value="After (in 1000 characters)"/>
<dlg:numericfield dlg:id="SplitAfter" dlg:tab-index="26" dlg:left="300" dlg:top="160" dlg:width="45" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsEpubAutoSplit" dlg:strict-format="true" dlg:decimal-accuracy="0" dlg:value-min="10" dlg:value-max="1000" dlg:value-step="10" dlg:spin="true"/>
<dlg:text dlg:id="ExternalTocDepthLabel" dlg:tab-index="43" dlg:left="190" dlg:top="190" dlg:width="100" dlg:height="12" dlg:value="Number of heading levels to include"/>
<dlg:menulist dlg:id="ExternalTocDepth" dlg:tab-index="27" dlg:left="300" dlg:top="188" dlg:width="45" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsExternalTocDepth" dlg:spin="true" dlg:linecount="10">
<dlg:menupopup>
<dlg:menuitem dlg:value="1"/>
<dlg:menuitem dlg:value="2"/>
@ -82,25 +82,25 @@
<dlg:menuitem dlg:value="10"/>
</dlg:menupopup>
</dlg:menulist>
<dlg:text dlg:id="TocLabel" dlg:tab-index="43" dlg:left="185" dlg:top="162" dlg:width="160" dlg:height="12" dlg:value="Navigation table"/>
<dlg:text dlg:id="DocumentDivisionLabel" dlg:tab-index="31" dlg:left="185" dlg:top="64" dlg:width="160" dlg:height="12" dlg:value="Document division"/>
<dlg:button dlg:id="EditMetadata" dlg:tab-index="19" dlg:left="190" dlg:top="48" dlg:width="100" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseCustomMetadata" dlg:value="Edit document properties">
<dlg:text dlg:id="TocLabel" dlg:tab-index="44" dlg:left="185" dlg:top="176" dlg:width="160" dlg:height="12" dlg:value="Navigation table"/>
<dlg:text dlg:id="DocumentDivisionLabel" dlg:tab-index="32" dlg:left="185" dlg:top="64" dlg:width="160" dlg:height="12" dlg:value="Document division (page breaks)"/>
<dlg:button dlg:id="EditMetadata" dlg:tab-index="19" dlg:left="190" dlg:top="48" dlg:width="100" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsEditMetadata" dlg:value="Edit document properties">
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:EditMetadataClick" script:language="UNO"/>
</dlg:button>
<dlg:text dlg:id="ImageSizeLabel" dlg:tab-index="44" dlg:left="10" dlg:top="134" dlg:width="60" dlg:height="12" dlg:value="Image size"/>
<dlg:text dlg:id="ImageSizeLabel" dlg:tab-index="45" dlg:left="10" dlg:top="134" dlg:width="60" dlg:height="12" dlg:value="Image size"/>
<dlg:menulist dlg:id="ImageSize" dlg:tab-index="13" dlg:left="75" dlg:top="132" dlg:width="90" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsImageSize" dlg:spin="true" dlg:linecount="3">
<dlg:menupopup>
<dlg:menuitem dlg:value="Use absolute size"/>
<dlg:menuitem dlg:value="Use relative size (%)"/>
<dlg:menuitem dlg:value="Use original image size"/>
</dlg:menupopup>
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:ImageSizeChange" script:language="UNO"/>
</dlg:menulist>
<dlg:checkbox dlg:id="UseImageSplit" dlg:tab-index="22" dlg:left="190" dlg:top="106" dlg:width="155" dlg:height="12" dlg:value="Use full screen for large images" dlg:checked="false" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseImageSplit">
<dlg:checkbox dlg:id="UseImageSplit" dlg:tab-index="22" dlg:left="190" dlg:top="106" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseImageSplit" dlg:value="Use full screen for large images" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:UseImageSplitChange" script:language="UNO"/>
</dlg:checkbox>
<dlg:text dlg:id="ImageSplitLabel" dlg:tab-index="45" dlg:left="199" dlg:top="120" dlg:width="90" dlg:height="12" dlg:value="Minimum width"/>
<dlg:text dlg:id="ImageSplitPercentLabel" dlg:tab-index="46" dlg:left="335" dlg:top="120" dlg:width="10" dlg:height="12" dlg:value="%"/>
<dlg:numericfield dlg:id="ImageSplit" dlg:tab-index="23" dlg:left="300" dlg:top="118" dlg:width="30" dlg:height="12" dlg:strict-format="true" dlg:decimal-accuracy="0" dlg:value="100" dlg:value-min="0" dlg:value-max="100" dlg:spin="true" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsImageSplit"/>
<dlg:text dlg:id="ImageSplitLabel" dlg:tab-index="46" dlg:left="199" dlg:top="120" dlg:width="90" dlg:height="12" dlg:value="Minimum width"/>
<dlg:text dlg:id="ImageSplitPercentLabel" dlg:tab-index="47" dlg:left="335" dlg:top="120" dlg:width="10" dlg:height="12" dlg:value="%"/>
<dlg:numericfield dlg:id="ImageSplit" dlg:tab-index="23" dlg:left="300" dlg:top="118" dlg:width="30" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsImageSplit" dlg:strict-format="true" dlg:decimal-accuracy="0" dlg:value="100" dlg:value-min="0" dlg:value-max="100" dlg:spin="true"/>
<dlg:checkbox dlg:id="CoverImage" dlg:tab-index="24" dlg:left="190" dlg:top="134" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsCoverImage" dlg:value="Use first image as cover image" dlg:checked="false"/>
</dlg:bulletinboard>
</dlg:window>

View file

@ -139,15 +139,19 @@
<paragraph role="heading" level="3" xml-lang="en-US">Export optional document properties</paragraph>
<paragraph role="paragraph" xml-lang="en-US">If you select this option, all the document properties (File Properties)
are exported, otherwise only the title is exported.</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Click <emph>Edit</emph> to open the dialog to edit the document properties.</paragraph>
<paragraph role="heading" level="2" xml-lang="en-US">Document division</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Technically an EPUB document consists of several document parts in XHTML format.
In principle you can have only one part, but this is not recommended. For performance reasons and because some EPUB readers have
a limitation on the size of the individual files in the doucment you should select one or more
of the following options to split the document.
</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsEditMetadata" id="bm_options_editmetadata"/>
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2xhtml.oxt:EpubOptionsEditMetadata" visibility="hidden">Clik this to edit the document properties, e.g. author, title, date</ahelp></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US">Edit document properties</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Click this button to open the dialog to edit the document properties such as
title, author or date.</paragraph>
<paragraph role="heading" level="2" xml-lang="en-US">Document division (page breaks)</paragraph>
<paragraph role="paragraph" xml-lang="en-US">These settings lets you insert page breaks at various places in the document.
It is recommended always to use one or more of these settings. One reason for this is that it enhances the readability of
your document. Another reason is technical: Page breaks splits the splits the internal structure into smaller parts.
This improves performance, and also some EPUB readers have a limitation on the size of the individual parts of the
doucment.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsSplitLevel" id="bm_options_splitlevel"/>
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2xhtml.oxt:EpubOptionsSplitLevel" visibility="hidden">Select the heading level at which spliting should occur, or "None" if you do not want to split at headings</ahelp></paragraph>
@ -185,8 +189,9 @@
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseImageSplit" id="bm_options_useimagesplit"/>
<paragraph role="heading" level="3" xml-lang="en-US">Use full screen for large images</paragraph>
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseImageSplit" visibility="hidden">Select this option to show large images on full screen rather than embedded in the text</ahelp></paragraph>
<paragraph role="paragraph" xml-lang="en-US">Select this option to show large images on full screen rather than embedded
in the text.</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Images will normally be exported as an integrated part of the text. As EPUB readers
may have a relatively small screen, this may not be optimal for large images.
Select this option to split the document at large images, which means that they will be displayed on full screen.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsImageSplit" id="bm_options_imagesplit"/>
<paragraph role="heading" level="3" xml-lang="en-US">Minimum width</paragraph>
@ -194,6 +199,13 @@
<paragraph role="paragraph" xml-lang="en-US">Enter the minimum width for a large image. Only images with at least this relative width
and an aspect ratio of 3:4 or higher will be export as full screen images.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsCoverImage" id="bm_options_coverimage"/>
<paragraph role="heading" level="3" xml-lang="en-US">Use first image as cover image</paragraph>
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2xhtml.oxt:EpubOptionsCoverImage" visibility="hidden">Check this to use the first image found in the document as cover image</ahelp></paragraph>
<paragraph role="paragraph" xml-lang="en-US">An EPUB document often include a cover image in analogy with the cover of a book.
Check this to use the first image found in the document as cover image. The position
of the image in the original document does not matter.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseEpubAutoSplit" id="bm_options_useepubautosplit"/>
<paragraph role="heading" level="3" xml-lang="en-US">Automatic split of long documents</paragraph>
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseEpubAutoSplit" visibility="hidden">Check this to enable automatic split of long documents based on the number of characters</ahelp></paragraph>