Encoded image not rendered - mxgraph

I am trying to display a diagram imported with draw.io editor and saved as xml file. To parse and render the diagram's xml I use the mxGraph library that display it correctly except for the encoded images. I mean this part of the xml:
<mxCell style="vsdxID=65;fillColor=none;gradientColor=none;image;aspect=fixed;image=data:image/jpg,/9j/4AAQSkZJRgABAQAAAQABAA...
all other aspects are handled fine (shapes, color, lines, ...) but the data:image/jpeg is simply ignored. I don't have any error in console nor broken img tags are generated or similar things.
What/where coukd be the problem?
Marco

Ok, I got it by myself... thanks to Colin tip!
The solution is to change
figure;
in
shape=figure;
and the picture is rendered as expected :-)
Probably it is a bug in the draw.io import/export functionality

Related

Fixing a PDF Accessibility Issue (Alternative description missing for an annotation) when converting an HTML Page to PDF

Currently, I am working on a program that converts an html page into a PDF using the iText Library.
The Checker that I am using is PAC3 -->PDF Accessibility Checker 3 which is described by the following link (https://section508.gov/blog/check-pdf).
One of the issues is the “Alternate description missing for an Annotation”
An excerpt from the following link explains it:
http://www.uottawa.ca/respect/sites/www.uottawa.ca.respect/files/fss-fixing-accessibility-errors-in-pdfs.pdf
Alternative description missing for an annotation This usually happens when the link is not clear enough. To fix this error, add alternative text to the link tags. To add the alternative text, please do the following;
In the tag tree, select the tag for the link, and select Properties
from the options menu.
In the Touchup Properties dialog box, select
the Tag Tab.
Type alternate text for the link, and click close
I have been trying to use iText to fix this problem, but googling, looking at the source and reading the documentation does not help.
Does anybody have any suggestions on how to either write the HTML or use the itext problem to get rid of the “Alternate description missing for an Annotation”
Thank you for your help
You did not specify whether you using old code (XMLWorker, HTMLWorker) or new iText code (pdfHTML).
This of course impacts the proposed solution.
In my answer I am going to assume you are using pdfHTML
There are several options:
edit the incoming HTML using a library like JSoup
convert the incoming HTML to iText IElement objects, and edit those, setting properties where needed
write your own custom TagWorker that handles all instances of a specific tag, and write custom logic to deal with the missing annotations.
An example of a custom tag worker can be found here:
https://developers.itextpdf.com/content/itext-7-examples/converting-html-pdf/pdfhtml-custom-tagworker-example

convert docx with (ordered) list to html

I'm trying to convert a large docx document with several layers' ordered list to an html. (see an example of the document here: http://docdro.id/X1oyfBv You should download it)
I tried the following things, including:
online converters such as html-cleaner and index.html (which only recognize one layer of the list)
save as html - which creates an horrendous file but still doesn't recognize the ol structure.
saved the file as zip and then opened the xml file, but I dont see an easy way to get the ol structure out of the w:... tags
saving it to google docs and running Omar Alzabir's script
http://omaralzabir.com/wp-content/uploads/2014/05/GoogleDocsEmail.jpg
btw. If I create a word file with an ordered list with multiple layers and i convert it, it does recognize it as ol's. But the existing file is not recognized as ol's even if I 'un-list' and list it again. So possibly there is something wrong with how the original document was created (?)
Any suggestions much appreciated:) Or indications as to why this problem occurs
Are you asking how to save a Word-doc in HTML format, with multi-level ordered-lists?
Word-HTML has bugs in its multi-level ordered lists. For the list-items, the indentation tends to be incorrect and inconsistent. There's an example here.
Word-HTML has similar bugs in its multi-level unordered lists. An example is here.
I recently wrote a Python program that fixes these bugs, in Word's HTML. The program is part of WordWebNav (WWN), which is free and open-source.
WWN is an app that converts a Microsoft-Word document to a usable web-page. It adds some missing features in the Word-HTML web-page (e.g., a navigation pane), and it fixes bugs in the Word-HTML.
You can use pandoc : https://github.com/jgm/pandoc
This is an open source universal command line tool to convert markup source based document files.
You can use it as something like that:
pandoc -o output.html input.docx

How do I store HTML/XHTML in an XML file and then use XSLT to retrieve it?

I have an xml file containing the documentation from a project of mine. I'm using XSLT to transform this XML file into HTML to output it in a browser.
Now the thing is that I have some entities that contain some html code. Nothing complicated, just some ` tags. But I don't seem to be able to make it work. I have tried "disable-output-escape" but it only works in internet explorer.
Now I'm trying with namespaces. I wrote this in my root tag.
xmlns:h="http://www.w3.org/1999/xhtml"
and then changed my <br/> tags to <h:br/>, but now the tags don't appear and I still don't have the line break.
I assume I'm missing something.
Found my mistake. Had to use copy-of instead of value-of.

MathType Word Document export using MathPage MathML

I need to convert the ms-word 2003 documents to HTML with MathML included if there are math equations. The quick solution I found at the moment is using the MathType addin to export the whole document into a HTML with MathML using its "Publish to MathPage" function.
However, it couldn't do the conversion properly. Most of the equations in the document is still in the image format, instead of MathML. The strange thing is that it converts the commas into the MathML, not the equations.
The original word document:
https://dl.dropbox.com/u/4625393/test12.doc
The key part of the converted html source:
https://gist.github.com/katat/5091021
Is this a bug of the MathType?
Kata, I'm not sure what versions of Word and MathType you are using, but I was able to successfully create the MathPage with MathML. I am using Word 2013 and MathType 6.9. This is the page I created: http://dl.dropbox.com/u/17008533/187.xht
Not sure what could have gone wrong with yours. It does seem that you chose an appropriate "target" for the MathPage; it looks like you chose XHTML+MathML.
If you can give me some more details about what steps you're taking from start to finish, I'll try to help more. Also let me know what versions of the software you're using.

Indent the text in docbook

I want to indent my text in the article I am writing in docbook 5. I also need to add colors to my text. Is that possible? If so how? I tried indenting as follows but it was not visible when I took the html output of it.(Here I tried to align the text "Kerfun" to the center) I have no idea regarding the colour change. Can someone please tell me how? Where have I gone wrong?
<dbk:para text-indent="center">Kerfun</dbk:para>
<dbk:para text-indent="center">
<dbk:emphasis role="bold">Fadiah</dbk:emphasis>
</dbk:para>
You haven't specified your OS or toolchain.
To format your xml:
I'd suggest using the "xmllint -format" command
To validate your xml:
Same command could be used to ensure your document is valid against the docbook schema
To colorize your xml:
That very much depends on what editor you use. Personally I'm a fan of gvim which has XML high-lighting enabled by default.
Update
As stated I'm not a windows guy but 2 minutes of googling lead me to the following:
Notepad++ appears to have an XML plugin. Source was the following link