Images in Docbook

Discuss the word processor

Images in Docbook

Postby tay » Wed May 16, 2018 1:24 pm

Hello !
I have word documents that i'm trying to convert to docbook using OO, and later convert to dita.
when i save as docbook, the images are not generated. the DocBook files created by OpenOffice lack references to the images.
Is there a way to fix this ?
Thank you :)
OpenOffice 4.1.5 on Windows 7
tay
 
Posts: 11
Joined: Thu May 03, 2018 10:28 am

Re: images in Docbook

Postby Villeroy » Wed May 16, 2018 1:37 pm

Of course. It is a user defined XML filter. The filters for xhtml and DocBook are shipped with the office suite as a demo how to convert different flavours of XML into each other.
menu:Tools>XML Filter Settings...
Select the DocBook filter and click [Edit...]
The "Transformation" tab on the following dialog shows the involved files for import, export and the Writer template.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 25272
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: images in Docbook

Postby tay » Wed May 16, 2018 1:40 pm

Villeroy Thank you for your answer.
I am a beginner, could you please provide more details or screenshots to help me solve this problem ?
Thank you again
OpenOffice 4.1.5 on Windows 7
tay
 
Posts: 11
Joined: Thu May 03, 2018 10:28 am

Re: images in Docbook

Postby Villeroy » Wed May 16, 2018 1:56 pm

Well, then you can not do it.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 25272
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: images in Docbook

Postby John_Ha » Wed May 16, 2018 1:59 pm

Neither embedded nor linked images get "saved" when I save a document as a docbook.

I can get the linked image to appear by editing the xml and deleting the " # " which precedes the file name. The image file needs now to be in the same folder as the xml file.

This is the XML for some Latin text with an embedded image (graphics1), which does not appear; and a linked image (Clipboard03.jpg), which does appear, BUT only at thumbnail size, after removing the " # " in the linked image name.

Code: Select all   Expand viewCollapse view
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article
  PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<article lang="">
   <para>
      <inlinegraphic fileref="embedded:graphics1" width="9.99mm" depth="9.99mm"/>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </para>
   <para>
      <inlinegraphic fileref="Clipboard03.jpg" width="146.5mm" depth="92.16mm"/>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</para>
</article>


See [Solved] Beginning with AOO, how to save as docbook for how to enable docbook.

See [Tutorial] Some useful hints on using images for a discussion on how best to handle images in Writer.
AOO 4.1.5, Windows 7 Home 64 bit

See the Writer Manual, the Writer FAQ, the Writer Tutorials and the Writer guide.

Remember: Always save your Writer files as .odt files.
John_Ha
Volunteer
 
Posts: 5365
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: images in Docbook

Postby tay » Wed May 16, 2018 2:13 pm

Villeroy wrote:Well, then you can not do it.


Could you at least give hints on how to proceed ?
OpenOffice 4.1.5 on Windows 7
tay
 
Posts: 11
Joined: Thu May 03, 2018 10:28 am

Re: images in Docbook

Postby John_Ha » Wed May 16, 2018 3:18 pm

See Getting Started With DocBook on OpenOffice. and DocBook.org

This is my .odt with an embedded image and with a linked image. Note that I am not using the proper docbook template.
two images.odt
(19.34 KiB) Downloaded 4 times

It creates this xml file where the embedded image does not appear (not surprisingly as xml has nowhere to store it). The embedded image doers appear (when image 2.gif is located in the same folder as the xml) but at thumbnail size. Note that no " # " now appears in front of the name.
docbook with two images.xml
(547 Bytes) Downloaded 5 times

The xml is
Code: Select all   Expand viewCollapse view
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article
  PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<article lang="">
   <para>A line of text followed by an embedded image image 1.gif.</para>
   <para>
      <inlinegraphic fileref="embedded:graphics1" width="73.48mm" depth="73.48mm"/>
   </para>
   <para>A line of text followed by a linked image image 2.gif.</para>
   <para>
      <inlinegraphic fileref="./image%202.gif" width="134.42mm" depth="134.42mm"/>
   </para>
</article>
AOO 4.1.5, Windows 7 Home 64 bit

See the Writer Manual, the Writer FAQ, the Writer Tutorials and the Writer guide.

Remember: Always save your Writer files as .odt files.
John_Ha
Volunteer
 
Posts: 5365
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: images in Docbook

