skip to Main Content

I am working on the digitization of historical resources on the TEI Publisher platform. For the users will have the possibility to download this texts in xml format and also in pdf. But for the pdf output the image did not come out.

In the xml file, the image is encoded in this way:

<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?><?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml"
    schematypens="http://purl.oclc.org/dsdl/schematron"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0" xml:id="" rendition="tei:teisimple" xml:lang="es">
    <teiHeader xml:lang="en">
        <fileDesc>
            <titleStmt>
                <title></title>
                <author></author>
                <editor role="#scholarly"></editor>
                <editor role="#technical" xml:id="">r</editor>
                <editor role="#technical" xml:id=""></editor>
            </titleStmt>
            <editionStmt>
                <edition n="1.0.0">
                    <date type="digitizedEd" when="2023-06-22">2023-06-22</date>
                </edition>
            </editionStmt>
            <publicationStmt>
                <publisher xml:id="pubstmt-publisher">
                    <orgName></orgName>
                    <ref type="url" target=/</ref>
                </publisher>
                <distributor xml:id="pubstmt-distributor">
                    <orgName></orgName>
                    <ref type="url" target=""></ref>
                </distributor>
                <pubPlace role="digitizedEd" xml:id="pubstmt-pubplace">  </pubPlace>
                <availability xml:id="pubstmt-availability">
                    <licence target="https://creativecommons.org/licenses/by/4.0" n="cc-by">
                        <p xml:id="p_ffjaztskfd">Creative
                                Commons Attribution 4.0 International (CC BY 4.0)</ref>.</p>
                    </licence>
                </availability>
                <date type="digitizedEd" when="2024-02-15">2024-02-15</date>
            </publicationStmt>
            <seriesStmt xml:id="seriesStmt">
                <title level="s"</title>
                <title level="j"></title>
                <editor xml:id="TD">
                    <persName ref="gnd:" full="yes">
                        <surname full="yes"></surname>, <forename full="yes"></forename>
                    </persName>
                </editor>
                <editor xml:id="MPMQ">
                    <persName>
                        <surname full="yes"></surname>, <forename full="yes">r</forename>
                    </persName>
                </editor>
            </seriesStmt>
            <sourceDesc>
                <p></p>
                <p> <ref source="">https://dch.hypotheses.org.</ref>
                </p>
            </sourceDesc>
        </fileDesc>
        <encodingDesc xml:lang="es">
            <classDecl>
                <taxonomy>
                    <desc></desc>
                    <category xml:id="">
                        <catDesc></catDesc>
                    </category>
                    <category>
                        <desc></desc>
                        <category xml:id="">
                            <catDesc></catDesc>
                        </category>
                        <category xml:id="">
                            <catDesc></catDesc>
                        </category>
                        <category xml:id="">
                            <catDesc></catDesc>
                        </category>
                        <category xml:id="">
                            <catDesc></catDesc>
                        </category>
                        <category xml:id="">
                            <catDesc></catDesc>
                        </category>
                    </category>
                </taxonomy>
            </classDecl>
        </encodingDesc>
        <profileDesc>
            <textClass>
                <catRef target=""/>
                <keywords scheme="palabras-clave" xml:lang="es">
                    <list>
                        <item></item>
                        <item></item>
                        <item></item>
                        <item></item>
                        <item></item>
                    </list>
                </keywords>
            </textClass>
        </profileDesc>
        <revisionDesc>
            <listChange>
                <change when="" who="">Initial Encoding<date></date>
                </change>
            </listChange>
        </revisionDesc>
    </teiHeader>
    <text>
        <front>
            <titlePage>
                <docTitle>
                    <titlePart><note n="*" place="end" xml:id="footnote-DCH"></note>
                    </titlePart>
                </docTitle>
                <docAuthor><note n="**" place="end" xml:id="footnote-author"/>
                </docAuthor>
            </titlePage>
        </front>
        <body>
            <div n="1">
                <head>1. Introducción</head>
                <p></p>
...
             <div n="6">
                <head>6. </head>
                <p> <term></term> .</p>
                        <graphic url="../dch/resources/images/palio_imagem.png"/>

the master.fo.xml that I wrote:

<fo:layout-master-set xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:simple-page-master master-name="page-left" page-height="297mm" page-width="210mm" margin-bottom="10mm" margin-top="10mm" margin-left="36mm" margin-right="18mm">
        <fo:region-body margin-bottom="10mm" margin-top="16mm"/>
        <fo:region-before region-name="head-left" extent="10mm"/>
    </fo:simple-page-master>
    <fo:simple-page-master master-name="page-right" page-height="297mm" page-width="210mm" margin-bottom="10mm" margin-top="10mm" margin-left="18mm" margin-right="36mm">
        <fo:region-body margin-bottom="10mm" margin-top="16mm"/>
        <fo:region-before region-name="head-right" extent="10mm"/>
    </fo:simple-page-master>
    <fo:page-sequence-master master-name="page-content">
    <xsl:choose>
    <xsl:when test="graphic">
    <fo:external-graphic width="auto" height="auto" content-width="scale-to-fit" content-height="scale-to-fit" src="{$graphic}"/>
     </xsl:when>
      <xsl:otherwise>
      <fo:block>dont found it.</fo:block>
      </xsl:otherwise>
      </xsl:choose>
        <fo:repeatable-page-master-alternatives>
            <fo:conditional-page-master-reference master-reference="page-right" odd-or-even="odd"/>
            <fo:conditional-page-master-reference master-reference="page-left" odd-or-even="even"/>
        </fo:repeatable-page-master-alternatives>
    </fo:page-sequence-master>
</fo:layout-master-set>

Can you have any idea why the image dont printed? Thanks a lot .
The repository from TEI Publisher is here: https://github.com/eeditiones/tei-publisher-app

I tried another "css media print" command, but I did not have success.

2

Answers


  1. Chosen as BEST ANSWER

    thank you for your comments and advice. The problem was solved via ODD. Due to expired certifications, I had to put in the full path and that's how it worked


  2. As @StefanHegny noted, the structure of your XSL-FO is not correct.

    The diagram for the structure of an XSL-FO document from the XSL 1.1 Recommendation is:

    Pagination tree structure from XSL 1.1 Recommendation

    The document element is fo:root. Some of the elements shown in the diagram are optional. Your content goes inside the fo:flow in an fo:page-sequence.

    Additionally, fo:external-graphic is an inline FO, so it should be inside an fo:block element and not just a child of the fo:flow element.

    You can find examples of XSL-FO usage in the Antenna House ‘XSL-FO Samples Collection’ at https://www.antennahouse.com/xsl-fo-samples. You can download the XSL-FO file for any sample to see how it was made.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search