EPUB changes: Revised internal structure of document, changed some defaults and started meta data editor

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@89 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2011-02-20 16:06:55 +00:00
parent 2887a53143
commit a524ca933d
23 changed files with 381 additions and 264 deletions

View file

@ -35,7 +35,7 @@
<!-- configure the directories -->
<property name="jarfile" value="writer2latex"/>
<property name="basename" value="writer2latex11"/>
<property name="distrofile" value="${basename}6alpha.zip" />
<property name="distrofile" value="${basename}7alpha.zip" />
<!--<property name="sourcedistrofile" value="${basename}source.zip" />-->
<property name="src" location="source/java"/>
<property name="source.distro" location="source/distro" />

View file

@ -1,5 +1,21 @@
Changelog for Writer2LaTeX version 1.0 -> 1.2
---------- version 1.1.7 ----------
[w2x] Standard meta data as well as custom meta data can now be edited directly from the EPUB export dialog
[w2x] New option use_custom_metadata (default true) making the inclusion of custom meta data in EPUB export optional
[w2x] Revised the internal structure of EPUB files: Text files are named chapter<n>.xhtml, images are placed in the
subdirectory images and name image<n>, styles are placed in the subdirectory styles and names styles.css (custom
style sheet) and styles1.css (generated style sheet)
[w2x] Use relative font size is now selected per default in EPUB export dialog
[w2x] Default value of the option formulas changed to image+starmath
[w2x] Default value of the option use_default_font changed to false (was true by mistake)
---------- version 1.1.6 ----------
[all] Changed w2l.bat to use %~dp0 as suggested by Dave Jarvis (this leaves out any (probably none) win 9x users)

Binary file not shown.

View file