Postby John_Ha » Wed May 16, 2018 3:44 pm

Also see Support of images in DocBook - XMLmind which is not AOO.

Google openoffice docbook to find things like DocBook Filters - Read and write docbook xml using OpenOffice.org

I think you must use linked and not embedded images.
AOO 4.1.5, Windows 7 Home 64 bit

See the Writer Manual, the Writer FAQ, the Writer Tutorials and the Writer guide.

Remember: Always save your Writer files as .odt files.
John_Ha
Volunteer
 
Posts: 5365
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: images in Docbook

Postby tay » Wed May 16, 2018 4:07 pm

Actually i have received the word documents that i need to convert, so i'm not sure wether the images were embedded or linked.
But i do doubt that this problem is due to the fact that OO only generates docbook 4 , and images are supported on docbook 5.
I might be wrong.
If any one figures out the way to do this, i would really appreciate their help.
OpenOffice 4.1.5 on Windows 7
tay
 
Posts: 11
Joined: Thu May 03, 2018 10:28 am

Re: images in Docbook

Postby Villeroy » Wed May 16, 2018 7:10 pm

Why DocBook?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 25272
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: images in Docbook

Postby John_Ha » Wed May 16, 2018 8:30 pm

I doubt many people here know much about DocBook, let alone using AOO for DocBook.

Were I to want to code for DocBook and/or DITA I would search for a specific DocBook and/or DITA editor.
AOO 4.1.5, Windows 7 Home 64 bit

See the Writer Manual, the Writer FAQ, the Writer Tutorials and the Writer guide.

Remember: Always save your Writer files as .odt files.
John_Ha
Volunteer
 
Posts: 5365
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: images in Docbook

Postby tay » Thu May 17, 2018 2:25 pm

John_Ha wrote:I doubt many people here know much about DocBook, let alone using AOO for DocBook.

Were I to want to code for DocBook and/or DITA I would search for a specific DocBook and/or DITA editor.


I see your point, I am using a specific Dita editor, however many people are using AOO to convert to docbook, so i thought this is a good way to convert my word documents, i guess not !

villeroy, i chose to convert to docbook because it's compatible with Dita and can be converted to it. I'm sure i'm not the only one who is facing this problem, if you do have the answer, Please share it with us, we would all really appreciate it.
OpenOffice 4.1.5 on Windows 7
tay
 
Posts: 11
Joined: Thu May 03, 2018 10:28 am

Re: images in Docbook

Postby John_Ha » Thu May 17, 2018 2:50 pm

tay wrote:I see your point, I am using a specific Dita editor, however many people are using AOO to convert to docbook, so i thought this is a good way to convert my word documents, i guess not !

If many are using AOO then it suggests AOO is a good tool for it. Can you discuss it with any of them? Does Googling for Openoffice docbook help?

I know nothing about Docbook other than what I have picked up responding to you. A search of the forum with DocBook throws up almost nothing. The fact that images don't seem to work as I guess they should work is a caution to me.

 Edit: See below.

I think the linked images are probably coded correctly in the DocBook file. It may be that Writer does not display them correctly when editing the DocBook file. 
Last edited by John_Ha on Tue May 22, 2018 12:29 pm, edited 1 time in total.
AOO 4.1.5, Windows 7 Home 64 bit

See the Writer Manual, the Writer FAQ, the Writer Tutorials and the Writer guide.

Remember: Always save your Writer files as .odt files.
John_Ha
Volunteer
 
Posts: 5365
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: images in Docbook

Postby John_Ha » Thu May 17, 2018 6:00 pm

RoryOF pointed me to Converting Word documents to DITA which mentions using AOO for DocBook and images.
AOO 4.1.5, Windows 7 Home 64 bit

See the Writer Manual, the Writer FAQ, the Writer Tutorials and the Writer guide.

Remember: Always save your Writer files as .odt files.
John_Ha
Volunteer
 
Posts: 5365
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: images in Docbook

Postby tay » Fri May 18, 2018 3:37 pm

John_Ha wrote:RoryOF pointed me to Converting Word documents to DITA which mentions using AOO for DocBook and images.


I have seen this article, but didn't understand how he used the two xsl stylesheets he mentioned to solve the problem ! did you ?
OpenOffice 4.1.5 on Windows 7
tay
 
Posts: 11
Joined: Thu May 03, 2018 10:28 am

Re: Images in Docbook

Postby John_Ha » Fri May 18, 2018 7:08 pm

See link in my second post.
AOO 4.1.5, Windows 7 Home 64 bit

See the Writer Manual, the Writer FAQ, the Writer Tutorials and the Writer guide.

Remember: Always save your Writer files as .odt files.
John_Ha
Volunteer
 
Posts: 5365
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Images in Docbook

Postby tay » Tue May 22, 2018 9:09 am

John_Ha wrote:See link in my second post.


Sadly it did not work for me, or maybe i did not do it the right way.
Thank you anyway for your efforts John_Ha !
OpenOffice 4.1.5 on Windows 7
tay
 
Posts: 11
Joined: Thu May 03, 2018 10:28 am

Re: Images in Docbook

Postby John_Ha » Tue May 22, 2018 11:41 am

My links are:

[Solved] Beginning with AOO, how to save as docbook >>> https://forum.openoffice.org/en/forum/v ... =7&t=93448

Getting Started With DocBook on OpenOffice >>> http://www.openoffice.org/xml/xmerge/do ... Guide.html

DocBook.org >>>> https://docbook.org/

DocBook Filters - Read and write docbook xml using OpenOffice.org >>>> https://www.openoffice.org/xml/xmerge/docbook/

You need to download the style sheet(s) and use the style sheets when writing your DocBook. See [Tutorial] Creating a new default template >>> https://forum.openoffice.org/en/forum/v ... =71&t=1161 where your "new default template" uses the style sheets. I have added it here though I had to zip it. Download it, double-click it and drag the .STW file to your desktop..

I did have a thought about the images. I wonder if Writer creates correct DocBook code (the image size and location seem to be coded correctly in the DocBook code) but Writer does not lay out the page correctly when viewed in Writer (the images are thumbnails at the start of the paragraph).

Mrs Google will know far more about this than I do!
Attachments
DocBookTemplate.zip
Use this template when editing DocBook files.
(5.84 KiB) Downloaded 4 times
AOO 4.1.5, Windows 7 Home 64 bit

See the Writer Manual, the Writer FAQ, the Writer Tutorials and the Writer guide.

Remember: Always save your Writer files as .odt files.
John_Ha
Volunteer
 
Posts: 5365
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Images in Docbook

Postby John_Ha » Tue May 22, 2018 4:26 pm

I think I am beginning to understand this but I welcome any corrections.

1. The DocBook capability in AOO is really old - it dates back to OOo. It is not, as I originally thought, something which has recently been added. My confusion arose because all the very old pages have Apache OpenOffice 4.1.5 released at the top which I misread as meaning the pages were part of the AOO 4.1.5 release. They are not - they were created many years ago by OpenOffice.org.

2. I think the idea is that you download the DocBook Styles Template. You now create a well structured document using the Styles features like headings, paragraphs etc, where the Styles you use are from the template.

3. If you wish, you can now save the document as a .odt file and you get a normal document.

4. The DocBook capability arises because you can File > Save As ..., and choose DocBook as your file type.

AOO now exports your normal document as XML code, using XML tags, in an .XML file, using the correct DocBook XML format. AOO can do this because you have used the DocBook Styles and AOO translates these DocBook Styles to valid DocBook XML code.

See DocBook Filters - Read and write docbook xml using OpenOffice.org says:

The project goal is to explore the possibility of using OpenOffice.org as a WYSIWYG editor of XML content.

The principle is to edit structured documents using styles. These styles are then transformed to XML tags on export.

Anyone from community is welcome to join the project. The current issues and enhancements filed for DocBook are these.

This page shows how to enable and use the DocBook filters. It also shows the location of the stylesheets so that users can download and use the latest transformations. The filter provided on this page is based on earlier releases of the DocBook filter. New features include:

Support for nested tags
Support for unresolved entities
Increased range of supported DocBook tags (index, xref, id attributes for sect etc.)
Use of new Tools -> XML Filter Settings dialog in OpenOffice.org


I searched the forum with Docbook and there are very few relevant posts.
AOO 4.1.5, Windows 7 Home 64 bit

See the Writer Manual, the Writer FAQ, the Writer Tutorials and the Writer guide.

Remember: Always save your Writer files as .odt files.
John_Ha
Volunteer
 
Posts: 5365
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK


Return to Writer

Who is online

Users browsing this forum: No registered users and 9 guests