Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Writer2ePub

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 02-24-2010, 09:20 AM   #31
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
I just asked for help to an Ubuntu forum. I got this reply some minutes ago:

Si le programmeur est francophone, il lui suffit de s'abonner à la liste prog@fr.openoffice.org (voir : http://fr.openoffice.org/contact-forums.html) il y rencontrera des experts es-extensions.
Si le programmeur est anglophone, il peut s'abonner à dev@openoffice.org ou à users@extensions.openoffice.org


Hope this makes some sense for you. If you need help I can translate.
roger64 is offline  
Old 02-26-2010, 09:29 AM   #32
kiermel
Enthusiast
kiermel began at the beginning.
 
kiermel's Avatar
 
Posts: 43
Karma: 10
Join Date: Apr 2009
Location: Malaga - Spain
Device: Kindle Touch, iPad, iPhone
Luke. When you release a new version. Can you update your first message of this thread with the new version?
Thanks
kiermel is offline  
Old 03-02-2010, 02:57 AM   #33
Guns4Hire
Reading...Since 1970
Guns4Hire knows the square root of minus one.Guns4Hire knows the square root of minus one.Guns4Hire knows the square root of minus one.Guns4Hire knows the square root of minus one.Guns4Hire knows the square root of minus one.Guns4Hire knows the square root of minus one.Guns4Hire knows the square root of minus one.Guns4Hire knows the square root of minus one.Guns4Hire knows the square root of minus one.Guns4Hire knows the square root of minus one.Guns4Hire knows the square root of minus one.
 
Guns4Hire's Avatar
 
Posts: 610
Karma: 7819
Join Date: Jan 2010
Device: Nova Air C, Nova Pro, LifebookMars, BoyueT62+ Glowlight, NST, PB360
http://translate.googleusercontent.c...QDgZ8JIY--XSdA
Guns4Hire is offline  
Old 03-02-2010, 03:50 AM   #34
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
installed version 0.2.1

I get the error msg below and OpenOffice hangs.
I unisntalled it for the time being.
Attached Thumbnails
Click image for larger version

Name:	msg.png
Views:	921
Size:	9.3 KB
ID:	46885  
roger64 is offline  
Old 03-02-2010, 07:59 AM   #35
eBookLuke
Writer2ePub creator
eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.
 
eBookLuke's Avatar
 
Posts: 354
Karma: 121129
Join Date: Sep 2009
Location: Genova, Italy
Device: Cybook Bebook iLiad Kindle HanlinV2 Readius SonyPRS500 SonyPRS700 etc
Quote:
Originally Posted by Guns4Hire View Post
Nice translation, thanks!

This blog is still in a development stage, the final version will be multilanguage.
Even the macro will be multilingual...

Luke
eBookLuke is offline  
Old 03-03-2010, 05:01 PM   #36
eBookLuke
Writer2ePub creator
eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.
 
eBookLuke's Avatar
 
Posts: 354
Karma: 121129
Join Date: Sep 2009
Location: Genova, Italy
Device: Cybook Bebook iLiad Kindle HanlinV2 Readius SonyPRS500 SonyPRS700 etc
Hi all,

You will find newest versions of my macros at this address:

http://luke.simplicissimus.it/?page_id=77

Luke
eBookLuke is offline  
Old 03-05-2010, 11:07 AM   #37
kiermel
Enthusiast
kiermel began at the beginning.
 
kiermel's Avatar
 
Posts: 43
Karma: 10
Join Date: Apr 2009
Location: Malaga - Spain
Device: Kindle Touch, iPad, iPhone
Quote:
Originally Posted by eBookLuke View Post
Hi all,

You will find newest versions of my macros at this address:

http://luke.simplicissimus.it/?page_id=77

Luke
What's new in 0.2.1?
Thanks
kiermel is offline  
Old 03-08-2010, 11:52 AM   #38
eBookLuke
Writer2ePub creator
eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.
 
eBookLuke's Avatar
 
