You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Neeraj Malik <nm...@yahoo.co.uk> on 2011/03/10 11:51:05 UTC

attaching a zip file in PDF

Hi,

I am not able to attach a zip file in PDF.

Message on console -
WARNING: Unknown formatting object "{http://xmlgraphics.apache.org/fop/extensions/pdf}embedded-file" encountered (a child of fo:declarations}. (No context info available)

I am using Apache FOP 1.0. I tried 0.95 as well.

Please check xsl code below.

Can you please suggest why its not attaching the zip in PDF?

Thanks.

Regards
Neeraj


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
    <xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/>

    <xsl:template match="OriginalNotification">
        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
                    xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">

            <fo:layout-master-set>
                <fo:simple-page-master master-name="simpleA4" page-height="29.7cm" page-width="21cm" margin-top="1cm" margin-left="1.5cm" margin-right="1.5cm" margin-bottom="0.5cm">
                    <fo:region-body margin-bottom="1.5cm" margin-top="3cm"/>
                </fo:simple-page-master>
            </fo:layout-master-set>



            <fo:declarations>
                           <pdf:embedded-file filename="attachments.zip" src="url(file:///C:/attachments.zip)" description="Attachments"/>
                    </fo:declarations>
       
            <fo:page-sequence master-reference="simpleA4">
                <fo:flow flow-name="xsl-region-body">
                    <fo:block>
                    </fo:block>
                </fo:flow>
            </fo:page-sequence>
        </fo:root>

        <!--
            <fo:basic-link external-destination="url(file:///C:/attachments.zip)">Attachments</fo:basic-link>
            -->
       
    </xsl:template>
</xsl:stylesheet>


      

RE: attaching a zip file in PDF

Posted by Neeraj Malik <nm...@yahoo.co.uk>.
Hi Eric,
Thanks.
>From http://ci.apache.org/projects/xmlgraphics/fop/snapshots/I downloaded fop-20110310-bin.zip and installed fop.jar in maven repo manually. There is conflict because of dependencies.
Its a snapshot. What should I put to define it in POM.xml like -<dependency>	<groupId>org.apache.xmlgraphics</groupId>	<artifactId>fop</artifactId>	<version>0.95-1</version></dependency>

RegardsNeeraj

--- On Thu, 10/3/11, Eric Douglas <ed...@blockhouse.com> wrote:

From: Eric Douglas <ed...@blockhouse.com>
Subject: RE: attaching a zip file in PDF
To: fop-users@xmlgraphics.apache.org
Date: Thursday, 10 March, 2011, 15:38



 
 
 
MIME_PDF is not in FOP.
FOP's MimeConstants extends the MimeConstants from 
xmlgraphics.
Do you have xmlgraphics-commons-1.4.jar in your 
classpath?



From: Neeraj Malik [mailto:nmquery@yahoo.co.uk] 

Sent: Thursday, March 10, 2011 10:35 AM
To: 
fop-users@xmlgraphics.apache.org
Cc: 
matthias8283@gmx.at
Subject: Re: attaching a zip file in 
PDF




  
  
    Hello Matthias,

Many thanks.

I downloaded and 
      tested it. It works.
Now I am integrating it in my 
      project.

import org.apache.fop.apps.MimeConstants; 
FOUserAgent 
      foUserAgent = fopFactory.newFOUserAgent();
Fop fop = 
      fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, 
      out);

MIME_PDF is not found. 
Can you please suggest if it has 
      been relocated?

Thanks.

Regards
Neeraj


--- On 
      Thu, 10/3/11, Matthias Reischenbacher 
      <ma...@gmx.at> wrote:

      
From: 
        Matthias Reischenbacher <ma...@gmx.at>
Subject: Re: 
        attaching a zip file in PDF
To: 
        fop-users@xmlgraphics.apache.org
Date: Thursday, 10 March, 2011, 
        12:28


        
Neeraj,

I think the PDF attachment 
        feature was added after the 1.0 release. You
might want to try a 
        nightly snapshot:

http://ci.apache.org/projects/xmlgraphics/fop/snapshots/

