Generate two files

View: New views
8 Messages — Rating Filter:   Alert me  

Generate two files

by Alexandre Moraes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

   I´m using XEP and I would like to generate a separate PDF or xml(that could be re-processed) file that will be a background of my original pdf file.
   I´ll generate this file using information that is in the "original" xml file.
  Is it possible?
   If someone has a solution of how to write in a text file will be great.

Thanks

Alexandre

   

RE: Generate two files

by Vladimir Rodimyuk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Please, explain yourself.
If you are going to add some post-processing try you may consider to use XEP intermediate format. Read about it here: http://www.renderx.com/reference..html#a#IntermediateFormatSpecification_Specification

Respectfully,
Volodymyr Rodymyuk

> -----Original Message-----
> From: www-xsl-fo-request@... [mailto:www-xsl-fo-request@...] On
> Behalf Of axdmoraes
> Sent: Tuesday, August 28, 2007 5:48 PM
> To: www-xsl-fo@...
> Subject: Generate two files
>
>    I´m using XEP and I would like to generate a separate PDF or xml(that
> could be re-processed) file that will be a background of my original pdf
> file.
>    I´ll generate this file using information that is in the "original" xml
> file.
>   Is it possible?
>    If someone has a solution of how to write in a text file will be great..



RE: Generate two files

by Alexandre Moraes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I will try to be clearer now.

I have this XML.

<chapter tool="001" pn="80" type="TDS">
   <title>Title1</title>
    <tlsect type="PNU" toolnbr="001" sectnbr="80">
       <title>asdasdasdUSE</title>
         <para>Para 1</para>
    </tlsect>
</chapter>

And I have a xsl:fo to format this file. But I need to show the chapter attributes:tool, pn and type like a watermark behind the text. Then I need to generate a pdf file with this information and put it like a background in the first pdf.

Like the picture.

Thanks

Alexandre


Vladimir Rodimyuk wrote:
Please, explain yourself.
If you are going to add some post-processing try you may consider to use XEP intermediate format. Read about it here: http://www.renderx.com/reference..html#a#IntermediateFormatSpecification_Specification

Respectfully,
Volodymyr Rodymyuk

> -----Original Message-----
> From: www-xsl-fo-request@w3.org [mailto:www-xsl-fo-request@w3.org] On
> Behalf Of axdmoraes
> Sent: Tuesday, August 28, 2007 5:48 PM
> To: www-xsl-fo@w3.org
> Subject: Generate two files
>
>    I´m using XEP and I would like to generate a separate PDF or xml(that
> could be re-processed) file that will be a background of my original pdf
> file.
>    I´ll generate this file using information that is in the "original" xml
> file.
>   Is it possible?
>    If someone has a solution of how to write in a text file will be great..


RE: Generate two files

by Alexandre Moraes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

    other way is if the attribute background-image has an address of an svg image generated inside the stylesheet but it didn´t work until now. But i´m trying.



axdmoraes wrote:
Hi,

I will try to be clearer now.

I have this XML.

<chapter tool="001" pn="80" type="TDS">
   <title>Title1</title>
    <tlsect type="PNU" toolnbr="001" sectnbr="80">
       <title>asdasdasdUSE</title>
         <para>Para 1</para>
    </tlsect>
</chapter>

And I have a xsl:fo to format this file. But I need to show the chapter attributes:tool, pn and type like a watermark behind the text. Then I need to generate a pdf file with this information and put it like a background in the first pdf.

Like the picture.

Thanks

Alexandre


Vladimir Rodimyuk wrote:
Please, explain yourself.
If you are going to add some post-processing try you may consider to use XEP intermediate format. Read about it here: http://www.renderx.com/reference..html#a#IntermediateFormatSpecification_Specification

Respectfully,
Volodymyr Rodymyuk

> -----Original Message-----
> From: www-xsl-fo-request@w3.org [mailto:www-xsl-fo-request@w3.org] On
> Behalf Of axdmoraes
> Sent: Tuesday, August 28, 2007 5:48 PM
> To: www-xsl-fo@w3.org
> Subject: Generate two files
>
>    I´m using XEP and I would like to generate a separate PDF or xml(that
> could be re-processed) file that will be a background of my original pdf
> file.
>    I´ll generate this file using information that is in the "original" xml
> file.
>   Is it possible?
>    If someone has a solution of how to write in a text file will be great..


RE: Generate two files

by Vladimir Rodimyuk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alexandre,
You can put your SVG image in block-container with position="absolute" in some static region (e.g. xsl-region-before).