Posts: 354
Karma: 121129
Join Date: Sep 2009
Location: Genova, Italy
Device: Cybook Bebook iLiad Kindle HanlinV2 Readius SonyPRS500 SonyPRS700 etc
Quote:
Originally Posted by kiermel View Post
What's new in 0.2.1?
0.1.10 uses a custom way to tag the content file. The output is quite clean. I suggest to use this version if you don't are a programmer.

0.2.1 uses a xslt transformation. Faster, but at the moment the output is not so clean, images are not supported and there are a lot of problems.
This is a test release to test a faster way to do the job, but I need a lot of time to create a working xslt (read "rule to tranform OOo docs in xhtml I like").

Luke
eBookLuke is offline  
Old 03-09-2010, 08:51 PM   #39
odt2epub
Member
odt2epub began at the beginning.
 
Posts: 14
Karma: 20
Join Date: Jan 2010
Location: Copenhagen, Denmark
Device: Sony PRS-505
Hey guys, we've just launched an online ODT > ePub conversion tool:
http://odt2epub.com
We hope it helps. Feedback appreciated.

ODT2ePub
odt2epub is offline  
Old 03-09-2010, 10:04 PM   #40
eBookLuke
Writer2ePub creator
eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.
 
eBookLuke's Avatar
 
Posts: 354
Karma: 121129
Join Date: Sep 2009
Location: Genova, Italy
Device: Cybook Bebook iLiad Kindle HanlinV2 Readius SonyPRS500 SonyPRS700 etc
Quote:
Originally Posted by odt2epub View Post
Hey guys, we've just launched an online ODT > ePub conversion tool:
http://odt2epub.com
We hope it helps. Feedback appreciated.
nice tool, good output. Not another "Calibre online" tool.
But not free.

Luke
eBookLuke is offline  
Old 03-09-2010, 11:43 PM   #41
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by eBookLuke View Post
Hi all,

You will find newest versions of my macros at this address:

http://luke.simplicissimus.it/?page_id=77

Luke
Place the above link and maybe the below explanation in the first post of this thread.

It is standard for any thread like this to provide the newest links/info in the first post and to keep that post updated for anyone stumbling across the thread. No one should have to stumble through pages trying to find the current version.

Quote:
Originally Posted by eBookLuke View Post
0.1.10 uses a custom way to tag the content file. The output is quite clean. I suggest to use this version if you don't are a programmer.

0.2.1 uses a xslt transformation. Faster, but at the moment the output is not so clean, images are not supported and there are a lot of problems.
This is a test release to test a faster way to do the job, but I need a lot of time to create a working xslt (read "rule to tranform OOo docs in xhtml I like").

Luke
Keep up the great work!
DoctorOhh is offline  
Old 03-12-2010, 03:40 PM   #42
eBookLuke
Writer2ePub creator
eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.eBookLuke knows the chase is better than the catch.
 
eBookLuke's Avatar
 
Posts: 354
Karma: 121129
Join Date: Sep 2009
Location: Genova, Italy
Device: Cybook Bebook iLiad Kindle HanlinV2 Readius SonyPRS500 SonyPRS700 etc
Translators wanted!

Hi all,

I need people to translate some simple sentences in:
French
German
Spanish
Dutch
Finnish
Japanese
Polish
Portuguese
Russian
Svedish

And English people to check my owful English

Luke

Last edited by eBookLuke; 03-12-2010 at 03:43 PM.
eBookLuke is offline  
Old 03-13-2010, 12:09 PM   #43
kiermel
Enthusiast
kiermel began at the beginning.
 
kiermel's Avatar
 
Posts: 43
Karma: 10
Join Date: Apr 2009
Location: Malaga - Spain
Device: Kindle Touch, iPad, iPhone
Unhappy

Quote:
Originally Posted by odt2epub View Post
Hey guys, we've just launched an online ODT > ePub conversion tool:
http://odt2epub.com
We hope it helps. Feedback appreciated.

