mustang/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDExporter.java
public void PDFattachZugferdFile(IZUGFeRDExportableTransaction trans)
			throws IOException, JAXBException {

		if (zugferdData == null) // XML ZUGFeRD data not set externally, needs
									// to be built
		{
			// create a dummy file stream, this would probably normally be a
			// FileInputStream

			byte[] zugferdRaw = getZugferdXMLForTransaction(trans).getBytes(); //$NON-NLS-1$

			if ((zugferdRaw[0] == (byte) 0xEF)
					&& (zugferdRaw[1] == (byte) 0xBB)
					&& (zugferdRaw[2] == (byte) 0xBF)) {
				// I don't like BOMs, lets remove it
				zugferdData = new byte[zugferdRaw.length - 3];
				System.arraycopy(zugferdRaw, 3, zugferdData, 0,
						zugferdRaw.length - 3);
			} else {
				zugferdData = zugferdRaw;
			}
		}

		PDFAttachGenericFile(
				doc,
				"ZUGFeRD-invoice.xml",
				"Alternative",
				"Invoice metadata conforming to ZUGFeRD standard (http://www.ferd-net.de/front_content.php?idcat=231&lang=4)",
				"text/xml", zugferdData);
	}
/**
	 * Embeds the Zugferd XML structure in a file named ZUGFeRD-invoice.xml.
	 *
	 * @param doc
	 *            PDDocument to attach an XML invoice to
	 * @param trans
	 *            a IZUGFeRDExportableTransaction that provides the data-model
	 *            to populate the XML. This parameter may be null, if so the XML
	 *            data should hav ebeen set via
	 *            <code>setZUGFeRDXMLData(byte[] zugferdData)</code>
	 */
Embeds the Zugferd XML structure in a file named ZUGFeRD-invoice.xml.

@param doc
PDDocument to attach an XML invoice to
@param trans
a IZUGFeRDExportableTransaction that provides the data-model
to populate the XML. This parameter may be null, if so the XML
data should hav ebeen set via
setZUGFeRDXMLData(byte[] zugferdData)
Embeds the Zugferd XML structure in a file named ZUGFeRD - invoice . xml . @param doc PDDocument to attach an XML invoice to @param trans a IZUGFeRDExportableTransaction that provides the data - model to populate the XML . This parameter may be null if so the XML data should hav ebeen set via setZUGFeRDXMLData ( byte [] zugferdData )
public void PDFattachZugferdFile(IZUGFeRDExportableTransaction trans)
			throws IOException, JAXBException {
		if (zugferdData == null) 
		{
			byte[] zugferdRaw = getZugferdXMLForTransaction(trans).getBytes(); 
			if ((zugferdRaw[0] == (byte) 0xEF)
					&& (zugferdRaw[1] == (byte) 0xBB)
					&& (zugferdRaw[2] == (byte) 0xBF)) {
				zugferdData = new byte[zugferdRaw.length - 3];
				System.arraycopy(zugferdRaw, 3, zugferdData, 0,
						zugferdRaw.length - 3);
			} else {
				zugferdData = zugferdRaw;
			}
		}
		PDFAttachGenericFile(
				doc,
				"ZUGFeRD-invoice.xml",
				"Alternative",
				"Invoice metadata conforming to ZUGFeRD standard (http://www.ferd-net.de/front_content.php?idcat=231&lang=4)",
				"text/xml", zugferdData);
	}
public void PDFattachZugferdFile ( IZUGFeRDExportableTransaction trans ) throws IOException , JAXBException { if ( zugferdData == null ) { byte [ ] zugferdRaw = getZugferdXMLForTransaction ( trans ) . getBytes ( ) ; if ( ( zugferdRaw [ 0 ] == ( byte ) 0xEF ) && ( zugferdRaw [ 1 ] == ( byte ) 0xBB ) && ( zugferdRaw [ 2 ] == ( byte ) 0xBF ) ) { zugferdData = new byte [ zugferdRaw . length - 3 ] ; System . arraycopy ( zugferdRaw , 3 , zugferdData , 0 , zugferdRaw . length - 3 ) ; } else { zugferdData = zugferdRaw ; } } PDFAttachGenericFile ( doc , "ZUGFeRD-invoice.xml" , "Alternative" , "Invoice metadata conforming to ZUGFeRD standard (http://www.ferd-net.de/front_content.php?idcat=231&lang=4)" , "text/xml" , zugferdData ) ; }
Embeds the Zugferd XML structure in a file named ZUGFeRD-invoice.xml.
Embeds the Zugferd XML structure in a file named ZUGFeRD - invoice . xml .
// XML ZUGFeRD data not set externally, needs
 // to be built
 // create a dummy file stream, this would probably normally be a
 // FileInputStream
 //$NON-NLS-1$
 // I don't like BOMs, lets remove it