<fo:static-content flow-name="xsl-region-before">
    <fo:block-container absolute-position="absolute"
        top="4.25in" left="0.5in" width="7.5in"
        height="2.5in">
        <fo:block>
            <fo:instream-foreign-object width="100%" height="100%"
                content-width="scale-to-fit" content-height="scale-to-fit"
                scaling="uniform">
                <svg:svg width="7.5in" height="2.5in" viewBox="0 0 200 50">
                    <svg:rect fill="#AFA" fill-opacity=".2" x="0" y="0"
                        width="200"
                        height="50" rx="5" ry="5"/>
                    <svg:text style="font-family:Helvetica; font-size:10;
                        font-weight:bold"
                        text-anchor="middle" fill="#06148E"
                        fill-opacity=".3" x="100" y="25"
                        >Watermark image</svg:text>
                </svg:svg>
            </fo:instream-foreign-object>
        </fo:block>
    </fo:block-container>
</fo:static-content>

Maybe it will be interesting for you to see similar request and whole thread:
http://www.renderx.net/lists/xep-support/3013.html

Respectfully,
Volodymyr Rodymyuk

> -----Original Message-----
> From: www-xsl-fo-request@... [mailto:www-xsl-fo-request@...] On
> Behalf Of axdmoraes
>     other way is if the attribute background-image has an address of an
> svg
> image generated inside the stylesheet but it didn´t work until now. But
> i´m
> trying.
> axdmoraes wrote:
> >
....
> > And I have a xsl:fo to format this file. But I need to show the chapter
> > attributes:tool, pn and type like a watermark behind the text. Then I
> need
> > to generate a pdf file with this information and put it like a
> background
> > in the first pdf.
> >
> > Like the picture.



testAX.fo (7K) Download Attachment
testax.pdf (13K) Download Attachment

RE: Generate two files

by Alexandre Moraes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Vladimir,it helped me a lot but i still have a problem.
This watermark is dynamic and it should change on every element chapter.

This is an example:

<book>
 <chapter tool="001" pn="80" type="TDS">
    <title>Title1</title>
     <tlsect type="PNU" toolnbr="001" sectnbr="80">
        <title>asdasdasdUSE</title>
          <para>Para 1</para>
     </tlsect>
 </chapter>

 <chapter tool="002" pn="440" type="asdS">
    <title>Title2</title>
     <tlsect type="PNU" toolnbr="001" sectnbr="80">
        <title>asdasdasdUSE</title>
          <para>Para 2</para>
     </tlsect>
 </chapter>
</book>

 I can generate a separete pdf file with another xsl:fo file and then put this pdf like background of the fo:block. It works but I´ll have to make more steps. I was trying to generate an svg image in the same xsl:fo, like you do in your example, and put it in the fo:block background. Not in the region-before because the image is dynamic. I tryed something but it didn´t work.

If you have any idea.

Thanks for now...

Alexandre

Vladimir Rodimyuk wrote:
Alexandre,
You can put your SVG image in block-container with position="absolute" in some static region (e.g. xsl-region-before).

<fo:static-content flow-name="xsl-region-before">
    <fo:block-container absolute-position="absolute"
        top="4.25in" left="0.5in" width="7.5in"
        height="2.5in">
        <fo:block>
            <fo:instream-foreign-object width="100%" height="100%"
                content-width="scale-to-fit" content-height="scale-to-fit"
                scaling="uniform">
                <svg:svg width="7.5in" height="2.5in" viewBox="0 0 200 50">
                    <svg:rect fill="#AFA" fill-opacity=".2" x="0" y="0"
                        width="200"
                        height="50" rx="5" ry="5"/>
                    <svg:text style="font-family:Helvetica; font-size:10;
                        font-weight:bold"
                        text-anchor="middle" fill="#06148E"
                        fill-opacity=".3" x="100" y="25"
                        >Watermark image</svg:text>
                </svg:svg>
            </fo:instream-foreign-object>
        </fo:block>
    </fo:block-container>
</fo:static-content>

Maybe it will be interesting for you to see similar request and whole thread:
http://www.renderx.net/lists/xep-support/3013.html

Respectfully,
Volodymyr Rodymyuk

> -----Original Message-----
> From: www-xsl-fo-request@w3.org [mailto:www-xsl-fo-request@w3.org] On
> Behalf Of axdmoraes
>     other way is if the attribute background-image has an address of an
> svg
> image generated inside the stylesheet but it didn´t work until now. But
> i´m
> trying.
> axdmoraes wrote:
> >
....
> > And I have a xsl:fo to format this file. But I need to show the chapter
> > attributes:tool, pn and type like a watermark behind the text. Then I
> need
> > to generate a pdf file with this information and put it like a
> background
> > in the first pdf.
> >
> > Like the picture.

 
 

RE: Generate two files

by Vladimir Rodimyuk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Alexandre,

I don't think that using of additional PDF will help you.
BTW multi-page PDF is inserted into the flow as 1-paged one, so you will have to produce as many PDF as you have chapters. Also you will have to use absolute positioned block-containers to put content behind the "watermark". So this approach is suitable if you are dealing with static layout only.

I think it's much easier to produce separate page-sequence for each chapter and prepare specific header for it using XSL (fo:retrieve-marker is not working inside svg element).