ODT2ePub
It's not free

So, it's no usefull for me.
kiermel is offline  
Old 03-13-2010, 12:13 PM   #44
kiermel
Enthusiast
kiermel began at the beginning.
 
kiermel's Avatar
 
Posts: 43
Karma: 10
Join Date: Apr 2009
Location: Malaga - Spain
Device: Kindle Touch, iPad, iPhone
Quote:
Originally Posted by eBookLuke View Post
Hi all,

I need people to translate some simple sentences in:
French
German
Spanish
Dutch
Finnish
Japanese
Polish
Portuguese
Russian
Svedish

And English people to check my owful English

Luke
I just reply to your private message. I can translate to spanish, of course.
kiermel is offline  
Old 03-17-2010, 12:48 PM   #45
Logseman
Orisa
Logseman ought to be getting tired of karma fortunes by now.Logseman ought to be getting tired of karma fortunes by now.Logseman ought to be getting tired of karma fortunes by now.Logseman ought to be getting tired of karma fortunes by now.Logseman ought to be getting tired of karma fortunes by now.Logseman ought to be getting tired of karma fortunes by now.Logseman ought to be getting tired of karma fortunes by now.Logseman ought to be getting tired of karma fortunes by now.Logseman ought to be getting tired of karma fortunes by now.Logseman ought to be getting tired of karma fortunes by now.Logseman ought to be getting tired of karma fortunes by now.
 
Logseman's Avatar
 
Posts: 1,999
Karma: 1035571
Join Date: Feb 2010
Location: Ireland
Device: Onyx Poke 5
I can do the sentences part in German, if it's small, and check your English sentences. They can't be so awful :P

By the Way, I have had an error while working with an odt file.

I have received this error:


I will put here the generated code, I hope it helps:

Spoiler:
Code:
REM  *****  BASIC  *****
'______________________________________________________________________________
'	
'	Writer to ePub export by Luca Calcinai
'	
'	This extension is free software; you can redistribute it and/or
'	modify it under the terms of the GNU Lesser General Public
'	License as published by the Free Software Foundation.
'	
'	This library is distributed in the hope that it will be useful,
'	but WITHOUT ANY WARRANTY; without even the implied warranty of
'	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
'	Lesser General Public License for more details.
'	
'	Please email me with any bug reports, questions or comments:
'	luca.calcinai@simplicissimus.it
'
'	Many thanks to (in no particular order):
'	Paolo Mantovani, for his code, support and patience
'	Juda, for his constant support and his hawk's eye
'	Shinken, my ePub Master
'	Sbin, for her CSS
'	Roby, my xhtml consultant
'	Poxi1023, for his odt2pml code portions, widely used in this work
'	Andrew Pitonyak, for his "teachership"
'
'
'______________________________________________________________________________
'
'
' Declarations:

Option Explicit
	Public sDocURL As String			'
	Public sDocDir As String			'
	Public sFileExt As String			'
	Public sFileN As String
	Public MyEpub As String
	Public oDoc, fenDoc, oText as object
	Public myUUIDv4 as String
	Public iSplitCount as integer
	Public bDevelopment as Boolean
	Public sVersion as String
'==================================================================
'========================== MAIN ROUTINE ==========================	
'==================================================================

Sub writer2epubMain
	Dim StartTime, EndTime As Long
	Dim oBar As Object
	
	bDevelopment = true
	sVersion = "0.1.10"
	
	oDoc = ThisComponent

	if bDevelopment=false then 
		On Error GoTo ErrorHand
	end if
	
If NOT GlobalScope.BasicLibraries.isLibraryLoaded( "Tools" ) Then GlobalScope.BasicLibraries.loadLibrary( "Tools" ) 

	myUUIDv4 = UUIDv4()
	FilePrimer
		
	StartTime = Timer
	oBar = oDoc.CurrentController.getStatusIndicator()
	oBar.start ("Work in progress :       ", 100)