HTH,
Matthias


nmquery 
        wrote:
> 
> Hi,
> 
> I am not able to attach a 
        zip file in PDF.
> 
> Message on console -
> WARNING: 
        Unknown formatting object
> "{http://xmlgraphics.apache.org/fop/extensions/pdf}embedded-file"
> 
        encountered (a child of fo:declarations}. (No context info 
        available)
> 
> I am using Apache FOP 1.0. I tried 0.95 as 
        well.
> 
> Please check xsl code below.
> 
> Can 
        you please suggest why its not attaching the zip in PDF?
> 
        
> Thanks.
> 
> Regards
> Neeraj
> 
        
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
        <xsl:stylesheet version="1.1"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> 
        xmlns:fo="http://www.w3.org/1999/XSL/Format" 
        exclude-result-prefixes="fo">
>     
        <xsl:output method="xml" version="1.0" 
        omit-xml-declaration="no"
> indent="yes"/>
> 
> 
            <xsl:template 
        match="OriginalNotification">
> 
                <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
> 
                           
> 
        xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
> 
        
> 
                    
        <fo:layout-master-set>
> 
                        
        <fo:simple-page-master master-name="simpleA4"
> 
        page-height="29.7cm" page-width="21cm" margin-top="1cm"
> 
        margin-left="1.5cm" margin-right="1.5cm" 
        margin-bottom="0.5cm">
> 
                            
        <fo:region-body margin-bottom="1.5cm"
> 
        margin-top="3cm"/>
> 
                        
        </fo:simple-page-master>
> 
                    
        </fo:layout-master-set>
> 
> 
> 
> 
                    
        <fo:declarations>
> 
                                   
        <pdf:embedded-file filename="attachments.zip"
> 
        src="url(file:///C:/attachments.zip)" 
        description="Attachments"/>
> 
                            
        </fo:declarations>
>       
         
> 
                    
        <fo:page-sequence master-reference="simpleA4">
> 
                        
        <fo:flow flow-name="xsl-region-body">
> 
                            
        <fo:block>
> 
                            
        </fo:block>
> 
                        
        </fo:flow>
> 
                    
        </fo:page-sequence>
> 
                </fo:root>
> 
        
>         <!--
> 
                    
        <fo:basic-link
> 
        external-destination="url(file:///C:/attachments.zip)">Attachments</fo:basic-link>
> 
                    
        -->
>        
> 
            </xsl:template>
> 
        </xsl:stylesheet>
> 
> 
> 
> 

-- 
        
View this message in context: http://old.nabble.com/attaching-a-zip-file-in-PDF-tp31114498p31115152.html
Sent 
        from the FOP - Users mailing list archive at 
        Nabble.com.


---------------------------------------------------------------------
To 
        unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For 
        additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


 



      

RE: attaching a zip file in PDF

Posted by Eric Douglas <ed...@blockhouse.com>.
MIME_PDF is not in FOP.
FOP's MimeConstants extends the MimeConstants from xmlgraphics.
Do you have xmlgraphics-commons-1.4.jar in your classpath?

________________________________

From: Neeraj Malik [mailto:nmquery@yahoo.co.uk] 
Sent: Thursday, March 10, 2011 10:35 AM
To: fop-users@xmlgraphics.apache.org
Cc: matthias8283@gmx.at
Subject: Re: attaching a zip file in PDF


Hello Matthias,

Many thanks.

I downloaded and tested it. It works.
Now I am integrating it in my project.

import org.apache.fop.apps.MimeConstants; 
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);

MIME_PDF is not found. 
Can you please suggest if it has been relocated?

Thanks.

Regards
Neeraj


--- On Thu, 10/3/11, Matthias Reischenbacher <ma...@gmx.at>
wrote:



	From: Matthias Reischenbacher <ma...@gmx.at>
	Subject: Re: attaching a zip file in PDF
	To: fop-users@xmlgraphics.apache.org
	Date: Thursday, 10 March, 2011, 12:28
	
	

	Neeraj,
	
	I think the PDF attachment feature was added after the 1.0
release. You
	might want to try a nightly snapshot:
	
	http://ci.apache.org/projects/xmlgraphics/fop/snapshots/
	
	HTH,
	Matthias
	
	
	nmquery wrote:
	> 
	> Hi,
	> 
	> I am not able to attach a zip file in PDF.
	> 
	> Message on console -
	> WARNING: Unknown formatting object
	>
"{http://xmlgraphics.apache.org/fop/extensions/pdf}embedded-file"
	> encountered (a child of fo:declarations}. (No context info
available)
	> 
	> I am using Apache FOP 1.0. I tried 0.95 as well.
	> 
	> Please check xsl code below.
	> 
	> Can you please suggest why its not attaching the zip in PDF?
	> 
	> Thanks.
	> 
	> Regards
	> Neeraj
	> 
	> 
	> <?xml version="1.0" encoding="UTF-8"?>
	> <xsl:stylesheet version="1.1"
	> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	> xmlns:fo="http://www.w3.org/1999/XSL/Format"
exclude-result-prefixes="fo">
	>     <xsl:output method="xml" version="1.0"
omit-xml-declaration="no"
	> indent="yes"/>
	> 
	>     <xsl:template match="OriginalNotification">
	>         <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
	>                    
	> xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
	> 
	>             <fo:layout-master-set>
	>                 <fo:simple-page-master master-name="simpleA4"
	> page-height="29.7cm" page-width="21cm" margin-top="1cm"
	> margin-left="1.5cm" margin-right="1.5cm"
margin-bottom="0.5cm">
	>                     <fo:region-body margin-bottom="1.5cm"
	> margin-top="3cm"/>
	>                 </fo:simple-page-master>
	>             </fo:layout-master-set>
	> 
	> 
	> 
	>             <fo:declarations>
	>                            <pdf:embedded-file
filename="attachments.zip"
	> src="url(file:///C:/attachments.zip)"
description="Attachments"/>
	>                     </fo:declarations>
	>        
	>             <fo:page-sequence master-reference="simpleA4">
	>                 <fo:flow flow-name="xsl-region-body">
	>                     <fo:block>
	>                     </fo:block>
	>                 </fo:flow>
	>             </fo:page-sequence>
	>         </fo:root>
	> 
	>         <!--
	>             <fo:basic-link
	>
external-destination="url(file:///C:/attachments.zip)">Attachments</fo:b
asic-link>
	>             -->
	>        
	>     </xsl:template>
	> </xsl:stylesheet>
	> 
	> 
	> 
	> 
	
	-- 
	View this message in context:
http://old.nabble.com/attaching-a-zip-file-in-PDF-tp31114498p31115152.ht
ml
	Sent from the FOP - Users mailing list archive at Nabble.com.
	
	
	
---------------------------------------------------------------------
	To unsubscribe, e-mail:
fop-users-unsubscribe@xmlgraphics.apache.org
	For additional commands, e-mail:
fop-users-help@xmlgraphics.apache.org
	
	



Re: attaching a zip file in PDF

Posted by Neeraj Malik <nm...@yahoo.co.uk>.
Hello Matthias,

Many thanks.

I downloaded and tested it. It works.
Now I am integrating it in my project.

import org.apache.fop.apps.MimeConstants; 
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);

MIME_PDF is not found. 
Can you please suggest if it has been relocated?

Thanks.

Regards
Neeraj


--- On Thu, 10/3/11, Matthias Reischenbacher <ma...@gmx.at> wrote:

From: Matthias Reischenbacher <ma...@gmx.at>
Subject: Re: attaching a zip file in PDF
To: fop-users@xmlgraphics.apache.org
Date: Thursday, 10 March, 2011, 12:28


Neeraj,

I think the PDF attachment feature was added after the 1.0 release. You
might want to try a nightly snapshot:

http://ci.apache.org/projects/xmlgraphics/fop/snapshots/

HTH,
Matthias


nmquery wrote:
> 
> Hi,
> 
> I am not able to attach a zip file in PDF.
> 
> Message on console -
> WARNING: Unknown formatting object
> "{http://xmlgraphics.apache.org/fop/extensions/pdf}embedded-file"
> encountered (a child of fo:declarations}. (No context info available)
> 
> I am using Apache FOP 1.0. I tried 0.95 as well.
> 
> Please check xsl code below.
> 
> Can you please suggest why its not attaching the zip in PDF?
> 
> Thanks.
> 
> Regards
> Neeraj
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.1"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
>     <xsl:output method="xml" version="1.0" omit-xml-declaration="no"
> indent="yes"/>
> 
>     <xsl:template match="OriginalNotification">
>         <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
>                    
> xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
> 
>             <fo:layout-master-set>
>                 <fo:simple-page-master master-name="simpleA4"
> page-height="29.7cm" page-width="21cm" margin-top="1cm"
> margin-left="1.5cm" margin-right="1.5cm" margin-bottom="0.5cm">
>                     <fo:region-body margin-bottom="1.5cm"
> margin-top="3cm"/>
>                 </fo:simple-page-master>
>             </fo:layout-master-set>
> 
> 
> 
>             <fo:declarations>
>                            <pdf:embedded-file filename="attachments.zip"
> src="url(file:///C:/attachments.zip)" description="Attachments"/>
>                     </fo:declarations>
>        
>             <fo:page-sequence master-reference="simpleA4">
>                 <fo:flow flow-name="xsl-region-body">
>                     <fo:block>
>                     </fo:block>
>                 </fo:flow>
>             </fo:page-sequence>
>         </fo:root>
> 
>         <!--
>             <fo:basic-link
> external-destination="url(file:///C:/attachments.zip)">Attachments</fo:basic-link>
>             -->
>        
>     </xsl:template>
> </xsl:stylesheet>
> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/attaching-a-zip-file-in-PDF-tp31114498p31115152.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org




      

Re: attaching a zip file in PDF

Posted by Matthias Reischenbacher <ma...@gmx.at>.
Neeraj,

I think the PDF attachment feature was added after the 1.0 release. You
might want to try a nightly snapshot:

http://ci.apache.org/projects/xmlgraphics/fop/snapshots/

HTH,
Matthias


nmquery wrote:
> 
> Hi,
> 
> I am not able to attach a zip file in PDF.
> 
> Message on console -
> WARNING: Unknown formatting object
> "{http://xmlgraphics.apache.org/fop/extensions/pdf}embedded-file"
> encountered (a child of fo:declarations}. (No context info available)
> 
> I am using Apache FOP 1.0. I tried 0.95 as well.
> 
> Please check xsl code below.
> 
> Can you please suggest why its not attaching the zip in PDF?
> 
> Thanks.
> 
> Regards
> Neeraj
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.1"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
>     <xsl:output method="xml" version="1.0" omit-xml-declaration="no"
> indent="yes"/>
> 
>     <xsl:template match="OriginalNotification">
>         <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
>                    
> xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
> 
>             <fo:layout-master-set>
>                 <fo:simple-page-master master-name="simpleA4"
> page-height="29.7cm" page-width="21cm" margin-top="1cm"
> margin-left="1.5cm" margin-right="1.5cm" margin-bottom="0.5cm">
>                     <fo:region-body margin-bottom="1.5cm"
> margin-top="3cm"/>
>                 </fo:simple-page-master>
>             </fo:layout-master-set>
> 
> 
> 
>             <fo:declarations>
>                            <pdf:embedded-file filename="attachments.zip"
> src="url(file:///C:/attachments.zip)" description="Attachments"/>
>                     </fo:declarations>
>        
>             <fo:page-sequence master-reference="simpleA4">
>                 <fo:flow flow-name="xsl-region-body">
>                     <fo:block>
>                     </fo:block>
>                 </fo:flow>
>             </fo:page-sequence>
>         </fo:root>
> 
>         <!--
>             <fo:basic-link
> external-destination="url(file:///C:/attachments.zip)">Attachments</fo:basic-link>
>             -->
>        
>     </xsl:template>
> </xsl:stylesheet>
> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/attaching-a-zip-file-in-PDF-tp31114498p31115152.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org