Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ralph van Vugt 57 posts 101 karma points
    Nov 24, 2011 @ 17:19
    Ralph van Vugt
    0

    Unexpected end of file while parsing Name has occurred

    Hi Darren,

    I've a strange issue when trying to show images stored with DAMP fullmedia. When I try to view the PDF file, I get this error:

    Trace:

    [XmlException: Unexpected end of file while parsing Name has occurred. Line 303, position 34.]
       ibex4.xml.IntermediateFormatCreator.readXMLIntoIntermediateForm(RenderingContext rc) +574
       ibex4.logical.FODocument_Implementation.commonCreationAndClose(RenderingContext rc, IntermediateFormatCreator intermediate_format_creator, Boolean close_output_stream, Stream output_stream, String xsl_swap_file_name, Stream fo_stream) +66
       ibex4.logical.FODocument_Implementation.generateStreams(Stream xml_stream, Stream xsl_stream, Stream output_stream, Boolean closeOutputStream, Hashtable xsltParams) +1697
       ibex4.logical.FODocument_Implementation.generateStreams(Stream template, Stream output, Boolean closeOutputStream) +335
       FergusonMoriyama.Pdf.Application.Filter.FoFilter.Write(Byte[] buffer, Int32 offset, Int32 count) +176
       System.Web.HttpWriter.FilterIntegrated(Boolean finalFiltering, IIS7WorkerRequest wr) +546
       System.Web.HttpResponse.FilterOutput() +121
       System.Web.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +168
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270

     

    This is the FO output with the PDF render header removed:

    Note: I've used ImageGen to scale an image down to a normal size, because the client uploaded some large images (4000 x 3000px).

    Razorcode below takes care of the images.

    <fo:block break-before="column" margin-top="0.65cm">
            <fo:inline>
                @{  
                    dynamic largepic = node.MediaById(node.umMainImage);
                    
                    
                    <fo:external-graphic src="@(url + largepic.umbracoFile)" content-width="7.9cm" />
                    
                    
                }
            </fo:inline>
            </fo:block>
            
            <fo:block>
            <fo:inline>
            @foreach (dynamic img in node.umImage)
            {
                                                    
                                    <fo:external-graphic src="@(url + img.Image.umbracoFile)" content-width="3.9cm" />
                                
            }
            </fo:inline>
            </fo:block>

     

    This XML file does not appear to have any style information associated with it. The document tree is shown below.
    <!-- Sets standard PDF Metadata -->
    <ibex:properties title="Komatsu WA 250 PZ" author="Robert" subject="" keywords="metat,bacon,sheep" creator="PDF Creator for Umbraco"/>
    <!--
    Uncomment below to add protection to the PDF - optionally specify a password
    -->
    <!--
    <ibex:security deny-print="true" deny-extract="true" deny-modify="true" user-password="" owner-password=""/>
    -->
    <!--
    This defines a simple page layout with a heder and a footer
    -->
    <fo:layout-master-set>
    <fo:simple-page-master master-name="master" page-width="210mm" page-height="297mm" margin-top="1cm" margin-bottom="1cm" margin-left="2cm" margin-right="2cm" font-size="10pt">
    <fo:region-body margin-top="4cm" margin-bottom="1.5cm" column-count="2" column-gap="1cm"/>
    <fo:region-before region-name="header" extent="3cm"/>
    <fo:region-after region-name="footer" extent="2.5cm"/>
    </fo:simple-page-master>
    </fo:layout-master-set>
    <!-- Main content starts within page sequence -->
    <fo:page-sequence master-reference="master">
    <!-- Doucment header -->
    <fo:flow flow-name="header">
    <fo:table>
    <fo:table-column column-width="80mm" background-color="#ffffff"/>
    <fo:table-column column-width="80mm" background-color="#ffffff"/>
    <fo:table-body>
    <fo:table-row>
    <fo:table-cell>
    <fo:block>
    <fo:external-graphic src="http://www.hansvandrielused.nl/data/usedimg/logo.png" content-width="4cm"/>
    </fo:block>
    </fo:table-cell>
    <fo:table-cell text-align="right">
    <fo:block font-family="Arial" font-weight="bold" font-size="18pt" color="#000" margin-top="1cm">Komatsu WA 250 PZ</fo:block>
    </fo:table-cell>

    </fo:table-row>

    </fo:table-body>

    </fo:table>

    </fo:flow>

    <!-- Doucment footer -->
    <fo:static-content flow-name="footer">
    <fo:block font-size="7pt" color="#aaaaaa" margin-bottom="0.5cm">
    De informatie op deze website is met grote zorgvuldigheid samengesteld. Hans van Driel Used is echter niet aansprakelijk voor enige directe of indirecte schade die zou kunnen ontstaan door het gebruik van de hierin aangeboden informatie. Hans van Driel Used behoudt zich het recht voor om de inhoud van de website op elk gewenst moment zonder voorafgaande kennisgeving te wijzigen of uit te breiden. Prijzen zijn excl. btw en onder voorbehoud van zetfouten en prijswijzigingen. Tevens behoudt Hans van Driel Used zich het recht voor om de aangeboden machine tussentijds aan derden te verkopen.
    </fo:block>
    <fo:block font-size="7pt" color="#000" margin-bottom="0.5cm" text-align="center">
    HANS VAN DRIEL USED - MARCONISTRAAT 15 - 4004 JM - TIEL - Tel: +31 (0) 344 611 444
    </fo:block>
    <fo:block font-size="7pt" color="#aaaaaa" margin-bottom="0.5cm">
    <fo:block text-align-last="justify">
    24-11-2011 - http://www.hansvandrielused.nl/nl/totale-voorraad/wielladers/komatsu-wa-250-pz/
    <fo:leader leader-pattern="space"/>
    Pagina
    <fo:page-number/>
    van
    <fo:page-number-citation ref-id="last-page"/>
    </fo:block>
    </fo:block>

    </fo:static-content>

    <!-- Document Body -->
    <fo:flow flow-name="xsl-region-body">
    <fo:block font-weight="bold" margin-bottom="0.25cm">Technische specificaties</fo:block>
    <fo:table background-color="#eeeeee" padding-top="0.1cm" padding-left="0.1cm" padding-right="0.1cm" font-size="10pt">
    <fo:table-column column-width="40mm"/>
    <fo:table-column column-width="40mm"/>
    <fo:table-body>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Merk en type</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Komatsu WA 250 PZ</fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Gewicht</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>13.840 KG</fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Bouwjaar</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>2008</fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Vermogen</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>104 kW</fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Urenstand</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>2850</fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Bakinhoud</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>2,0 - 2,5 m³</fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Locatie</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Tiel</fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Prijs</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>
    € p.o.a.
    <br/>
    <fo:block font-size="6pt" padding-top="0.10cm">(excl. btw / excl. transport)</fo:block>
    </fo:block>
    </fo:table-cell>

    </fo:table-row>

    </fo:table-body>

    </fo:table>

    <fo:block font-weight="bold" margin-bottom="0.25cm" margin-top="0.5cm">Machine uitvoering</fo:block>
    <fo:table background-color="#eeeeee" padding-top="0.1cm" padding-left="0.1cm" padding-right="0.1cm" font-size="10pt">
    <fo:table-column column-width="40mm"/>
    <fo:table-column column-width="40mm"/>
    <fo:table-body>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Banden</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Michelin 20.5 R 25</fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Conditie rijwerk</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>65%</fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Extra functies</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>
    3e functie omschakelbaar vanaf de hydraulische snelwissel
    </fo:block>
    </fo:table-cell>
    </fo:table-row>

    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Hydr. snelwissel</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Ja, Volvo maat</fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Toebehoren</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Dichte bak (Eurosteel)</fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Tegen meerprijs</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Set recycling banden!!!</fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>Bijzonderheden</fo:block>
    </fo:table-cell>
    <fo:table-cell padding-bottom="0.10cm">
    <fo:block>
    Per direct beschikbaar. Machine heeft ook joystick besturing, vetsmering en voorfilter
    </fo:block>
    </fo:table-cell>
    </fo:table-row>

    </fo:table-body>

    </fo:table>

    <fo:block font-weight="bold" margin-bottom="0.25cm" margin-top="0.5cm">Direct deze machine kopen?</fo:block>
    <fo:table background-color="#eeeeee" padding-top="0.1cm" padding-left="0.1cm" padding-right="0.1cm" font-size="10pt">
    <fo:table-column column-width="40mm"/>
    <fo:table-column column-width="40mm"/>
    <fo:table-body>
    <fo:table-row>
    <fo:table-cell>
    <fo:block>Contactpersoon</fo:block>
    </fo:table-cell>
    <fo:table-cell>
    <fo:block>Gerald Verweij / Edwin Laffeber</fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell>
    <fo:block>Emailadres</fo:block>
    </fo:table-cell>
    <fo:table-cell>
    <fo:block>[email protected]</fo:block>
    </fo:table-cell>
    </fo:table-row>

    </fo:table-body>

    </fo:table>

    <fo:table background-color="#eeeeee" padding-top="0.1cm" padding-left="0.1cm" padding-right="0.1cm" font-size="10pt">
    <fo:table-column column-width="80mm"/>
    <fo:table-body>
    <fo:table-row>
    <fo:table-cell padding="0.2cm">
    <fo:block font-size="22pt" color="#F89829" font-weight="bold" text-align="center">T +31 (0)344 611 444</fo:block>
    </fo:table-cell>
    </fo:table-row>

    </fo:table-body>

    </fo:table>

    <fo:block break-before="column" margin-top="0.65cm">
    <fo:inline>
    <fo:external-graphic scaling="uniform" src="http://www.hansvandrielused.nl/ImageGen.ashx?image=/media/52146/sam_0303.jpg&width=600&constrain=true" content-width="7.9cm"/>
    </fo:inline>
    </fo:block>
    <fo:block>
    <fo:inline>
    <fo:external-graphic src="http://www.hansvandrielused.nl/media/52151/sam_0303.jpg" content-width="3.9cm"/>
    <fo:external-graphic src="http://www.hansvandrielused.nl/media/52156/sam_0306.jpg" content-width="3.9cm"/>
    <fo:external-graphic src="http://www.hansvandrielused.nl/media/52161/sam_0309.jpg" content-width="3.9cm"/>
    <fo:external-graphic src="http://www.hansvandrielused.nl/media/52166/sam_0311.jpg" content-width="3.9cm"/>
    <fo:external-graphic src="http://www.hansvandrielused.nl/media/52171/sam_0314.jpg" content-width="3.9cm"/>
    <fo:external-graphic src="http://www.hansvandrielused.nl/media/52176/sam_0320.jpg" content-width="3.9cm"/>
    </fo:inline>
    </fo:block>
    <fo:block id="last-page" keep-together.within-page="auto"/>

    </fo:flow>

    </fo:page-sequence>

    </fo:root>

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Nov 24, 2011 @ 17:46
    Darren Ferguson
    0
    I noticed that:
    Returns a 404... which may cause problems. I noticed that a few other URLs 404 also.
    It may be worth pulling out your external graphic tags and adding them back in one by one to determine which is causing the issue.
    Thanks.
  • Ralph van Vugt 57 posts 101 karma points
    Nov 24, 2011 @ 22:03
    Ralph van Vugt
    0

    Hi Darren,

    I don't get any 404 errors when I click the images in the xml above. The site went live today, so maybe the dns still needs to be updated, but I noticed the http:// gets stripped of the url. Will look into that tomorrow.

    Thanks

  • Ralph van Vugt 57 posts 101 karma points
    Nov 25, 2011 @ 11:30
    Ralph van Vugt
    0

    Hi Darren,

    We took the razor code apart and found that when we put more than 3 <fo:external image src=""/> in a collumn, we get the error.

    Works:

    <fo:block>
           <fo:inline>
                @{  
                     dynamic largepic2 = node.MediaById(node.umMainImage);
    <fo:external-graphic src="@(url + "/ImageGen.ashx?image=" + largepic2.umbracoFile + "&width=100")" content-width="2cm" />
    <fo:external-graphic src="@(url + "/ImageGen.ashx?image=" + largepic2.umbracoFile + "&width=100")" content-width="2cm" />
    <fo:external-graphic src="@(url + "/ImageGen.ashx?image=" + largepic2.umbracoFile + "&width=100")" content-width="2cm" /> 
                }
    </fo:inline>
    </fo:block>

    Doesn't work

     <fo:block>
           <fo:inline>
                @{  
                     dynamic largepic2 = node.MediaById(node.umMainImage);
    <fo:external-graphic src="@(url + "/ImageGen.ashx?image=" + largepic2.umbracoFile + "&width=100")" content-width="2cm" /><fo:external-graphic src="@(url + "/ImageGen.ashx?image=" + largepic2.umbracoFile + "&width=100")" content-width="2cm" /><fo:external-graphic src="@(url + "/ImageGen.ashx?image=" + largepic2.umbracoFile + "&width=100")" content-width="2cm" /><fo:external-graphic src="@(url + "/ImageGen.ashx?image=" + largepic2.umbracoFile + "&width=100")" content-width="2cm" />
    }
    </fo:inline>
    </fo:block>

    Ralph

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Nov 25, 2011 @ 11:43
    Darren Ferguson
    0

    That sounds odd - are you sure it isn't to do with the URL of your fourth image -

    what happens if you only put in the fourth image?

     

     

  • Ralph van Vugt 57 posts 101 karma points
    Nov 25, 2011 @ 12:06
    Ralph van Vugt
    0

    I was wrong, it's the fourth image which still works, but when I add a fifth image, I get an error. The images are still the same.

    Check these links:

    4 images: works

    http://www.hansvandrielused.nl/nl/totale-voorraad/wielladers/terex-tl70s/?alttemplate=test

    Added 1 more image: error

    http://www.hansvandrielused.nl/nl/totale-voorraad/wielladers/terex-tl70s/?alttemplate=test2

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Nov 25, 2011 @ 12:24
    Darren Ferguson
    0

    That is a different error than before - i'd turn of PDF rendering and check if your FO is valid XML.

     

  • Ralph van Vugt 57 posts 101 karma points
    Nov 25, 2011 @ 12:33
    Ralph van Vugt
    0

    XML seems to render fine. Check the links again, I've removed the PDF header on both scripts.

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Nov 25, 2011 @ 12:55
    Darren Ferguson
    0

    maybe email the xml to me?

  • Ralph van Vugt 57 posts 101 karma points
    Nov 25, 2011 @ 13:31
    Ralph van Vugt
    0

    Done

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Dec 05, 2011 @ 17:53
    Tom Fulton
    0

    Hi Guys,

    Have either of you made any headway with this?  I am experiencing the same error and can't figure it out.

    I cannot figure out exactly what is causing it.  It seems that I can delete some text from the end of a WYSIWYG field, and then it works.  Add some text back and it fails (all basic text).  Sometimes deleting some text then causes this similar error to appear:

    Unexpected end of file has occurred. The following elements are not closed: fo:table-row, fo:table-body, fo:table, fo:table-cell, fo:table-row, fo:table-body, fo:table, fo:block, fo:flow, fo:page-sequence, fo:root. Line 30, position 9103.)

    The same WYSIWYG fields will work fine when displayed by themselves in a simple "Hello World" test, they are only failing in this larger .fo file I am working with.

    This also happened while I was working with some non-WYSIWYG fields, it seemed like I fixed it by deleting some moving some styling attributes to another element higher-up.

    Sorry if this isn't very definitive, I still haven't been able to figure out the common denominator.  Any hints or ideas?

    Thanks,
    Tom

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Dec 05, 2011 @ 19:53
    Tom Fulton
    0

    Ok, it seems I have solved these strange errors by wrapping the RTE content in normalize-space() before sending to RichTextToXml.  Apparently line breaks in the HTML are causing problems.

    <xsl:variable name="xhtml" select="FergusonMoriyama.Pdf.XsltHelper:RichTextToXml(normalize-space($currentPage/productShortDescription))"/>

    Also, not sure if it's related but another problem I had was with '&' characters in my plain-text fields causing an unexpected token error.  I fixed by using a simple XSLT extension to replace '&' with "&amp;"

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Dec 05, 2011 @ 23:16
    Darren Ferguson
    0

    Hi Tom,

    If you are able to send over your complete template plus the content of the rich text area i may be able to assist.

    Whatever is passed into RichTextToXml must be valid XML when wrapped with a containing element so you would need &amp; in place of &

    I doubt that line breaks are causing your issues.

    Thanks.

  • Ralph van Vugt 57 posts 101 karma points
    Dec 06, 2011 @ 23:08
    Ralph van Vugt
    0

    Hi Darren,

    We put 4 Gb of extra memory in the server and now the problem is solved. The error doesn't occur anymore and the pdf's are rendered at lightning speed!

    I will mail you some more information about the memory usage this week. There maybe a small issue with it.

    Thanks a lot!

    Regards,
    Ralph 

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Dec 07, 2011 @ 09:41
    Darren Ferguson
    0

    Hi Ralph, I'd appreciate any infofrmation that you have - it appears Tom is experiencing a similar issue.

    Many Thanks.

    Darren.

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Dec 10, 2011 @ 13:27
    Darren Ferguson
    1

    If you are following this thread - Tom helped me trace the issue and it is fixed in the current version of the package.

    Thanks Tom!

Please Sign in or register to post replies

Write your reply to:

Draft