fenDoc = oDoc.CurrentController.Frame.ContainerWindow 
oDoc.lockControllers 
fenDoc.Enable = False 
	CreateFolderStructure(MyEpub)
	oBar.value = 20
iterateGraphics (MyEpub)
XSLTransform (MyEpub)
	oBar.value = 30
	CreateMimeTypeFile(MyEpub)
	oBar.value = 40
	CreateContainerFile(MyEpub)
	oBar.value = 50
'	CreateContentFile(MyEpub)
	oBar.value = 60
	CreateContentOpfFile(MyEpub)
	oBar.value = 70
	CreateTocFile(MyEpub)
	oBar.value = 80
	CreateCSSFile(MyEpub)
		oBar.value = 100
		oBar.end
		fenDoc.Enable = True 
		oDoc.unlockControllers 
	oDoc.Close (True)
'	CleanFiles (MyEpub)
	CreateEpub(MyEpub)
	EndTime = Timer
	
	oDoc = starDesktop.loadComponentFromUrl (sDocURL, "_blank", 0, Array())
'	oDoc = starDesktop.loadComponentFromUrl (sFileN & ".odt", "_blank", 0, Array())

	Beep
	


  	Msgbox "Epub Export Complete" & Chr(13) & Chr(13) & "(Time: " & EndTime - StartTime & " Second)"

'---- remove temp folder -----
if bDevelopment =false then	
	If FileExists(MyEpub) Then 
		RmDir MyEpub
	End If
end if

	
Exit Sub
	ErrorHand:
	ErrorHandler
End Sub


'==================================================================
'============================ END MAIN ============================
'==================================================================



Sub FilePrimer
	dim Args1(1) as new com.sun.star.beans.PropertyValue
'Before processing check save status 
	If oDoc.hasLocation=False Then 
		MsgBox ("Please save your text before processing!",16,"Writer2ePub") 
		End 
	End If
'save before processing! 
	If (oDoc.isModified) Then
		MsgBox ("Please save your text before processing!",16,"Writer2ePub")
		End	
'		oDoc.store() 
	End If 
	sDocURL = oDoc.getURL() 
	sDocDir=DirectoryNameoutofPath(sDocURL, "/") 
	sFileExt=GetFileNameExtension(sDocURL) 
	sFileN=GetFileNamewithoutExtension(sDocURL)      'with path! 
	MyEpub = sFileN

'REMOVE PREVIOSLY GENERATED FILE AND FOLDER
	
	If FileExists(MyEpub & ".epub") Then 
		Kill (MyEpub & ".epub")
	End If 
	
	If FileExists(MyEpub) Then 
		RmDir MyEpub
	End If

End Sub





Sub CreateFolderStructure (MyEpub as string)
	MkDir (MyEpub & "/META-INF")
	MkDir (MyEpub & "/OEBPS/text")
End Sub





Sub CreateMimeTypeFile (MyEpub as string)

'---- Create MIMETYPE file ----
	
	Dim content as string
	Dim fileAccessService, textOutputStream, outputStream as Object
	content = "application/epub+zip"
	fileAccessService = createUnoService("com.sun.star.ucb.SimpleFileAccess")
	textOutputStream = createUnoService("com.sun.star.io.TextOutputStream")
	
	outputStream = fileAccessService.openFileWrite(MyEpub + "/mimetype")		
	
	outputStream.truncate()
	textOutputStream.setOutputStream(outputStream)
	textOutputStream.writeString(content)
	textOutputStream.flush()
	textOutputStream.closeOutput()
	
End Sub





Sub CreateContainerFile (MyEpub as string)
'---- Create CONTAINER.XML file ----
	Open MyEpub + "/META-INF/container.xml" For Output As #1
	Print #1, "<?xml version=""1.0""?>"
	Print #1, "<container version=""1.0"" xmlns=""urn:oasis:names:tc:opendocument:xmlns:container"">"
	Print #1, "    <rootfiles>"
	Print #1, "        <rootfile full-path=""OEBPS/content.opf"" media-type=""application/oebps-package+xml""/>"
	Print #1, "   </rootfiles>"
	Print #1, "</container>"
	Close #1
End Sub





Sub CreateContentFile (MyEpub as string)

'---- Create CONTENT.XML file ----
	TextTagger
'	ExtractWriterGraphics(MyEpub)
	sbTraverseText
	XhtmlHeader


	dim document   as object
	dim dispatcher as object
	Dim sXfer as string

	
	document   = ThisComponent.CurrentController.Frame
	dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

	dim args1(1) as new com.sun.star.beans.PropertyValue
	args1(0).Name = "URL"
	args1(0).Value = MyEpub + "/OEBPS/text/content.temp"
	args1(1).Name = "FilterName"
	args1(1).Value = "Text"

	dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args1())
		
'------------ Split Content File in sections -------------
'----- The page break are marked by fnExportParaStyle ----

	iSplitCount=0			'Sequential number of contentxxx.xhtml files
	
	Open MyEpub + "/OEBPS/text/content.temp" For Input As #1
	Open MyEpub + "/OEBPS/text/content" & right("000" & cStr(iSplitCount),3) & ".xhtml" For Output As #2
	Do While not EOF (1)
		Line Input #1, sXfer
		Print #2, sXfer
		if sXfer = "</html>" then	'</html> is the magic word to split
			Close #2
			iSplitCount = iSplitCount + 1
			Open MyEpub + "/OEBPS/text/content" & right("000" & cStr(iSplitCount),3) & ".xhtml" For Output As #2		
		end if
	Loop	
	Close #1
	Close #2
	iSplitCount = iSplitCount - 1
End Sub



Sub CreateTocFile (MyEpub as string)
	Open MyEpub + "/OEBPS/toc.ncx" For Output As #1
	Print #1, "<?xml version=""1.0""?>"
	Print #1, "<!DOCTYPE ncx PUBLIC ""-//NISO//DTD ncx 2005-1//EN"""
	Print #1, "	  ""http://www.daisy.org/z3986/2005/ncx-2005-1.dtd"">"
	Print #1, "<ncx xmlns=""http://www.daisy.org/z3986/2005/ncx/"" version=""2005-1"">"
	Print #1, "    <head>"
	Print #1, "        <meta name=""dtb:uid"" content=""" & MyUUIDv4 & """/>"
	Print #1, "        <meta name=""dtb:depth"" content=""1""/>"
	Print #1, "        <meta name=""dtb:totalPageCount"" content=""0""/>"
	Print #1, "        <meta name=""dtb:maxPageNumber"" content=""0""/>"
	Print #1, "    </head>"
	Print #1, "    <docTitle>"
	Print #1, "        <text>Unknown</text>"
	Print #1, "    </docTitle>"
	Print #1, "    <navMap>"
	Print #1, "    </navMap>"
	Print #1, "</ncx>"
	Close #1
End Sub



Sub CreateCSSFile (MyEpub as string)
'---- Create STYLESHEET.CSS file ----
	Open MyEpub + "/OEBPS/styles/style001.css" For Output As #1
	
	Print #1, "	@namespace h ""http://www.w3.org/1999/xhtml"";"
	Print #1, " @page { margin: 0.8em }"