@ -16,24 +16,29 @@
* 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-12-29)
* Version 1.2 (2011-02-20)
*
*/
// TODO: Add to doc:
// New options relative_font_size, font_scaling, use_default_font, default_font_name, split_after, page_break_split, include_toc
// Also add to list of possible locked options external_toc_depth, display_hidden_text
package org.openoffice.da.comp.writer2xhtml;
import java.awt.GraphicsEnvironment;
import com.sun.star.awt.XDialog;
import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
import com.sun.star.frame.XDesktop;
import com.sun.star.frame.XDispatchHelper;
import com.sun.star.frame.XDispatchProvider;
import com.sun.star.frame.XFrame;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import org.openoffice.da.comp.w2lcommon.helper.PropertyHelper;
@ -88,16 +93,17 @@ public class EpubOptionsDialog extends OptionsDialogBase {
setListBoxStringItemList("DefaultFontName",
GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames());
// Special content
loadCheckBoxOption(xProps, "DisplayHiddenText");
loadCheckBoxOption(xProps, "Notes");
loadCheckBoxOption(xProps, "UseDublinCore");
// AutoCorrect
loadCheckBoxOption(xProps, "IgnoreHardLineBreaks");
loadCheckBoxOption(xProps, "IgnoreEmptyParagraphs");
loadCheckBoxOption(xProps, "IgnoreDoubleSpaces");
// Special content
loadCheckBoxOption(xProps, "DisplayHiddenText");
loadCheckBoxOption(xProps, "Notes");
loadCheckBoxOption(xProps, "UseDublinCore");
loadCheckBoxOption(xProps, "UseCustomMetadata");
// Document division
loadCheckBoxOption(xProps, "Split");
loadListBoxOption(xProps, "SplitLevel");
@ -135,16 +141,17 @@ public class EpubOptionsDialog extends OptionsDialogBase {
saveCheckBoxOption(xProps, helper, "ConvertToPx", "convert_to_px");
saveCheckBoxOption(xProps, helper, "OriginalImageSize", "original_image_size");
// Special content
saveCheckBoxOption(xProps, helper, "DisplayHiddenText", "display_hidden_text");
saveCheckBoxOption(xProps, helper, "Notes", "notes");
saveCheckBoxOption(xProps, helper, "UseDublinCore", "use_dublin_core");
// AutoCorrect
saveCheckBoxOption(xProps, helper, "IgnoreHardLineBreaks", "ignore_hard_line_breaks");
saveCheckBoxOption(xProps, helper, "IgnoreEmptyParagraphs", "ignore_empty_paragraphs");
saveCheckBoxOption(xProps, helper, "IgnoreDoubleSpaces", "ignore_double_spaces");
// Special content
saveCheckBoxOption(xProps, helper, "DisplayHiddenText", "display_hidden_text");
saveCheckBoxOption(xProps, helper, "Notes", "notes");
saveCheckBoxOption(xProps, helper, "UseDublinCore", "use_dublin_core");
saveCheckBoxOption(xProps, helper, "UseCustomMetadata", "use_custom_metadata");
// Document division
boolean bSplit = saveCheckBoxOption(xProps, "Split");
short nSplitLevel = saveListBoxOption(xProps, "SplitLevel");
@ -202,6 +209,12 @@ public class EpubOptionsDialog extends OptionsDialogBase {
else if (sMethod.equals("UseDefaultFontChange")) {
useDefaultFontChange();
}
else if (sMethod.equals("EditMetadataClick")) {
editMetadataClick();
}
else if (sMethod.equals("EditCustomMetadataClick")) {
editCustomMetadataClick();
}
else if (sMethod.equals("SplitChange")) {
splitChange();
}
@ -216,6 +229,7 @@ public class EpubOptionsDialog extends OptionsDialogBase {
@Override public String[] getSupportedMethodNames() {
String[] sNames = { "ConfigChange", "RelativeFontSizeChange", "UseDefaultFontChange",
"EditMetadataClick", "EditCustomMetadataClick",
"SplitChange", "UsePageBreakSplitChange", "UseSplitAfterChange" };
return sNames;
}
@ -242,15 +256,16 @@ public class EpubOptionsDialog extends OptionsDialogBase {
setControlEnabled("ConvertToPx",!isLocked("convert_to_px"));
setControlEnabled("OriginalImageSize",!isLocked("original_image_size"));
// Special content
setControlEnabled("Notes",!isLocked("notes"));
setControlEnabled("UseDublinCore",!isLocked("use_dublin_core"));
// AutoCorrect
setControlEnabled("IgnoreHardLineBreaks",!isLocked("ignore_hard_line_breaks"));
setControlEnabled("IgnoreEmptyParagraphs",!isLocked("ignore_empty_paragraphs"));
setControlEnabled("IgnoreDoubleSpaces",!isLocked("ignore_double_spaces"));
// Special content
setControlEnabled("Notes",!isLocked("notes"));
setControlEnabled("UseDublinCore",!isLocked("use_dublin_core"));
setControlEnabled("UseCustomMetadata",!isLocked("use_custom_metadata"));
// Document division
boolean bSplit = getCheckBoxStateAsBoolean("Split");
setControlEnabled("Split",!isLocked("split_level"));
@ -289,6 +304,43 @@ public class EpubOptionsDialog extends OptionsDialogBase {
setControlEnabled("DefaultFontName", bState);
}
}
private void editMetadataClick() {
// Get the DispatchHelper service
XMultiComponentFactory xMCF = xContext.getServiceManager();
XMultiServiceFactory xFactory = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xMCF);
Object dispatchHelper;
try {
dispatchHelper = xFactory.createInstance("com.sun.star.frame.DispatchHelper");
} catch (Exception e) {
// Failed to get dispatch helper, cannot execute dispatch
System.out.println("Failed to get dispatch helper");
return;
}
XDispatchHelper helper = (XDispatchHelper) UnoRuntime.queryInterface(XDispatchHelper.class, dispatchHelper);
// Get the current frame
Object desktop;
try {
desktop = xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", xContext);
} catch (Exception e) {
// Failed to get desktop
System.out.println("Failed to get desktop");
return;
}
XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class, desktop);
XFrame xFrame =xDesktop.getCurrentFrame();
// Get the DispatchProvider for the current frame
XDispatchProvider xDispatchProvider = (XDispatchProvider)UnoRuntime.queryInterface(XDispatchProvider.class, xFrame);
PropertyValue[] props = new PropertyValue[0];
helper.executeDispatch(xDispatchProvider, ".uno:SetDocumentProperties","", 0, props);
}
private void editCustomMetadataClick() {
// Stub, TODO
System.out.println("Edit custom metadata");
}
private void splitChange() {
if (!isLocked("split_level")) {

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2011-02-14)
* Version 1.2 (2011-02-20)
*
*/
@ -32,8 +32,8 @@ package writer2latex.api;
public class ConverterFactory {
// Version information
private static final String VERSION = "1.1.6";
private static final String DATE = "2011-02-14";
private static final String VERSION = "1.1.7";
private static final String DATE = "2011-02-20";
/** 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-12-21)
* Version 1.2 (2011-02-19)
*
*/
@ -97,7 +97,7 @@ public abstract class ConverterBase implements Converter {
odDoc.read(is);
ofr = new OfficeReader(odDoc,false);
metaData = new MetaData(odDoc);
imageLoader = new ImageLoader(odDoc,sTargetFileName,true);
imageLoader = new ImageLoader(odDoc,true);
imageLoader.setGraphicConverter(graphicConverter);
// Prepare output

View file

@ -45,7 +45,7 @@ public final class EPUBConverter extends Xhtml11Converter {
@Override public ConverterResult convert(InputStream is, String sTargetFileName) throws IOException {
setOPS(true);
ConverterResult xhtmlResult = super.convert(is, sTargetFileName);
ConverterResult xhtmlResult = super.convert(is, "chapter");
ConverterResultImpl epubResult = new ConverterResultImpl();
epubResult.addDocument(new EPUBWriter(xhtmlResult,sTargetFileName,getXhtmlConfig()));

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2001-2010 by Henrik Just
* Copyright: 2001-2011 by Henrik Just
*
* All Rights Reserved.
*
* version 1.2 (2010-12-20)
* version 1.2 (2011-02-17)
*
*/
@ -89,7 +89,7 @@ public class EPUBWriter implements OutputFile {
zos.closeEntry();
// Then manifest
OPFWriter manifest = new OPFWriter(xhtmlResult, config.xhtmlUseDublinCore());
OPFWriter manifest = new OPFWriter(xhtmlResult, config.xhtmlUseDublinCore(), config.useCustomMetadata());
ZipEntry manifestEntry = new ZipEntry("OEBPS/book.opf");
zos.putNextEntry(manifestEntry);
writeZipEntry(manifest,zos);

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2001-2010 by Henrik Just
* Copyright: 2001-2011 by Henrik Just
*
* All Rights Reserved.
*
* version 1.2 (2010-12-20)
* version 1.2 (2011-02-17)
*
*/
@ -51,7 +51,7 @@ import writer2latex.xmerge.NewDOMDocument;
public class OPFWriter extends NewDOMDocument {
private String sUID=null;
public OPFWriter(ConverterResult cr, boolean bUseDublinCore) {
public OPFWriter(ConverterResult cr, boolean bUseDublinCore, boolean bUseCustomMetadata) {
super("book", "opf");
// create DOM
@ -108,84 +108,86 @@ public class OPFWriter extends NewDOMDocument {
boolean bHasIdentifier = false;
boolean bHasCreator = false;
boolean bHasDate = false;
// First rearrange the user-defined meta data
Map<String,String> userDefinedMetaData = cr.getMetaData().getUserDefinedMetaData();
Map<String,String[]> dc = new HashMap<String,String[]>();
for (String sKey : userDefinedMetaData.keySet()) {
if (sKey.length()>0) {
String[] sValue = new String[2];
sValue[0] = userDefinedMetaData.get(sKey);
String sNewKey;
int nDot = sKey.indexOf(".");
if (nDot>0) {
sNewKey = sKey.substring(0, nDot).toLowerCase();
sValue[1] = sKey.substring(nDot+1);
}
else {
sNewKey = sKey.toLowerCase();
sValue[1] = null;
}
dc.put(sNewKey, sValue);
}
}
// Then export it
String[] sKeys = Misc.sortStringSet(dc.keySet());
for (String sKey : sKeys) {
String sValue = dc.get(sKey)[0];
String sAttributeValue = dc.get(sKey)[1];
if (sKey.startsWith("identifier")) {
Element identifier = appendElement(contentDOM, metadata, "dc:identifier", sValue);
if (!bHasIdentifier) { // The first identifier is the unique ID
identifier.setAttribute("id", "BookId");
sUID = sValue;
}
if (sAttributeValue!=null) {
identifier.setAttribute("opf:scheme", sAttributeValue);
}
bHasIdentifier = true;
}
else if (sKey.startsWith("creator")) {
Element creator = appendElement(contentDOM, metadata, "dc:creator", sValue);
if (sAttributeValue!=null) {
creator.setAttribute("opf:role", sAttributeValue);
}
bHasCreator = true;
}
else if (sKey.startsWith("contributor")) {
Element contributor = appendElement(contentDOM, metadata, "dc:contributor", sValue);
if (sAttributeValue!=null) {
contributor.setAttribute("opf:role", sAttributeValue);
if (bUseCustomMetadata) {
// First rearrange the user-defined meta data
Map<String,String> userDefinedMetaData = cr.getMetaData().getUserDefinedMetaData();
Map<String,String[]> dc = new HashMap<String,String[]>();
for (String sKey : userDefinedMetaData.keySet()) {
if (sKey.length()>0) {
String[] sValue = new String[2];
sValue[0] = userDefinedMetaData.get(sKey);
String sNewKey;
int nDot = sKey.indexOf(".");
if (nDot>0) {
sNewKey = sKey.substring(0, nDot).toLowerCase();
sValue[1] = sKey.substring(nDot+1);
}
else {
sNewKey = sKey.toLowerCase();
sValue[1] = null;
}
dc.put(sNewKey, sValue);
}
}
else if (sKey.startsWith("date")) {
Element date = appendElement(contentDOM, metadata, "dc:date", sValue);
if (sAttributeValue!=null) {
date.setAttribute("opf:event", sAttributeValue);
// Then export it
String[] sKeys = Misc.sortStringSet(dc.keySet());
for (String sKey : sKeys) {
String sValue = dc.get(sKey)[0];
String sAttributeValue = dc.get(sKey)[1];
if (sKey.startsWith("identifier")) {
Element identifier = appendElement(contentDOM, metadata, "dc:identifier", sValue);
if (!bHasIdentifier) { // The first identifier is the unique ID
identifier.setAttribute("id", "BookId");
sUID = sValue;
}
if (sAttributeValue!=null) {
identifier.setAttribute("opf:scheme", sAttributeValue);
}
bHasIdentifier = true;
}
bHasDate = true;
}
// Remaining properties must be unique and has not attributes, hence
else if (sAttributeValue==null) {
if ("publisher".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:publisher", sValue);
else if (sKey.startsWith("creator")) {
Element creator = appendElement(contentDOM, metadata, "dc:creator", sValue);
if (sAttributeValue!=null) {
creator.setAttribute("opf:role", sAttributeValue);
}
bHasCreator = true;
}
else if ("type".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:type", sValue);
else if (sKey.startsWith("contributor")) {
Element contributor = appendElement(contentDOM, metadata, "dc:contributor", sValue);
if (sAttributeValue!=null) {
contributor.setAttribute("opf:role", sAttributeValue);
}
}
else if ("format".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:format", sValue);
else if (sKey.startsWith("date")) {
Element date = appendElement(contentDOM, metadata, "dc:date", sValue);
if (sAttributeValue!=null) {
date.setAttribute("opf:event", sAttributeValue);
}
bHasDate = true;
}
else if ("source".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:source", sValue);
}
else if ("relation".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:relation", sValue);
}
else if ("coverage".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:coverage", sValue);
}
else if ("rights".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:rights", sValue);
// Remaining properties must be unique and has not attributes, hence
else if (sAttributeValue==null) {
if ("publisher".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:publisher", sValue);
}
else if ("type".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:type", sValue);
}
else if ("format".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:format", sValue);
}
else if ("source".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:source", sValue);
}
else if ("relation".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:relation", sValue);
}
else if ("coverage".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:coverage", sValue);
}
else if ("rights".equals(sKey)) {
appendElement(contentDOM, metadata, "dc:rights", sValue);
}
}
}
}

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-11-21)
* Version 1.2 (2011-02-19)
*
*/
@ -124,9 +124,11 @@ public final class ConverterPalette extends ConverterBase {
// fill out inner converter method
public void convertInner() throws IOException {
sTargetFileName = Misc.trimDocumentName(sTargetFileName,".tex");
imageLoader.setOutFileName(new ExportNameCollection(true).getExportName(sTargetFileName));
imageLoader.setUseSubdir(config.saveImagesInSubdir());
String sSafeTargetFileName = new ExportNameCollection(true).getExportName(sTargetFileName);
imageLoader.setBaseFileName(sSafeTargetFileName+"-img");
if (config.saveImagesInSubdir()) {
imageLoader.setUseSubdir(sSafeTargetFileName+"-img");
}
// Set graphics formats depending on backend
if (config.getBackend()==LaTeXConfig.PDFTEX || config.getBackend()==LaTeXConfig.XETEX) {

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2009 by Henrik Just
* Copyright: 2002-2011 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.2 (2009-12-07)
* Version 1.2 (2011-02-19)
*
*/
@ -55,8 +55,8 @@ public final class ImageLoader {
private OfficeDocument oooDoc;
// Data for file name generation
private String sOutFileName;
private boolean bUseSubdir = false;
private String sBaseFileName = "";
private String sSubDirName = "";
private int nImageCount = 0;
private NumberFormat formatter;
@ -70,17 +70,16 @@ public final class ImageLoader {
private String sDefaultVectorFormat = null;
private HashSet<String> acceptedFormats = new HashSet<String>();
public ImageLoader(OfficeDocument oooDoc, String sOutFileName, boolean bExtractEPS) {
public ImageLoader(OfficeDocument oooDoc, boolean bExtractEPS) {
this.oooDoc = oooDoc;
this.sOutFileName = sOutFileName;
this.bExtractEPS = bExtractEPS;
this.formatter = new DecimalFormat("000");
}
public void setOutFileName(String sOutFileName) { this.sOutFileName = sOutFileName; }
public void setBaseFileName(String sBaseFileName) { this.sBaseFileName = sBaseFileName; }
public void setUseSubdir(String sSubDirName) { this.sSubDirName = sSubDirName+"/"; }
public void setUseSubdir(boolean bUseSubdir) { this.bUseSubdir = bUseSubdir; }
public void setAcceptOtherFormats(boolean b) { bAcceptOtherFormats = b; }
public void setDefaultFormat(String sMime) {
@ -146,8 +145,7 @@ public final class ImageLoader {
if (blob==null) { return null; }
// Assign a name (without extension)
String sName = sOutFileName+"-img"+formatter.format(++nImageCount);
if (bUseSubdir) { sName = sOutFileName + "-img/" + sName; }
String sName = sSubDirName+sBaseFileName+formatter.format(++nImageCount);
BinaryGraphicsDocument bgd = null;

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-12-21)
* Version 1.2 (2011-02-19)
*
*/
@ -60,7 +60,7 @@ import writer2latex.util.ExportNameCollection;
import writer2latex.util.Misc;
/**
* <p>This class converts an OpenDocument file to an XHTML(+MathML) document.</p>
* <p>This class converts an OpenDocument file to an XHTML(+MathML) or EPUB document.</p>
*
*/
public class Converter extends ConverterBase {
@ -87,7 +87,7 @@ public class Converter extends ConverterBase {
// The included style sheet and associated resources
private CssDocument styleSheet = null;
private Set<ResourceDocument> resources = new HashSet<ResourceDocument>();
// The xhtml output file(s)
protected int nType = XhtmlDocument.XHTML10; // the doctype
private boolean bOPS = false; // Do we need to be OPS conforming?
@ -124,7 +124,7 @@ public class Converter extends ConverterBase {
@Override public void readStyleSheet(InputStream is) throws IOException {
if (styleSheet==null) {
styleSheet = new CssDocument("styles.css");
styleSheet = new CssDocument("styles/styles.css");
}
styleSheet.read(is);
}
@ -201,7 +201,16 @@ public class Converter extends ConverterBase {
l10n = new L10n();
imageLoader.setUseSubdir(config.saveImagesInSubdir());
if (isOPS()) {
imageLoader.setBaseFileName("image");
imageLoader.setUseSubdir("images");
}
else {
imageLoader.setBaseFileName(sTargetFileName+"-img");
if (config.saveImagesInSubdir()) {
imageLoader.setUseSubdir(sTargetFileName+"-img");
}
}
imageLoader.setDefaultFormat(MIMETypes.PNG);
imageLoader.addAcceptedFormat(MIMETypes.JPEG);
@ -272,13 +281,15 @@ public class Converter extends ConverterBase {
}
}
// Export styles (temp.)
for (int i=0; i<=nOutFileIndex; i++) {
Element head = outFiles.get(i).getHeadNode();
if (head!=null) {
Node styles = styleCv.exportStyles(outFiles.get(i).getContentDOM());
if (styles!=null) {
head.appendChild(styles);
// Export styles (XHTML)
if (!isOPS()) {
for (int i=0; i<=nOutFileIndex; i++) {
Element head = outFiles.get(i).getHeadNode();
if (head!=null) {
Node styles = styleCv.exportStyles(outFiles.get(i).getContentDOM());
if (styles!=null) {
head.appendChild(styles);
}
}
}
}
@ -407,6 +418,12 @@ public class Converter extends ConverterBase {
}
}
// Export styles (EPUB)
if (isOPS()) {
CssDocument cssDoc = new CssDocument("styles/styles1.css");
cssDoc.read(styleCv.exportStyles(false));
converterResult.addDocument(cssDoc);
}
}
private void addNavigationLink(Document dom, Node node, String s, int nIndex) {
@ -617,7 +634,7 @@ public class Converter extends ConverterBase {
}
}
// Add link to stylesheet, if producing nomral XHTML
// Add link to custom stylesheet, if producing normal XHTML
if (!bOPS && config.xhtmlCustomStylesheet().length()>0) {
Element htmlStyle = htmlDOM.createElement("link");
htmlStyle.setAttribute("rel","stylesheet");
@ -626,26 +643,28 @@ public class Converter extends ConverterBase {
htmlStyle.setAttribute("href",config.xhtmlCustomStylesheet());
head.appendChild(htmlStyle);
}
/* later....
if (nSplit>0 && !config.xhtmlIgnoreStyles()) {
Element htmlStyle = htmlDOM.createElement("link");
htmlStyle.setAttribute("rel","stylesheet");
htmlStyle.setAttribute("type","text/css");
htmlStyle.setAttribute("media","all");
htmlStyle.setAttribute("href",oooDoc.getName()+"-styles.css");
htmlHead.appendChild(htmlStyle);
}*/
// Note: For single output file, styles are exported to the doc at the end.
// Add link to included style sheet if producing OPS content
if (bOPS && styleSheet!=null) {
Element sty = htmlDOM.createElement("link");
sty.setAttribute("rel", "stylesheet");
sty.setAttribute("type", "text/css");
sty.setAttribute("media", "all");
sty.setAttribute("href", styleSheet.getFileName());
sty.setAttribute("href", "stylesheet/"+styleSheet.getFileName());
head.appendChild(sty);
}
// Add link to generated stylesheet if producing OPS content
if (isOPS() && config.xhtmlFormatting()>XhtmlConfig.IGNORE_STYLES) {
Element htmlStyle = htmlDOM.createElement("link");
htmlStyle.setAttribute("rel","stylesheet");
htmlStyle.setAttribute("type","text/css");
htmlStyle.setAttribute("media","all");
htmlStyle.setAttribute("href","styles/styles1.css");
head.appendChild(htmlStyle);
}
// Note: For XHTML, generated styles are exported to the doc at the end.
}
// Recreate nested sections, if any

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-12)
* Version 1.2 (2011-02-17)
*
*/
@ -82,6 +82,10 @@ public class CssDocument implements OutputFile {
}
sContent = buf.toString();
}
public void read(String s) {
sContent = 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-12-29)
* Version 1.2 (2011-02-17)
*
*/
@ -121,11 +121,10 @@ class StyleConverter extends ConverterHelper {
applyStyle(info,node);
}
}
// Export used styles to CSS
public Node exportStyles(Document htmlDOM) {
String sIndent = config.prettyPrint() ? " " : "";
public String exportStyles(boolean bIndent) {
String sIndent = bIndent ? " " : "";
StringBuffer buf = new StringBuffer();
// Export default style
@ -163,21 +162,26 @@ class StyleConverter extends ConverterHelper {
buf.append(getFrameSc().getStyleDeclarations(sIndent));
buf.append(getPresentationSc().getStyleDeclarations(sIndent));
buf.append(getPageSc().getStyleDeclarations(sIndent));
return buf.toString();
}
// Export used styles to CSS
public Node exportStyles(Document htmlDOM) {
String sStyles = exportStyles(config.prettyPrint());
// Create node
if (buf.length()>0) {
if (sStyles.length()>0) {
Element htmlStyle = htmlDOM.createElement("style");
htmlStyle.setAttribute("media","all");
htmlStyle.setAttribute("type","text/css");
htmlStyle.appendChild(htmlDOM.createTextNode(config.prettyPrint() ? "\n" : " "));
htmlStyle.appendChild(htmlDOM.createTextNode(buf.toString()));
htmlStyle.appendChild(htmlDOM.createTextNode(sStyles));
if (config.prettyPrint()) { htmlStyle.appendChild(htmlDOM.createTextNode(" ")); }
return htmlStyle;
}
else {
return null;
}
}
}

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-12-28)
* Version 1.2 (2011-02-17)
*
*/
@ -41,7 +41,7 @@ import writer2latex.util.Misc;
public class XhtmlConfig extends writer2latex.base.ConfigBase {
// Implement configuration methods
protected int getOptionCount() { return 53; }
protected int getOptionCount() { return 54; }
protected String getDefaultConfigPath() { return "/writer2latex/xhtml/config/"; }
// Override setOption: To be backwards compatible, we must accept options
@ -106,36 +106,37 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
private static final int USE_DEFAULT_FONT = 20;
private static final int DEFAULT_FONT_NAME = 21;
private static final int USE_DUBLIN_CORE = 22;
private static final int NOTES = 23;
private static final int DISPLAY_HIDDEN_TEXT = 24;
private static final int CONVERT_TO_PX = 25;
private static final int SCALING = 26;
private static final int COLUMN_SCALING = 27;
private static final int RELATIVE_FONT_SIZE = 28;
private static final int FONT_SCALING = 29;
private static final int FLOAT_OBJECTS = 30;
private static final int TABSTOP_STYLE = 31;
private static final int FORMULAS = 32;
private static final int ENDNOTES_HEADING = 33;
private static final int EXTERNAL_TOC_DEPTH = 34;
private static final int INCLUDE_TOC = 35;
private static final int SPLIT_LEVEL = 36;
private static final int REPEAT_LEVELS = 37;
private static final int PAGE_BREAK_SPLIT = 38;
private static final int SPLIT_AFTER = 39;
private static final int CALC_SPLIT = 40;
private static final int DISPLAY_HIDDEN_SHEETS = 41;
private static final int DISPLAY_HIDDEN_ROWS_COLS = 42;
private static final int DISPLAY_FILTERED_ROWS_COLS = 43;
private static final int APPLY_PRINT_RANGES = 44;
private static final int USE_TITLE_AS_HEADING = 45;
private static final int USE_SHEET_NAMES_AS_HEADINGS = 46;
private static final int XSLT_PATH = 47;
private static final int SAVE_IMAGES_IN_SUBDIR = 48;
private static final int UPLINK = 49;
private static final int DIRECTORY_ICON = 50;
private static final int DOCUMENT_ICON = 51;
private static final int ZEN_HACK = 52; // temporary hack for ePub Zen Garden styles
private static final int USE_CUSTOM_METADATA = 23;
private static final int NOTES = 24;
private static final int DISPLAY_HIDDEN_TEXT = 25;
private static final int CONVERT_TO_PX = 26;
private static final int SCALING = 27;
private static final int COLUMN_SCALING = 28;
private static final int RELATIVE_FONT_SIZE = 29;
private static final int FONT_SCALING = 30;
private static final int FLOAT_OBJECTS = 31;
private static final int TABSTOP_STYLE = 32;
private static final int FORMULAS = 33;
private static final int ENDNOTES_HEADING = 34;
private static final int EXTERNAL_TOC_DEPTH = 35;
private static final int INCLUDE_TOC = 36;
private static final int SPLIT_LEVEL = 37;
private static final int REPEAT_LEVELS = 38;
private static final int PAGE_BREAK_SPLIT = 39;
private static final int SPLIT_AFTER = 40;
private static final int CALC_SPLIT = 41;
private static final int DISPLAY_HIDDEN_SHEETS = 42;
private static final int DISPLAY_HIDDEN_ROWS_COLS = 43;
private static final int DISPLAY_FILTERED_ROWS_COLS = 44;
private static final int APPLY_PRINT_RANGES = 45;
private static final int USE_TITLE_AS_HEADING = 46;
private static final int USE_SHEET_NAMES_AS_HEADINGS = 47;
private static final int XSLT_PATH = 48;
private static final int SAVE_IMAGES_IN_SUBDIR = 49;
private static final int UPLINK = 50;
private static final int DIRECTORY_ICON = 51;
private static final int DOCUMENT_ICON = 52;
private static final int ZEN_HACK = 53; // temporary hack for ePub Zen Garden styles
protected ComplexOption xheading = addComplexOption("heading-map");
protected ComplexOption xpar = addComplexOption("paragraph-map");
@ -174,9 +175,10 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
else { nValue = CSS1; }
}
};
options[USE_DEFAULT_FONT] = new BooleanOption("use_default_font","true");
options[USE_DEFAULT_FONT] = new BooleanOption("use_default_font","false");
options[DEFAULT_FONT_NAME] = new BooleanOption("default_font_name","");
options[USE_DUBLIN_CORE] = new BooleanOption("use_dublin_core","true");
options[USE_CUSTOM_METADATA] = new BooleanOption("use_custom_metadata","true");
options[NOTES] = new BooleanOption("notes","true");
options[DISPLAY_HIDDEN_TEXT] = new BooleanOption("display_hidden_text", "false");
options[CONVERT_TO_PX] = new BooleanOption("convert_to_px","true");
@ -187,7 +189,7 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
options[FLOAT_OBJECTS] = new BooleanOption("float_objects","true");
options[TABSTOP_STYLE] = new Option("tabstop_style","");
options[ENDNOTES_HEADING] = new Option("endnotes_heading","");
options[FORMULAS] = new IntegerOption("formulas","starmath") {
options[FORMULAS] = new IntegerOption("formulas","image+starmath") {
@Override public void setString(String sValue) {
super.setString(sValue);
if ("latex".equals(sValue)) { nValue = LATEX; }
@ -341,6 +343,7 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
public boolean useDefaultFont() { return ((BooleanOption) options[USE_DEFAULT_FONT]).getValue(); }
public String defaultFontName() { return options[DEFAULT_FONT_NAME].getString(); }
public boolean xhtmlUseDublinCore() { return ((BooleanOption) options[USE_DUBLIN_CORE]).getValue(); }
public boolean useCustomMetadata() { return ((BooleanOption) options[USE_CUSTOM_METADATA]).getValue(); }
public boolean xhtmlNotes() { return ((BooleanOption) options[NOTES]).getValue(); }
public boolean displayHiddenText() { return ((BooleanOption) options[DISPLAY_HIDDEN_TEXT]).getValue(); }
public boolean xhtmlConvertToPx() { return ((BooleanOption) options[CONVERT_TO_PX]).getValue(); }

View file

@ -5,7 +5,7 @@
<identifier value="org.openoffice.da.writer2latex.oxt"/>
<version value="1.1.6" />
<version value="1.1.7" />
<dependencies>
<OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0"/>

View file

@ -62,14 +62,15 @@
<prop oor:name="DefaultFontName" oor:type="xs:string" />
<prop oor:name="ConvertToPx" oor:type="xs:boolean" />
<prop oor:name="OriginalImageSize" oor:type="xs:boolean"/>
<!-- Special content -->
<prop oor:name="DisplayHiddenText" oor:type="xs:boolean" />
<prop oor:name="Notes" oor:type="xs:boolean" />
<prop oor:name="UseDublinCore" oor:type="xs:boolean" />
<!-- AutoCorrect -->
<prop oor:name="IgnoreEmptyParagraphs" oor:type="xs:boolean" />
<prop oor:name="IgnoreHardLineBreaks" oor:type="xs:boolean" />
<prop oor:name="IgnoreDoubleSpaces" oor:type="xs:boolean" />
<!-- Special content -->
<prop oor:name="DisplayHiddenText" oor:type="xs:boolean" />
<prop oor:name="Notes" oor:type="xs:boolean" />
<prop oor:name="UseDublinCore" oor:type="xs:boolean" />
<prop oor:name="UseCustomMetadata" oor:type="xs:boolean" />
<!-- Files -->
<prop oor:name="Split" oor:type="xs:boolean" />
<prop oor:name="SplitLevel" oor:type="xs:short" />

View file

@ -74,7 +74,7 @@
<value>false</value>
</prop>
<prop oor:name="RelativeFontSize" oor:type="xs:boolean">
<value>false</value>
<value>true</value>
</prop>
<prop oor:name="FontScaling" oor:type="xs:int">
<value>100</value>
@ -85,6 +85,15 @@
<prop oor:name="DefaultFontName" oor:type="xs:string">
<value></value>
</prop>
<prop oor:name="IgnoreEmptyParagraphs" oor:type="xs:boolean">
<value>false</value>
</prop>
<prop oor:name="IgnoreHardLineBreaks" oor:type="xs:boolean">
<value>false</value>
</prop>
<prop oor:name="IgnoreDoubleSpaces" oor:type="xs:boolean">
<value>false</value>
</prop>
<prop oor:name="DisplayHiddenText" oor:type="xs:boolean">
<value>false</value>
</prop>
@ -94,14 +103,8 @@
<prop oor:name="UseDublinCore" oor:type="xs:boolean">
<value>true</value>
</prop>
<prop oor:name="IgnoreEmptyParagraphs" oor:type="xs:boolean">
<value>false</value>
</prop>
<prop oor:name="IgnoreHardLineBreaks" oor:type="xs:boolean">
<value>false</value>
</prop>
<prop oor:name="IgnoreDoubleSpaces" oor:type="xs:boolean">
<value>false</value>
<prop oor:name="UseCustomMetadata" oor:type="xs:boolean">
<value>true</value>
</prop>
<prop oor:name="Split" oor:type="xs:boolean">
<value>false</value>

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="242" 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="256" 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,21 +16,21 @@
<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="31" 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:checkbox dlg:id="OriginalImageSize" dlg:tab-index="13" dlg:left="10" dlg:top="134" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsOriginalImageSize" dlg:value="Use original image size" dlg:checked="false"/>
<dlg:text dlg:id="SpecialContentLabel" dlg:tab-index="29" dlg:left="5" dlg:top="148" dlg:width="160" dlg:height="12" dlg:value="Special content"/>
<dlg:checkbox dlg:id="Notes" dlg:tab-index="15" dlg:left="10" dlg:top="176" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsNotes" dlg:value="Export notes" dlg:checked="true"/>
<dlg:checkbox dlg:id="UseDublinCore" dlg:tab-index="16" dlg:left="10" dlg:top="190" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseDublinCore" dlg:value="Export optional document properties" dlg:checked="true"/>
<dlg:text dlg:id="AutoCorrectLabel" dlg:tab-index="30" dlg:left="185" dlg:top="8" dlg:width="160" dlg:height="12" dlg:value="AutoCorrect"/>
<dlg:checkbox dlg:id="IgnoreHardLineBreaks" dlg:tab-index="17" dlg:left="190" dlg:top="22" 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="18" dlg:left="190" dlg:top="36" 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="19" dlg:left="190" dlg:top="50" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreDoubleSpaces" dlg:value="Ignore double spaces" dlg:checked="false"/>
<dlg:checkbox dlg:id="Split" dlg:tab-index="20" dlg:left="190" dlg:top="78" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsSplit" dlg:value="Split document at headings" dlg:checked="false">
<dlg:text dlg:id="SpecialContentLabel" dlg:tab-index="32" 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:checkbox dlg:id="UseDublinCore" dlg:tab-index="19" dlg:left="190" dlg:top="50" dlg:width="110" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseDublinCore" dlg:value="Export optional document properties" dlg:checked="true"/>
<dlg:text dlg:id="AutoCorrectLabel" dlg:tab-index="33" 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:checkbox dlg:id="Split" dlg:tab-index="23" dlg:left="190" dlg:top="92" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsSplit" dlg:value="Split document at headings" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:SplitChange" script:language="UNO"/>
</dlg:checkbox>
<dlg:text dlg:id="SplitLevelLabel" dlg:tab-index="32" dlg:left="199" dlg:top="92" dlg:width="100" dlg:height="12" dlg:value="Heading level"/>
<dlg:menulist dlg:id="SplitLevel" dlg:tab-index="21" dlg:left="305" dlg:top="90" dlg:width="40" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsSplitLevel" dlg:spin="true" dlg:linecount="6">
<dlg:text dlg:id="SplitLevelLabel" dlg:tab-index="35" dlg:left="199" dlg:top="106" dlg:width="100" dlg:height="12" dlg:value="Heading level"/>
<dlg:menulist dlg:id="SplitLevel" dlg:tab-index="24" dlg:left="305" dlg:top="104" dlg:width="40" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsSplitLevel" dlg:spin="true" dlg:linecount="6">
<dlg:menupopup>
<dlg:menuitem dlg:value="1"/>
<dlg:menuitem dlg:value="2"/>
@ -40,41 +40,41 @@
<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="193" 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:value="Use relative font size" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsRelativeFontSize" dlg:checked="true">
<dlg:button dlg:id="ExportButton" dlg:tab-index="36" 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="37" 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="38" dlg:left="290" dlg:top="230" 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="39" dlg:left="175" dlg:top="9" dlg:width="2" dlg:height="207" 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="40" 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:checkbox dlg:id="UseDefaultFont" dlg:tab-index="10" dlg:left="10" dlg:top="92" dlg:width="155" dlg:height="12" dlg:value="Use a single font for the entire document" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseDefaultFont" dlg:checked="false">
<dlg:text dlg:id="FontScalingPercentLabel" dlg:tab-index="41" 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="42" 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="14" dlg:left="10" dlg:top="162" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsDisplayHiddenText" dlg:value="Display hidden text" dlg:checked="false"/>
<dlg:checkbox dlg:id="UsePageBreakSplit" dlg:tab-index="22" dlg:left="190" dlg:top="106" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsPageBreakSplit" dlg:value="Split document at page breaks" dlg:checked="false">
<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:checkbox dlg:id="UsePageBreakSplit" dlg:tab-index="25" dlg:left="190" dlg:top="120" dlg:width="155" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsPageBreakSplit" dlg:value="Split document at page breaks" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:UsePageBreakSplitChange" script:language="UNO"/>
</dlg:checkbox>
<dlg:text dlg:id="PageBreakSplitLabel" dlg:tab-index="40" dlg:left="199" dlg:top="120" dlg:width="45" dlg:height="12" dlg:value="Types"/>
<dlg:menulist dlg:id="PageBreakSplit" dlg:tab-index="23" dlg:left="255" dlg:top="118" dlg:width="90" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsPageBreakSplitType" dlg:spin="true" dlg:linecount="3">
<dlg:text dlg:id="PageBreakSplitLabel" dlg:tab-index="43" dlg:left="199" dlg:top="134" dlg:width="45" dlg:height="12" dlg:value="Types"/>
<dlg:menulist dlg:id="PageBreakSplit" dlg:tab-index="26" dlg:left="255" dlg:top="132" dlg:width="90" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsPageBreakSplitType" dlg:spin="true" dlg:linecount="3">
<dlg:menupopup>
<dlg:menuitem dlg:value="Defined by styles"/>
<dlg:menuitem dlg:value="All explicit"/>
<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="30" 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="27" 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="100" dlg:height="12" dlg:value="After (in 1000 characters)"/>
<dlg:numericfield dlg:id="SplitAfter" dlg:tab-index="25" dlg:left="305" dlg:top="146" dlg:width="40" 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="110" dlg:height="12" dlg:value="Number of heading levels to include"/>
<dlg:menulist dlg:id="ExternalTocDepth" dlg:tab-index="26" dlg:left="305" dlg:top="174" dlg:width="40" 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="44" dlg:left="199" dlg:top="162" dlg:width="100" dlg:height="12" dlg:value="After (in 1000 characters)"/>
<dlg:numericfield dlg:id="SplitAfter" dlg:tab-index="28" dlg:left="305" dlg:top="160" dlg:width="40" 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="45" dlg:left="190" dlg:top="190" dlg:width="110" dlg:height="12" dlg:value="Number of heading levels to include"/>
<dlg:menulist dlg:id="ExternalTocDepth" dlg:tab-index="29" dlg:left="305" dlg:top="188" dlg:width="40" 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"/>
@ -88,7 +88,14 @@
<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:text dlg:id="TocLabel" dlg:tab-index="46" dlg:left="185" dlg:top="176" dlg:width="160" dlg:height="12" dlg:value="Navigation table"/>
<dlg:text dlg:id="DocumentDivisionLabel" dlg:tab-index="34" dlg:left="185" dlg:top="78" dlg:width="160" dlg:height="12" dlg:value="Document division"/>
<dlg:checkbox dlg:id="UseCustomMetadata" dlg:tab-index="21" dlg:left="190" dlg:top="64" dlg:width="110" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseCustomMetadata" dlg:value="Export custom document properties" dlg:checked="true"/>
<dlg:button dlg:id="EditMetadata" dlg:tab-index="20" dlg:left="305" dlg:top="48" dlg:width="40" dlg:height="12" dlg:value="Edit" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseCustomMetadata">
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:EditMetadataClick" script:language="UNO"/>
</dlg:button>
<dlg:button dlg:id="EditCustomMetadata" dlg:tab-index="22" dlg:left="305" dlg:top="62" dlg:width="40" dlg:height="12" dlg:value="Edit" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseMetadata" >
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:EditCustomMetadataClick" script:language="UNO"/>
</dlg:button>
</dlg:bulletinboard>
</dlg:window>

View file

@ -5,7 +5,7 @@
<identifier value="org.openoffice.da.writer2xhtml.oxt" />
<version value="1.1.6" />
<version value="1.1.7" />
<dependencies>
<OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0"/>

View file

@ -85,6 +85,23 @@
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2xhtml.oxt:EpubOptionsOriginalImageSize" visibility="hidden">Check this to use the natural size of images rather than the size defined in the document</ahelp></paragraph>
<embed href="org.openoffice.da.writer2xhtml.oxt/export.xhp#originalimagesize"/>
<paragraph role="heading" level="2" xml-lang="en-US">AutoCorrect</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreHardLineBreaks" id="bm_options_ignorehardlinebreaks"/>
<paragraph role="heading" level="3" xml-lang="en-US">Ignore hard line breaks</paragraph>
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreHardLineBreaks" visibility="hidden">Check this if you don't want to export hard (manual) line breaks</ahelp></paragraph>
<paragraph role="paragraph" xml-lang="en-US">Sometimes hard (or manual) line breaks are used in Writer to optimize
the placement of the line breaks. Since line breaking in an EPUB reader is completely different, you may want to ignore
all hard line breaks by selecting this option.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreEmptyParagraphs" id="bm_options_ignoreemptyparagraphs"/>
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreEmptyParagraphs" visibility="hidden">Check this if you don't want to export empty paragraphs</ahelp></paragraph>
<embed href="org.openoffice.da.writer2xhtml.oxt/export.xhp#ignoreemptyparagraphs"/>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreDoubleSpaces" id="bm_options_ignoredoublespaces"/>
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreDoubleSpaces" visibility="hidden">Check this to treat several spaces as a single space in the export</ahelp></paragraph>
<embed href="org.openoffice.da.writer2xhtml.oxt/export.xhp#ignoredoublespaces"/>
<embed href="org.openoffice.da.writer2xhtml.oxt/export.xhp#special"/>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsDisplayHiddenText" id="bm_options_displayhiddentext"/>
@ -105,26 +122,15 @@
<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">The EPUB format supports a number of additional meta data elements.
You can define these using <link href="#custommetadata" name="EPUB">user-defined properties</link>.
</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">AutoCorrect</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreHardLineBreaks" id="bm_options_ignorehardlinebreaks"/>
<paragraph role="heading" level="3" xml-lang="en-US">Ignore hard line breaks</paragraph>
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreHardLineBreaks" visibility="hidden">Check this if you don't want to export hard (manual) line breaks</ahelp></paragraph>
<paragraph role="paragraph" xml-lang="en-US">Sometimes hard (or manual) line breaks are used in Writer to optimize
the placement of the line breaks. Since line breaking in an EPUB reader is completely different, you may want to ignore
all hard line breaks by selecting this option.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreEmptyParagraphs" id="bm_options_ignoreemptyparagraphs"/>
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreEmptyParagraphs" visibility="hidden">Check this if you don't want to export empty paragraphs</ahelp></paragraph>
<embed href="org.openoffice.da.writer2xhtml.oxt/export.xhp#ignoreemptyparagraphs"/>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreDoubleSpaces" id="bm_options_ignoredoublespaces"/>
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2xhtml.oxt:EpubOptionsIgnoreDoubleSpaces" visibility="hidden">Check this to treat several spaces as a single space in the export</ahelp></paragraph>
<embed href="org.openoffice.da.writer2xhtml.oxt/export.xhp#ignoredoublespaces"/>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseCustomMetadata" id="bm_options_usecustommetadata"/>
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2xhtml.oxt:EpubOptionsUseCustomMetadata" visibility="hidden">Check this if you want to export custom document properties</ahelp></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US">Export custom document properties</paragraph>
<paragraph role="paragraph" xml-lang="en-US">The EPUB format supports a number of additional document properties, which can be
defined using custom document properties in %PRODUCTNAME Writer.</paragraph>
<paragraph role="paragraph" xml-lang="en-US">If you select this option, these properties will be exported.</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Click <emph>Edit</emph> to edit the custom 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.

View file

@ -4,7 +4,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink">
<identifier value="org.openoffice.da.writer4latex.oxt" />
<version value="1.1.6" />
<version value="1.1.7" />
<dependencies>
<OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0"/>
</dependencies>

View file

@ -2,5 +2,5 @@
<description xmlns="http://openoffice.org/extensions/description/2006"
xmlns:d="http://openoffice.org/extensions/description/2006">
<identifier value="org.openoffice.da.writer2latex.xhtml-config-sample.oxt" />
<version value="1.1.6" />
<version value="1.1.7" />
</description>