So it will be something like this:
<!-- in the context of chapter node -->
<fo:static-content flow-name="xsl-region-before">
    <fo:block-container absolute-position="absolute"
        top="4.25in" left="0.5in" width="7.5in"
        height="2.5in">
        <fo:block>
            <fo:instream-foreign-object width="100%" height="100%"
                content-width="scale-to-fit" content-height="scale-to-fit"
                scaling="uniform">
                <svg:svg width="7.5in" height="2.5in" viewBox="0 0 200 50">
                    <svg:rect fill="#AFA" fill-opacity=".2" x="0" y="0"
                        width="200"
                        height="50" rx="5" ry="5"/>
                    <svg:text style="font-family:Helvetica; font-size:10;
                        font-weight:bold"
                        text-anchor="middle" fill="#06148E"
                        fill-opacity=".3" x="100" y="25"
                        >
                        <xsl:value-of select="@tool"/>
                        <xsl:text>:</xsl:text>
                        <xsl:value-of select="@pn"/>
                        <xsl:text>:</xsl:text>
                        <xsl:value-of select="@type"/>
                        <xsl:text>:</xsl:text>
                        </svg:text>
                </svg:svg>
            </fo:instream-foreign-object>
        </fo:block>
    </fo:block-container>
</fo:static-content>

Respectfully,
Volodymyr Rodymyuk


> -----Original Message-----
> From: www-xsl-fo-request@... [mailto:www-xsl-fo-request@...] On
> Behalf Of axdmoraes
> Sent: Wednesday, August 29, 2007 8:28 PM
> To: www-xsl-fo@...
> Subject: RE: Generate two files

> This watermark is dynamic and it should change on every element chapter.
>
>
>  I can generate a separete pdf file with another xsl:fo file and then put
> this pdf like background of the fo:block. It works but I´ll have to make
> more steps. I was trying to generate an svg image in the same xsl:fo, like
> you do in your example, and put it in the fo:block background. Not in the
> region-before because the image is dynamic. I tryed something but it
> didn´t
> work.
>
> If you have any idea.
>
> Thanks for now...
>
> Alexandre



RE: Generate two files

by Alexandre Moraes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Vladimir. It worked well.

Alexandre


Vladimir Rodimyuk wrote:
Alexandre,

I don't think that using of additional PDF will help you.
BTW multi-page PDF is inserted into the flow as 1-paged one, so you will have to produce as many PDF as you have chapters. Also you will have to use absolute positioned block-containers to put content behind the "watermark". So this approach is suitable if you are dealing with static layout only.

I think it's much easier to produce separate page-sequence for each chapter and prepare specific header for it using XSL (fo:retrieve-marker is not working inside svg element).

So it will be something like this:
<!-- in the context of chapter node -->
<fo:static-content flow-name="xsl-region-before">
    <fo:block-container absolute-position="absolute"
        top="4.25in" left="0.5in" width="7.5in"
        height="2.5in">
        <fo:block>
            <fo:instream-foreign-object width="100%" height="100%"
                content-width="scale-to-fit" content-height="scale-to-fit"
                scaling="uniform">
                <svg:svg width="7.5in" height="2.5in" viewBox="0 0 200 50">
                    <svg:rect fill="#AFA" fill-opacity=".2" x="0" y="0"
                        width="200"
                        height="50" rx="5" ry="5"/>
                    <svg:text style="font-family:Helvetica; font-size:10;
                        font-weight:bold"
                        text-anchor="middle" fill="#06148E"
                        fill-opacity=".3" x="100" y="25"
                        >
                        <xsl:value-of select="@tool"/>
                        <xsl:text>:</xsl:text>
                        <xsl:value-of select="@pn"/>
                        <xsl:text>:</xsl:text>
                        <xsl:value-of select="@type"/>
                        <xsl:text>:</xsl:text>
                        </svg:text>
                </svg:svg>
            </fo:instream-foreign-object>
        </fo:block>
    </fo:block-container>
</fo:static-content>

Respectfully,
Volodymyr Rodymyuk


> -----Original Message-----
> From: www-xsl-fo-request@w3.org [mailto:www-xsl-fo-request@w3.org] On
> Behalf Of axdmoraes
> Sent: Wednesday, August 29, 2007 8:28 PM
> To: www-xsl-fo@w3.org
> Subject: RE: Generate two files

> This watermark is dynamic and it should change on every element chapter.
>
>
>  I can generate a separete pdf file with another xsl:fo file and then put
> this pdf like background of the fo:block. It works but I´ll have to make
> more steps. I was trying to generate an svg image in the same xsl:fo, like
> you do in your example, and put it in the fo:block background. Not in the
> region-before because the image is dynamic. I tryed something but it
> didn´t
> work.
>
> If you have any idea.
>
> Thanks for now...
>
> Alexandre