'	Print #1, "	body"
'	Print #1, "		{margin-right: 3%;"
'	Print #1, "		margin-left: 3%;"
'	Print #1, "		}"
	Print #1, "	h1"
	Print #1, "		{margin-top:4em;"
	Print #1, "		margin-bottom:1.5em;"
	Print #1, "		page-break-after:avoid;"
	Print #1, "		font-size:1.2em;"
	Print #1, "		font-family: Georgia, Garamond, serif;"		
	Print #1, "		text-align: center;"
	Print #1, "		color:#000000;"
	Print #1, "		}"
	Print #1, "	h2"
	Print #1, "		{margin-top:3em;"
	Print #1, "		margin-right:0em;"
	Print #1, "		margin-bottom:2em;"
	Print #1, "		margin-left:0em;"
	Print #1, "		page-break-after:avoid;"
	Print #1, "		font-size:1em;"
	Print #1, "		font-family:  Georgia, Garamond, serif;"
	Print #1, "		text-align: center;"
	Print #1, "		color:#000000;"
	Print #1, "		}"
	Print #1, "	h3"
	Print #1, "		{margin-top:2em;"
	Print #1, "		margin-bottom:2em;"
	Print #1, "		line-height:normal;"
	Print #1, "		page-break-after:avoid;"
	Print #1, "		font-size:0.9em;"
	Print #1, "		font-family: Georgia, Garamond, serif;"
	Print #1, "		text-align: center;"
	Print #1, "		color:#000000;"
	Print #1, "		}"
	Print #1, "	p"
	Print #1, "		{margin:0pt;"
	Print #1, "		text-indent:1em;"
	Print #1, "		font-family: Georgia, Garamond, serif;"
	Print #1, "		text-align: justify;"
	Print #1, "		color:#000000;"
	Print #1, "		}"
	Print #1, "	div.center"
	Print #1, "		{text-align: center"
	Print #1, "		}"
	Print #1, "	div.right"
	Print #1, "		{text-align: right"
	Print #1, "		}"
	Print #1, "	a"
	Print #1, "		{color:#000000;"
	Print #1, "		text-decoration: underline"
	Print #1, "		}"
	Print #1, "	span.normal {font-style: normal;}"
	Print #1, "	span.linet {text-decoration: line-through}"
	Print #1, "	span.underline {text-decoration: underline}"
	Close #1
End Sub




Sub CreateContentOpfFile (MyEpub as string)
'---- Create CONTENT.OPF file ----

	Dim i as Integer
	Dim FileName, FileType as String
	Dim oDeskTop as object
	oDeskTop=CreateUnoService("com.sun.star.frame.Desktop")
	
	Open MyEpub + "/OEBPS/content.opf" For Output As #1
	Print #1, "<?xml version=""1.0"" encoding=""UTF-8""?>"
	Print #1, "<package xmlns=""http://www.idpf.org/2007/opf"" unique-identifier=""BookID"" version=""2.0"">"
	Print #1, "    <metadata xmlns:dc=""http://purl.org/dc/elements/1.1/"" xmlns:opf=""http://www.idpf.org/2007/opf"">"
	Print #1, "        <dc:identifier id=""BookID"" opf:scheme=""UUID"">" & myUUIDv4 & "</dc:identifier>"
	Print #1, "        <meta name=""writer2epub"" content=""" & sVersion & """/>"
	Print #1, "    </metadata>"
	Print #1, "    <manifest>"
	Print #1, "        <item id=""ncx"" href=""toc.ncx"" media-type=""application/x-dtbncx+xml""/>"
	For i=1 to iSplitCount
		Print #1, "        <item id=""content" & right("000" & cStr(i),3) & ".xhtml"" href=""text/content" & right("000" & cStr(i),3) & ".xhtml"" media-type=""application/xhtml+xml""/>"
	Next i
	Print #1, "        <item id=""style001.css"" href=""styles/style001.css"" media-type=""text/css""/>"
	Print #1, "    </manifest>"
	Print #1, "    <spine toc=""ncx"">"
	For i=1 to iSplitCount
		Print #1, "        <itemref idref=""content" & right("000" & cStr(i),3) & ".xhtml""/>"
	Next i
	If FileExists(MyEpub & "/OEBPS/images/") Then 
		FileName=Dir(MyEpub & "/OEBPS/images/")
		Do While FileName <> ""
			Select Case right (FileName, 4)
				Case ".png"
					FileType = "png"
				Case ".gif"
					FileType = "gif"
				Case ".jpg"
					FileType = "jpeg"
				Case "jpeg"
					FileType = "jpeg"
				Case "svg"
					FileType = "svg+html"
				Case else
					msgbox "image file " & FileName & " NOT SUPPORT BY EPUB!" & chr(13) & "Only .jpeg, .png, .gif and .svg allowed"
			End Select
			Print #1, "        <item id=""" & FileName & """ href=""images/" & FileName & """ media-type=""image/" & FileType & """/>"
			FileName=dir()
		Loop
	End If 
	Print #1, "    </spine>"
	Print #1, "    <guide>"
	Print #1, "        <reference type=""cover"" title=""Cover Page"" href=""text/content001.xhtml""/>"
	Print #1, "    </guide>"
	Print #1, "</package>"
	Close #1
