-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(URGENT) LutaML model diagram missing from PDF (exists in Word) #796
Comments
I wonder if the |
I've tried to generate presentation xml on Windows 10, but the process failed (#797). Tried to put into empty Word document: Tried to generate PDF:
I'll try on Ubuntu. |
I wonder if it's related to this metanorma/pngcheck-ruby#17 ?
Let me send you a few screenshots to see if you can see them? |
Actually, there are a few issues:
<image src="images/D:/Work/Metanorma/repositories/iso-19135/sources/iso-19135-2021/images/lutaml/lutaml20220913-7144-s5djb6.png" ISO XSLT adds the current document path ( <fo:external-graphic width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image " src="url(file:D:\Work\Metanorma\XML\ISO97_Badimage\images/D:/Work/Metanorma/repositories/iso-19135/sources/iso-19135-2021/images/lutaml/lutaml20220913-7144-s5djb6.png)"/> If I change <image src="images/lutaml/lutaml20220913-7144-s5djb6.png" then FOP informs about
On Ubuntu, <image src="/home/testuser/iso-19135/sources/iso-19135-2021/images/lutaml/lutaml20220913-4327-zyjutc.png" |
I.e. it seems the initial issue relates to the wrong image path in |
@Intelligent2013 then the Windows PNG issue of Can I confirm that the wrong image path in |
@ronaldtse no, the problem in the Metanorma Ruby. The image path in |
I believe this issue has been fixed. @Intelligent2013 can you help try again? Thanks! |
I've tried on Windows:
There is
<figure id="_">
<name>Elements of the Register model</name>
<image src="images/D:/Work/Metanorma/repositories/iso-19135/sources/iso-19135-2021/images/lutaml/lutaml20221011-8492-cakden.png" id="_" mimetype="image/png" height="auto" width="auto"/></figure> Gemfile:
|
From Gemfile.lock:
I'll try to specify right version directly in Gemfile... |
The version |
All .png in the folder From http://www.libpng.org/pub/png/spec/1.2/PNG-Structure.html:
I.e. instead of |
Preliminary investigation - 2 files have zero-size due missing outfile = Tempfile.new(["lutaml", ".png"])
outfile.binmode
outfile.puts(formatter.format(uml_document)) Should be: outfile = Tempfile.new(["lutaml", ".png"])
outfile.binmode
outfile.puts(formatter.format(uml_document))
outfile.close |
The wrong PNG on Windows platform generates here (C:\tools\ruby31\lib\ruby\gems\3.1.0\gems\lutaml-0.7.4\lib\lutaml\layout\graph_viz_engine.rb): Open3.popen3("dot -T#{type}") do |stdin, stdout, _stderr, _wait|
stdin.puts(input)
stdin.close
stdout.read
digraph G {
graph [splines="ortho" pad=0.5 ranksep="1.2.equally" nodesep="1.2.equally"]
edge [color="gray50"]
node [shape="box" fontname="Helvetica-bold"]
Register [
shape="plain"
fontname="Helvetica"
label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR>
<TD><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR><TD ALIGN="CENTER"><B>Register</B></TD></TR>
</TABLE>
</TD>
</TR>
<TR>
<TD><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR><TD ALIGN="LEFT">identifier : Identifier[1..]</TD></TR>
<TR><TD ALIGN="LEFT">concept_classes : ConceptClass[0..*]</TD></TR>
<TR><TD ALIGN="LEFT">concepts : Concept[0..*]</TD></TR>
<TR><TD ALIGN="LEFT">concept_versions : ConceptVersions[0..*]</TD></TR>
<TR><TD ALIGN="LEFT">register_item_classes : RegisterItemClass[0..*]</TD></TR>
<TR><TD ALIGN="LEFT">register_items : RegisterItem[0..*]</TD></TR>
</TABLE>
</TD>
</TR>
...
Identifier -> Register [dir="direct" arrowtail="onormal" arrowhead="vee"]
ConceptClass -> Register [dir="direct" arrowtail="onormal" arrowhead="vee"]
Concept -> ConceptClass [dir="direct" arrowtail="onormal" arrowhead="vee"]
ConceptVersion -> Concept [dir="direct" arrowtail="onormal" arrowhead="vee"]
RegisterItem -> RegisterItemClass [dir="direct" arrowtail="onormal" arrowhead="vee"]
RegisterItemClass -> ConceptClass [dir="direct" arrowtail="onormal" arrowhead="vee"]
RegisterItem -> ConceptVersion [dir="direct" arrowtail="onormal" arrowhead="vee"]
RegisterItem -> ContentSchema [dir="direct" arrowtail="onormal" arrowhead="vee"]
ContentSchema -> RegisterItemClass [dir="direct" arrowtail="onormal" arrowhead="vee"]
ContentSchema -> ConceptClass [dir="direct" arrowtail="onormal" arrowhead="vee"]
RegisterItemClass -> Register [dir="direct" arrowtail="onormal" arrowhead="vee"]
RegisterItem -> Register [dir="direct" arrowtail="onormal" arrowhead="vee"]
} The command line ( I think the problem in the code stdin.puts(input)
stdin.close
captured_stdout = stdout.read
print(captured_stdout.bytes)
Looks like there is an issue with newline processing.
the output string looks correct:
but the output png generated via command line Will investigate further. |
For command line tool lutaml - in output_path.open("w+") { |file| file.write(result) } should be: output_path.open("wb+") { |file| file.write(result) } but it doesn't any affect on Metanorma XML generation. So, images in But again the issue in
Error in document.err:
(total 4 'Image not found' errors) |
The prefix def datauri(uri, local_dir = ".")
warn "uri= `#{uri}` ." Windows:
Ubuntu (no prefix before lutaml images):
|
The issue in This code is working in Windows only: def web_path target, start = nil
...
unless start.nil_or_empty? || (web_root? target)
target, uri_prefix = extract_uri_prefix %(#{start}#{(start.end_with? SLASH) ? '' : SLASH}#{target})
end For input parameters
On Ubuntu for input parameters:
is doesn't running because So, I think that relative path to lutaml images should be used ( |
@ronaldtse I've created the issue lutaml/lutaml#39, but I don't have a permissions to commit the changes. |
You have access now. Thanks! |
PDF missing image:
Word:
The text was updated successfully, but these errors were encountered: