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:[email protected]] 
Sent: Thursday, March 10, 2011 10:35 AM
To: [email protected]
Cc: [email protected]
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 <[email protected]>
wrote:



        From: Matthias Reischenbacher <[email protected]>
        Subject: Re: attaching a zip file in PDF
        To: [email protected]
        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:
[email protected]
        For additional commands, e-mail:
[email protected]
        
        


Reply via email to