End Sub


Sub CleanFiles  (MyEpub as string)
	
'------- this routine is requested to remove the extra unwantend split at the beginning and the end -----

	If FileExists(MyEpub & "/OEBPS/text/content000.xhtml") Then 
		Kill (MyEpub & "/OEBPS/text/content000.xhtml")
	End If 

	If FileExists(MyEpub & "/OEBPS/text/content" & right("000" & cStr(iSplitCount+1),3) & ".xhtml") Then
		Kill (MyEpub & "/OEBPS/text/content" & right("000" & cStr(iSplitCount+1),3) & ".xhtml")
	End If 
	
	
	
'------------------------------------------------------------------------
	
	If FileExists(MyEpub & "/OEBPS/text/content.temp") Then 
		Kill (MyEpub & "/OEBPS/text/content.temp")				' remove temporary file
	End If 
	
End Sub


Sub CreateEpub(MyEpub as String) 
    
  Dim sFileToZipUrl As String
  Dim sZipPackageUrl As String 
  sFileToZipUrl = ConvertToUrl( MyEpub) 
  sZipPackageUrl = ConvertToUrl( MyEpub & ".epub" ) 
  ZipFolder(sFileToZipUrl, sZipPackageUrl ) 
  'RmDir sFileToZipUrl
End sub





Sub EditMacros				'Opens the macro editor ###### DEVELOPER USE ONLY! #######
	dim document   as object
	dim dispatcher as object
	document   = ThisComponent.CurrentController.Frame
	dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
	dispatcher.executeDispatch(document, ".uno:MacroDialog", "", 0, Array())
End Sub


Sub ErrorHandler
	msgbox ("Error # " & err & " at line " & erl & chr(13) & error, 16, "Writer to ePub")
	fenDoc.Enable = True 
	oDoc.unlockControllers 
End Sub



Sub XSLTransform (MyEpub)

rem -------------------------------------------------------
rem - Get access to the document
dim document as object
document = ThisComponent

rem -------------------------------------------------------
rem - Init export URL
dim xmlurl as string
xmlurl = MyEpub & "/OEBPS/text/content001.xhtml"
iSplitCount=1
rem -------------------------------------------------------
rem - Export payments
dim properties(5) as new com.sun.star.beans.PropertyValue
properties(0).Name = "FilterName"
properties(0).Value = "XHTML Writer File"'"epub_export"
'properties(1).Name = "URL"
'properties(1).Value = "2008-01-01;hol.sten"
properties(1).Value = xmlurl
'msgbox xmlurl
document.storeToURL(xmlurl, properties())

End Sub
Logseman is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LaTeX and OpenOffice -> EPUB ? (Professional solution) Randy11 ePub 22 11-10-2010 11:03 PM
EPUB Expert Needed: Cant properly export epub from InDesign crottmann ePub 17 08-27-2010 10:23 AM
OpenOffice to Palm eReader export macro poxi1023 Other formats 29 02-28-2009 05:49 PM
OpenOffice PDF Import and Hybrid Export wallcraft Workshop 0 06-06-2008 08:15 PM
OpenBerg FireFox extension for ePub wallcraft Reading and Management 20 10-05-2007 11:24 AM


All times are GMT -4. The time now is 10:19 PM.


MobileRead.com is a privately owned, operated and funded community.