How can I convert xps to ooxml

Aug 7, 2011 at 5:36 AM

I am trying to convert .xps to .docx with libopc.  but Now I have no thought with it, help me please.

Thanks a lot for your reply!

Coordinator
Aug 11, 2011 at 8:08 AM

Hi,

 

sorry for the delayed response. 

 

Thats an interresting project converting .xps to .docx files.

I guess the approach with libopc is to use the mceTextReader to scan through the XPS pages and use the opc_generator to generate a docx template which then can be filled.

 

Hope thats helpful,

 

Florian

Aug 14, 2011 at 9:18 AM
Edited Aug 14, 2011 at 9:24 AM

Hi Florian,

But When I open some xps files generated by Microsoft XPS Document Writer with libopc,libopc couldn't open these xps normally.

Would you please give some advice or some sample with this?

Thank you

214557835

 

Coordinator
Aug 15, 2011 at 11:04 AM

Hi,

 

that sounds like a problem of libopc. Can you please open an issue and attach a the problematic xps file to it? I'll then take a look where the problem is.

 

Thanks!

 

Florian

Aug 15, 2011 at 2:21 PM
Edited Aug 15, 2011 at 2:33 PM

Hi Florian,

I try to run the code as following in vs2010:

int main( int argc, const char* argv[] )
{
    opcInitLibrary();
    opcContainer *c=opcContainerOpen(_X("xpstowordx.xps"), OPC_OPEN_READ_ONLY, NULL, NULL);
    if (NULL!=c) {
        mceTextReader_t reader;
        if (OPC_ERROR_NONE==opcXmlReaderOpen(c, &reader, _X("/Documents/1/Pages/1.fpage"), NULL, 0, 0)) {
            mce_start_document(&reader) {
                mce_start_element(&reader, NULL, NULL) {
                    printf("<html>\n");
                    printf("<head>\n");
                    printf("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
                    printf("</head>\n");
                    printf("<body>\n");
                    //dumpTextxps(&reader);
                    printf("<body>\n");
                    printf("</html>\n");
                } mce_end_element(&reader);
            } mce_end_document(&reader);
            mceTextReaderCleanup(&reader);
        }
        opcContainerClose(c, OPC_CLOSE_NOW);
    }
    opcFreeLibrary();
    return 0;
}

 The file of xpstowordx.xps was generated by Microsoft XPS Document Writer.

Thank you,

214557835

Coordinator
Aug 16, 2011 at 11:28 AM

Hi!

 

I tested your code with the "helloworld.xps" file which is part of the libopc test documents and which was created by the Microsoft XPS writer too.

Your code worked fine for me!

I added a little "dumpText" method:

static void dumpText(mceTextReader_t *reader) {
    mce_skip_attributes(reader);
    mce_start_children(reader) {
        mce_start_element(reader, _X("http://schemas.microsoft.com/xps/2005/06"), _X("Glyphs")) {
            mce_start_attributes(reader) {
                mce_start_attribute(reader, NULL, _X("UnicodeString")) {
                    for(const xmlChar *txt=xmlTextReaderConstValue(reader->reader);0!=*txt;txt++) {
                        switch(*txt) {
                        case '<': 
                            printf("&lt;");
                            break;
                        case '>': 
                            printf("&gt;");
                            break;
                        case '&': 
                            printf("&amp;");
                            break;
                        default:
                            putc(*txt, stdout);
                            break;
                        }
                    }
                }
            } mce_end_attributes(reader);
            mce_skip_children(reader);
        } mce_end_element(reader);
        mce_start_element(reader, NULL, NULL) {
            dumpText(reader);
        } mce_end_element(reader);
    } mce_end_children(reader);
}


int main( int argc, const char* argv[] )
{
    opcInitLibrary();
    opcContainer *c=opcContainerOpen(_X("C:\\dev\\libopc\\sandbox1\\test_docs\\helloworld.xps"), OPC_OPEN_READ_ONLY, NULL, NULL);
    if (NULL!=c) {
        mceTextReader_t reader;
        if (OPC_ERROR_NONE==opcXmlReaderOpen(c, &reader, _X("/Documents/1/Pages/1.fpage"), NULL, 0, 0)) {
            mce_start_document(&reader) {
                mce_start_element(&reader, NULL, NULL) {
                    printf("<html>\n");
                    printf("<head>\n");
                    printf("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
                    printf("</head>\n");
                    printf("<body>\n");
                    dumpText(&reader);
                    printf("<body>\n");
                    printf("</html>\n");
                } mce_end_element(&reader);
            } mce_end_document(&reader);
            mceTextReaderCleanup(&reader);
        }
        opcContainerClose(c, OPC_CLOSE_NOW);
    }
    opcFreeLibrary();
    return 0;
}

If there are still problem with your XPS file, can you please attach it to an issue, so that I can take a look?

 

Thanks,

 

Florian

Coordinator
Aug 17, 2011 at 9:58 PM

Hi!

 

Thanks for submitting the bugdoc in [workitem:600]. I fixed the problem upstream. Can you please check whether it works for you?

 

Florian

Aug 18, 2011 at 1:01 PM
Edited Aug 18, 2011 at 1:06 PM

Hi Florian,

Thanks a lot for fixing the problem which cann't works normally with xps files!

But it can work well now.

However,Would you please show me the code to generate a docx file?

Thank you.

214557835

 

Aug 18, 2011 at 2:34 PM
Edited Aug 18, 2011 at 2:36 PM

Hi Florian,

After I generated a c file which cann't be complied successfully by opc_generate.

Here is the code of c file generated by opc_generate.

// Automatically generated by opc_generate "xpstowordxtempl.docx" "xpstowordxtempl.c".

#include <opc/opc.h>

void writef(opcContainerOutputStream* stream, const char *s, ...) {
    va_list ap;
    va_start(ap, s);
    char buf[1024];
    int len=vsnprintf(buf, sizeof(buf), s, ap);
    opcContainerWriteOutputStream(stream, (const opc_uint8_t *)buf, len);
    va_end(ap);
}

void writes(opcContainerOutputStream* stream, const char *s) {
    int const len=strlen(s);
    opcContainerWriteOutputStream(stream, (const opc_uint8_t *)s, len);
}


void generate(opcContainer *c, FILE *out) {
     // adding registered extensions
     // adding root relations
     // adding weak parts, i.e. parts which are not referenced by a relation
}

int main( int argc, const char* argv[] ) {
    if (OPC_ERROR_NONE==opcInitLibrary() && 2==argc) {
         opcContainer *c=NULL;
         if (NULL!=(c=opcContainerOpen(_X(argv[1]), OPC_OPEN_WRITE_ONLY, NULL, NULL))) {
              generate(c, stdout);
              opcContainerClose(c, OPC_CLOSE_NOW);
         }
    } else if (argc!=2) {
         printf("target file needed!\n E.g. %s \"xpstowordxtempl.docx\"", argv[0]);
    }
}

thank you.

214557835

Coordinator
Aug 19, 2011 at 7:06 AM

Hi,

 

The test worked for me. The code above looks like you used opc_generate which still has the bug. Can you please try it again with the latest upstream version?

 

Anyway --- what you need to do is to run opc_generate on an empty Word! file. You can then use this code to plug-in you XPS reader to populate the Word document.

I'll be offline during the weekend, but I'll try to write a short HOWTO in the Wiki,

 

Florian

Aug 20, 2011 at 5:25 PM
Edited Aug 20, 2011 at 5:26 PM

Hi Florian,

The bug of the code above was fixed.

but I still can't  find the relation of xps file and docx file.

Would you please give some details about it?

Thank you!

214557835

 

Coordinator
Aug 22, 2011 at 3:17 PM

Hi!

 

To convert an XPS to a DOCX you needs to scan through the XPS pages and manually generate the DOCX file. The best thing to do is to use "opc_generate" to generate a DOCX template from an empty docx file.

The code below was generated by opc_generate and then modified to parse the XPS file and then generate the DOCX. The heuristic to recreate the DOCX structure from the XPS pages is quite simple but it should be easy to improve.

 

Hope that helps,

 

Florian

 

#include <opc/opc.h>

void writef(opcContainerOutputStream* stream, const char *s, ...) {
    va_list ap;
    va_start(ap, s);
    char buf[1024];
    int len=vsnprintf(buf, sizeof(buf), s, ap);
    opcContainerWriteOutputStream(stream, (const opc_uint8_t *)buf, len);
    va_end(ap);
}

void writes(opcContainerOutputStream* stream, const char *s) {
    int const len=strlen(s);
    opcContainerWriteOutputStream(stream, (const opc_uint8_t *)s, len);
}

static opcPart create_docProps_app_xml(opcContainer *c);
static opcPart create_docProps_core_xml(opcContainer *c);
static opcPart create_word_document_xml(opcContainer *c, opcContainer *xps);
static opcPart create_word_fontTable_xml(opcContainer *c);
static opcPart create_word_settings_xml(opcContainer *c);
static opcPart create_word_styles_xml(opcContainer *c);
static opcPart create_word_theme_theme1_xml(opcContainer *c);
static opcPart create_word_webSettings_xml(opcContainer *c);

static opcPart create_docProps_app_xml(opcContainer *c) {
     opcPart ret=opcPartFind(c, _X("docProps/app.xml"), _X("application/vnd.openxmlformats-officedocument.extended-properties+xml"), 0);
     if (OPC_PART_INVALID==ret && OPC_PART_INVALID!=(ret=opcPartCreate(c, _X("docProps/app.xml"), _X("application/vnd.openxmlformats-officedocument.extended-properties+xml"), 0))) {
         //adding content
          opcContainerOutputStream *out=opcContainerCreateOutputStream(c, ret, OPC_COMPRESSIONOPTION_NORMAL);
          if (NULL!=out) {
              writes(out, "<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\">\n");
              writes(out, "  <Template>Normal.dotm</Template>\n");
              writes(out, "  <TotalTime>0</TotalTime>\n");
              writes(out, "  <Pages>1</Pages>\n");
              writes(out, "  <Words>0</Words>\n");
              writes(out, "  <Characters>0</Characters>\n");
              writes(out, "  <Application>Microsoft Office Word</Application>\n");
              writes(out, "  <DocSecurity>0</DocSecurity>\n");
              writes(out, "  <Lines>1</Lines>\n");
              writes(out, "  <Paragraphs>1</Paragraphs>\n");
              writes(out, "  <ScaleCrop>false</ScaleCrop>\n");
              writes(out, "  <Company/>\n");
              writes(out, "  <LinksUpToDate>false</LinksUpToDate>\n");
              writes(out, "  <CharactersWithSpaces>0</CharactersWithSpaces>\n");
              writes(out, "  <SharedDoc>false</SharedDoc>\n");
              writes(out, "  <HyperlinksChanged>false</HyperlinksChanged>\n");
              writes(out, "  <AppVersion>12.0000</AppVersion>\n");
              writes(out, "</Properties>\n");
              writes(out, "");
              opcContainerCloseOutputStream(out);
          }
          // adding relations
     }
     return ret;
}

static opcPart create_docProps_core_xml(opcContainer *c) {
     opcPart ret=opcPartFind(c, _X("docProps/core.xml"), _X("application/vnd.openxmlformats-package.core-properties+xml"), 0);
     if (OPC_PART_INVALID==ret && OPC_PART_INVALID!=(ret=opcPartCreate(c, _X("docProps/core.xml"), _X("application/vnd.openxmlformats-package.core-properties+xml"), 0))) {
         //adding content
          opcContainerOutputStream *out=opcContainerCreateOutputStream(c, ret, OPC_COMPRESSIONOPTION_NORMAL);
          if (NULL!=out) {
              writes(out, "<cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n");
              writes(out, "  <dc:creator>flr</dc:creator>\n");
              writes(out, "  <cp:lastModifiedBy>flr</cp:lastModifiedBy>\n");
              writes(out, "  <cp:revision>1</cp:revision>\n");
              writes(out, "  <dcterms:created xsi:type=\"dcterms:W3CDTF\">2011-08-22T13:53:00Z</dcterms:created>\n");
              writes(out, "  <dcterms:modified xsi:type=\"dcterms:W3CDTF\">2011-08-22T13:54:00Z</dcterms:modified>\n");
              writes(out, "</cp:coreProperties>\n");
              writes(out, "");
              opcContainerCloseOutputStream(out);
          }
          // adding relations
     }
     return ret;
}

static void dumpText(mceTextReader_t *reader, opcContainerOutputStream *out, pint32_t *scanline) {
    mce_skip_attributes(reader);
    mce_start_children(reader) {
        mce_start_element(reader, _X("http://schemas.microsoft.com/xps/2005/06"), _X("Glyphs")) {
            const xmlChar *txt=NULL;
            int y=0;
            mce_start_attributes(reader) {
                mce_start_attribute(reader, NULL, _X("UnicodeString")) {
                    txt=xmlTextReaderConstValue(reader->reader);
                }
                mce_start_attribute(reader, NULL, _X("OriginY")) {
                    y=atoi((const char *)xmlTextReaderConstValue(reader->reader));
                }
            } mce_end_attributes(reader);
            if (NULL!=txt) {
                if (NULL!=scanline && *scanline!=y) {
                    if (PINT32_MIN!=*scanline) {
                        writes(out, "    </w:p>");
                    }
                    writes(out, "    <w:p>");
                    *scanline=y;
                }
                writes(out, "<w:r><w:t>");
                writes(out, (const char *)txt);
                writes(out, "</w:t></w:r>");
            }
            mce_skip_children(reader);
        } mce_end_element(reader);
        mce_start_element(reader, NULL, NULL) {
            dumpText(reader, out, scanline);
        } mce_end_element(reader);
    } mce_end_children(reader);
}


static opcPart create_word_document_xml(opcContainer *c, opcContainer *xps) {
     opcPart ret=opcPartFind(c, _X("word/document.xml"), _X("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"), 0);
     if (OPC_PART_INVALID==ret && OPC_PART_INVALID!=(ret=opcPartCreate(c, _X("word/document.xml"), _X("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"), 0))) {
         //adding content
          opcContainerOutputStream *out=opcContainerCreateOutputStream(c, ret, OPC_COMPRESSIONOPTION_NORMAL);
          if (NULL!=out) {
              writes(out, "<w:document xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\">\n");
              writes(out, "  <w:body>\n");
              mceTextReader_t reader;
              if (OPC_ERROR_NONE==opcXmlReaderOpen(xps, &reader, _X("/Documents/1/Pages/1.fpage"), NULL, 0, 0)) {
                  mce_start_document(&reader) {
                      mce_start_element(&reader, NULL, NULL) {
                          pint32_t scanline=PINT32_MIN;
                          dumpText(&reader, out, &scanline);
                          if (PINT32_MIN!=scanline) {
                              writes(out, "    </w:p>");
                          }
                      } mce_end_element(&reader);
                  } mce_end_document(&reader);
                  mceTextReaderCleanup(&reader);
              }                  ;
              writes(out, "    <w:sectPr w:rsidR=\"00EB187D\" w:rsidSect=\"00EB187D\">\n");
              writes(out, "      <w:pgSz w:w=\"11906\" w:h=\"16838\"/>\n");
              writes(out, "      <w:pgMar w:top=\"1417\" w:right=\"1417\" w:bottom=\"1134\" w:left=\"1417\" w:header=\"708\" w:footer=\"708\" w:gutter=\"0\"/>\n");
              writes(out, "      <w:cols w:space=\"708\"/>\n");
              writes(out, "      <w:docGrid w:linePitch=\"360\"/>\n");
              writes(out, "    </w:sectPr>\n");
              writes(out, "  </w:body>\n");
              writes(out, "</w:document>\n");
              writes(out, "");
              opcContainerCloseOutputStream(out);
          }
          // adding relations
          opcRelationAdd(c, ret, _X("rId1"), create_word_styles_xml(c), _X("http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"));
          opcRelationAdd(c, ret, _X("rId2"), create_word_settings_xml(c), _X("http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"));
          opcRelationAdd(c, ret, _X("rId3"), create_word_webSettings_xml(c), _X("http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings"));
          opcRelationAdd(c, ret, _X("rId4"), create_word_fontTable_xml(c), _X("http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"));
          opcRelationAdd(c, ret, _X("rId5"), create_word_theme_theme1_xml(c), _X("http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"));
     }
     return ret;
}

static opcPart create_word_fontTable_xml(opcContainer *c) {
     opcPart ret=opcPartFind(c, _X("word/fontTable.xml"), _X("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"), 0);
     if (OPC_PART_INVALID==ret && OPC_PART_INVALID!=(ret=opcPartCreate(c, _X("word/fontTable.xml"), _X("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"), 0))) {
         //adding content
          opcContainerOutputStream *out=opcContainerCreateOutputStream(c, ret, OPC_COMPRESSIONOPTION_NORMAL);
          if (NULL!=out) {
              writes(out, "<w:fonts xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">\n");
              writes(out, "  <w:font w:name=\"Calibri\">\n");
              writes(out, "    <w:panose1 w:val=\"020F0502020204030204\"/>\n");
              writes(out, "    <w:charset w:val=\"00\"/>\n");
              writes(out, "    <w:family w:val=\"swiss\"/>\n");
              writes(out, "    <w:pitch w:val=\"variable\"/>\n");
              writes(out, "    <w:sig w:usb0=\"E10002FF\" w:usb1=\"4000ACFF\" w:usb2=\"00000009\" w:usb3=\"00000000\" w:csb0=\"0000019F\" w:csb1=\"00000000\"/>\n");
              writes(out, "  </w:font>\n");
              writes(out, "  <w:font w:name=\"Times New Roman\">\n");
              writes(out, "    <w:panose1 w:val=\"02020603050405020304\"/>\n");
              writes(out, "    <w:charset w:val=\"00\"/>\n");
              writes(out, "    <w:family w:val=\"roman\"/>\n");
              writes(out, "    <w:pitch w:val=\"variable\"/>\n");
              writes(out, "    <w:sig w:usb0=\"E0002AFF\" w:usb1=\"C0007841\" w:usb2=\"00000009\" w:usb3=\"00000000\" w:csb0=\"000001FF\" w:csb1=\"00000000\"/>\n");
              writes(out, "  </w:font>\n");
              writes(out, "  <w:font w:name=\"Cambria\">\n");
              writes(out, "    <w:panose1 w:val=\"02040503050406030204\"/>\n");
              writes(out, "    <w:charset w:val=\"00\"/>\n");
              writes(out, "    <w:family w:val=\"roman\"/>\n");
              writes(out, "    <w:pitch w:val=\"variable\"/>\n");
              writes(out, "    <w:sig w:usb0=\"E00002FF\" w:usb1=\"400004FF\" w:usb2=\"00000000\" w:usb3=\"00000000\" w:csb0=\"0000019F\" w:csb1=\"00000000\"/>\n");
              writes(out, "  </w:font>\n");
              writes(out, "</w:fonts>\n");
              writes(out, "");
              opcContainerCloseOutputStream(out);
          }
          // adding relations
     }
     return ret;
}

static opcPart create_word_settings_xml(opcContainer *c) {
     opcPart ret=opcPartFind(c, _X("word/settings.xml"), _X("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"), 0);
     if (OPC_PART_INVALID==ret && OPC_PART_INVALID!=(ret=opcPartCreate(c, _X("word/settings.xml"), _X("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"), 0))) {
         //adding content
          opcContainerOutputStream *out=opcContainerCreateOutputStream(c, ret, OPC_COMPRESSIONOPTION_NORMAL);
          if (NULL!=out) {
              writes(out, "<w:settings xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:sl=\"http://schemas.openxmlformats.org/schemaLibrary/2006/main\">\n");
              writes(out, "  <w:zoom w:percent=\"130\"/>\n");
              writes(out, "  <w:defaultTabStop w:val=\"708\"/>\n");
              writes(out, "  <w:hyphenationZone w:val=\"425\"/>\n");
              writes(out, "  <w:characterSpacingControl w:val=\"doNotCompress\"/>\n");
              writes(out, "  <w:compat/>\n");
              writes(out, "  <w:rsids>\n");
              writes(out, "    <w:rsidRoot w:val=\"00EE56AD\"/>\n");
              writes(out, "    <w:rsid w:val=\"002B45DC\"/>\n");
              writes(out, "    <w:rsid w:val=\"00EB187D\"/>\n");
              writes(out, "    <w:rsid w:val=\"00EE56AD\"/>\n");
              writes(out, "  </w:rsids>\n");
              writes(out, "  <m:mathPr>\n");
              writes(out, "    <m:mathFont m:val=\"Cambria Math\"/>\n");
              writes(out, "    <m:brkBin m:val=\"before\"/>\n");
              writes(out, "    <m:brkBinSub m:val=\"--\"/>\n");
              writes(out, "    <m:smallFrac/>\n");
              writes(out, "    <m:dispDef/>\n");
              writes(out, "    <m:lMargin m:val=\"0\"/>\n");
              writes(out, "    <m:rMargin m:val=\"0\"/>\n");
              writes(out, "    <m:defJc m:val=\"centerGroup\"/>\n");
              writes(out, "    <m:wrapIndent m:val=\"1440\"/>\n");
              writes(out, "    <m:intLim m:val=\"subSup\"/>\n");
              writes(out, "    <m:naryLim m:val=\"undOvr\"/>\n");
              writes(out, "  </m:mathPr>\n");
              writes(out, "  <w:themeFontLang w:val=\"de-DE\"/>\n");
              writes(out, "  <w:clrSchemeMapping w:bg1=\"light1\" w:t1=\"dark1\" w:bg2=\"light2\" w:t2=\"dark2\" w:accent1=\"accent1\" w:accent2=\"accent2\" w:accent3=\"accent3\" w:accent4=\"accent4\" w:accent5=\"accent5\" w:accent6=\"accent6\" w:hyperlink=\"hyperlink\" w:followedHyperlink=\"followedHyperlink\"/>\n");
              writes(out, "  <w:shapeDefaults>\n");
              writes(out, "    <o:shapedefaults v:ext=\"edit\" spidmax=\"2050\"/>\n");
              writes(out, "    <o:shapelayout v:ext=\"edit\">\n");
              writes(out, "      <o:idmap v:ext=\"edit\" data=\"1\"/>\n");
              writes(out, "    </o:shapelayout>\n");
              writes(out, "  </w:shapeDefaults>\n");
              writes(out, "  <w:decimalSymbol w:val=\",\"/>\n");
              writes(out, "  <w:listSeparator w:val=\";\"/>\n");
              writes(out, "</w:settings>\n");
              writes(out, "");
              opcContainerCloseOutputStream(out);
          }
          // adding relations
     }
     return ret;
}

static opcPart create_word_styles_xml(opcContainer *c) {
     opcPart ret=opcPartFind(c, _X("word/styles.xml"), _X("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"), 0);
     if (OPC_PART_INVALID==ret && OPC_PART_INVALID!=(ret=opcPartCreate(c, _X("word/styles.xml"), _X("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"), 0))) {
         //adding content
          opcContainerOutputStream *out=opcContainerCreateOutputStream(c, ret, OPC_COMPRESSIONOPTION_NORMAL);
          if (NULL!=out) {
              writes(out, "<w:styles xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">\n");
              writes(out, "  <w:docDefaults>\n");
              writes(out, "    <w:rPrDefault>\n");
              writes(out, "      <w:rPr>\n");
              writes(out, "        <w:rFonts w:asciiTheme=\"minorHAnsi\" w:eastAsiaTheme=\"minorHAnsi\" w:hAnsiTheme=\"minorHAnsi\" w:cstheme=\"minorBidi\"/>\n");
              writes(out, "        <w:sz w:val=\"22\"/>\n");
              writes(out, "        <w:szCs w:val=\"22\"/>\n");
              writes(out, "        <w:lang w:val=\"de-DE\" w:eastAsia=\"en-US\" w:bidi=\"ar-SA\"/>\n");
              writes(out, "      </w:rPr>\n");
              writes(out, "    </w:rPrDefault>\n");
              writes(out, "    <w:pPrDefault>\n");
              writes(out, "      <w:pPr>\n");
              writes(out, "        <w:spacing w:after=\"200\" w:line=\"276\" w:lineRule=\"auto\"/>\n");
              writes(out, "      </w:pPr>\n");
              writes(out, "    </w:pPrDefault>\n");
              writes(out, "  </w:docDefaults>\n");
              writes(out, "  <w:latentStyles w:defLockedState=\"0\" w:defUIPriority=\"99\" w:defSemiHidden=\"1\" w:defUnhideWhenUsed=\"1\" w:defQFormat=\"0\" w:count=\"267\">\n");
              writes(out, "    <w:lsdException w:name=\"Normal\" w:semiHidden=\"0\" w:uiPriority=\"0\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"heading 1\" w:semiHidden=\"0\" w:uiPriority=\"9\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"heading 2\" w:uiPriority=\"9\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"heading 3\" w:uiPriority=\"9\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"heading 4\" w:uiPriority=\"9\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"heading 5\" w:uiPriority=\"9\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"heading 6\" w:uiPriority=\"9\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"heading 7\" w:uiPriority=\"9\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"heading 8\" w:uiPriority=\"9\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"heading 9\" w:uiPriority=\"9\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"toc 1\" w:uiPriority=\"39\"/>\n");
              writes(out, "    <w:lsdException w:name=\"toc 2\" w:uiPriority=\"39\"/>\n");
              writes(out, "    <w:lsdException w:name=\"toc 3\" w:uiPriority=\"39\"/>\n");
              writes(out, "    <w:lsdException w:name=\"toc 4\" w:uiPriority=\"39\"/>\n");
              writes(out, "    <w:lsdException w:name=\"toc 5\" w:uiPriority=\"39\"/>\n");
              writes(out, "    <w:lsdException w:name=\"toc 6\" w:uiPriority=\"39\"/>\n");
              writes(out, "    <w:lsdException w:name=\"toc 7\" w:uiPriority=\"39\"/>\n");
              writes(out, "    <w:lsdException w:name=\"toc 8\" w:uiPriority=\"39\"/>\n");
              writes(out, "    <w:lsdException w:name=\"toc 9\" w:uiPriority=\"39\"/>\n");
              writes(out, "    <w:lsdException w:name=\"caption\" w:uiPriority=\"35\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Title\" w:semiHidden=\"0\" w:uiPriority=\"10\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Default Paragraph Font\" w:uiPriority=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Subtitle\" w:semiHidden=\"0\" w:uiPriority=\"11\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Strong\" w:semiHidden=\"0\" w:uiPriority=\"22\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Emphasis\" w:semiHidden=\"0\" w:uiPriority=\"20\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Table Grid\" w:semiHidden=\"0\" w:uiPriority=\"59\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Placeholder Text\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"No Spacing\" w:semiHidden=\"0\" w:uiPriority=\"1\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Shading\" w:semiHidden=\"0\" w:uiPriority=\"60\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light List\" w:semiHidden=\"0\" w:uiPriority=\"61\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Grid\" w:semiHidden=\"0\" w:uiPriority=\"62\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 1\" w:semiHidden=\"0\" w:uiPriority=\"63\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 2\" w:semiHidden=\"0\" w:uiPriority=\"64\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 1\" w:semiHidden=\"0\" w:uiPriority=\"65\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 2\" w:semiHidden=\"0\" w:uiPriority=\"66\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 1\" w:semiHidden=\"0\" w:uiPriority=\"67\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 2\" w:semiHidden=\"0\" w:uiPriority=\"68\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 3\" w:semiHidden=\"0\" w:uiPriority=\"69\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Dark List\" w:semiHidden=\"0\" w:uiPriority=\"70\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Shading\" w:semiHidden=\"0\" w:uiPriority=\"71\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful List\" w:semiHidden=\"0\" w:uiPriority=\"72\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Grid\" w:semiHidden=\"0\" w:uiPriority=\"73\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Shading Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"60\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light List Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"61\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Grid Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"62\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 1 Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"63\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 2 Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"64\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 1 Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"65\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Revision\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"List Paragraph\" w:semiHidden=\"0\" w:uiPriority=\"34\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Quote\" w:semiHidden=\"0\" w:uiPriority=\"29\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Intense Quote\" w:semiHidden=\"0\" w:uiPriority=\"30\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 2 Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"66\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 1 Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"67\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 2 Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"68\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 3 Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"69\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Dark List Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"70\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Shading Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"71\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful List Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"72\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Grid Accent 1\" w:semiHidden=\"0\" w:uiPriority=\"73\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Shading Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"60\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light List Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"61\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Grid Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"62\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 1 Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"63\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 2 Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"64\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 1 Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"65\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 2 Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"66\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 1 Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"67\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 2 Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"68\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 3 Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"69\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Dark List Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"70\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Shading Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"71\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful List Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"72\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Grid Accent 2\" w:semiHidden=\"0\" w:uiPriority=\"73\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Shading Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"60\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light List Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"61\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Grid Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"62\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 1 Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"63\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 2 Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"64\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 1 Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"65\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 2 Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"66\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 1 Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"67\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 2 Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"68\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 3 Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"69\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Dark List Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"70\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Shading Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"71\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful List Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"72\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Grid Accent 3\" w:semiHidden=\"0\" w:uiPriority=\"73\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Shading Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"60\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light List Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"61\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Grid Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"62\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 1 Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"63\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 2 Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"64\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 1 Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"65\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 2 Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"66\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 1 Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"67\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 2 Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"68\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 3 Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"69\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Dark List Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"70\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Shading Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"71\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful List Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"72\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Grid Accent 4\" w:semiHidden=\"0\" w:uiPriority=\"73\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Shading Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"60\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light List Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"61\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Grid Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"62\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 1 Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"63\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 2 Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"64\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 1 Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"65\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 2 Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"66\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 1 Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"67\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 2 Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"68\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 3 Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"69\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Dark List Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"70\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Shading Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"71\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful List Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"72\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Grid Accent 5\" w:semiHidden=\"0\" w:uiPriority=\"73\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Shading Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"60\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light List Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"61\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Light Grid Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"62\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 1 Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"63\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Shading 2 Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"64\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 1 Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"65\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium List 2 Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"66\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 1 Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"67\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 2 Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"68\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Medium Grid 3 Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"69\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Dark List Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"70\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Shading Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"71\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful List Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"72\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Colorful Grid Accent 6\" w:semiHidden=\"0\" w:uiPriority=\"73\" w:unhideWhenUsed=\"0\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Subtle Emphasis\" w:semiHidden=\"0\" w:uiPriority=\"19\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Intense Emphasis\" w:semiHidden=\"0\" w:uiPriority=\"21\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Subtle Reference\" w:semiHidden=\"0\" w:uiPriority=\"31\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Intense Reference\" w:semiHidden=\"0\" w:uiPriority=\"32\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Book Title\" w:semiHidden=\"0\" w:uiPriority=\"33\" w:unhideWhenUsed=\"0\" w:qFormat=\"1\"/>\n");
              writes(out, "    <w:lsdException w:name=\"Bibliography\" w:uiPriority=\"37\"/>\n");
              writes(out, "    <w:lsdException w:name=\"TOC Heading\" w:uiPriority=\"39\" w:qFormat=\"1\"/>\n");
              writes(out, "  </w:latentStyles>\n");
              writes(out, "  <w:style w:type=\"paragraph\" w:default=\"1\" w:styleId=\"Standard\">\n");
              writes(out, "    <w:name w:val=\"Normal\"/>\n");
              writes(out, "    <w:qFormat/>\n");
              writes(out, "    <w:rsid w:val=\"00EB187D\"/>\n");
              writes(out, "  </w:style>\n");
              writes(out, "  <w:style w:type=\"character\" w:default=\"1\" w:styleId=\"Absatz-Standardschriftart\">\n");
              writes(out, "    <w:name w:val=\"Default Paragraph Font\"/>\n");
              writes(out, "    <w:uiPriority w:val=\"1\"/>\n");
              writes(out, "    <w:semiHidden/>\n");
              writes(out, "    <w:unhideWhenUsed/>\n");
              writes(out, "  </w:style>\n");
              writes(out, "  <w:style w:type=\"table\" w:default=\"1\" w:styleId=\"NormaleTabelle\">\n");
              writes(out, "    <w:name w:val=\"Normal Table\"/>\n");
              writes(out, "    <w:uiPriority w:val=\"99\"/>\n");
              writes(out, "    <w:semiHidden/>\n");
              writes(out, "    <w:unhideWhenUsed/>\n");
              writes(out, "    <w:qFormat/>\n");
              writes(out, "    <w:tblPr>\n");
              writes(out, "      <w:tblInd w:w=\"0\" w:type=\"dxa\"/>\n");
              writes(out, "      <w:tblCellMar>\n");
              writes(out, "        <w:top w:w=\"0\" w:type=\"dxa\"/>\n");
              writes(out, "        <w:left w:w=\"108\" w:type=\"dxa\"/>\n");
              writes(out, "        <w:bottom w:w=\"0\" w:type=\"dxa\"/>\n");
              writes(out, "        <w:right w:w=\"108\" w:type=\"dxa\"/>\n");
              writes(out, "      </w:tblCellMar>\n");
              writes(out, "    </w:tblPr>\n");
              writes(out, "  </w:style>\n");
              writes(out, "  <w:style w:type=\"numbering\" w:default=\"1\" w:styleId=\"KeineListe\">\n");
              writes(out, "    <w:name w:val=\"No List\"/>\n");
              writes(out, "    <w:uiPriority w:val=\"99\"/>\n");
              writes(out, "    <w:semiHidden/>\n");
              writes(out, "    <w:unhideWhenUsed/>\n");
              writes(out, "  </w:style>\n");
              writes(out, "</w:styles>\n");
              writes(out, "");
              opcContainerCloseOutputStream(out);
          }
          // adding relations
     }
     return ret;
}

static opcPart create_word_theme_theme1_xml(opcContainer *c) {
     opcPart ret=opcPartFind(c, _X("word/theme/theme1.xml"), _X("application/vnd.openxmlformats-officedocument.theme+xml"), 0);
     if (OPC_PART_INVALID==ret && OPC_PART_INVALID!=(ret=opcPartCreate(c, _X("word/theme/theme1.xml"), _X("application/vnd.openxmlformats-officedocument.theme+xml"), 0))) {
         //adding content
          opcContainerOutputStream *out=opcContainerCreateOutputStream(c, ret, OPC_COMPRESSIONOPTION_NORMAL);
          if (NULL!=out) {
              writes(out, "<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\">\n");
              writes(out, "  <a:themeElements>\n");
              writes(out, "    <a:clrScheme name=\"Office\">\n");
              writes(out, "      <a:dk1>\n");
              writes(out, "        <a:sysClr val=\"windowText\" lastClr=\"000000\"/>\n");
              writes(out, "      </a:dk1>\n");
              writes(out, "      <a:lt1>\n");
              writes(out, "        <a:sysClr val=\"window\" lastClr=\"FFFFFF\"/>\n");
              writes(out, "      </a:lt1>\n");
              writes(out, "      <a:dk2>\n");
              writes(out, "        <a:srgbClr val=\"1F497D\"/>\n");
              writes(out, "      </a:dk2>\n");
              writes(out, "      <a:lt2>\n");
              writes(out, "        <a:srgbClr val=\"EEECE1\"/>\n");
              writes(out, "      </a:lt2>\n");
              writes(out, "      <a:accent1>\n");
              writes(out, "        <a:srgbClr val=\"4F81BD\"/>\n");
              writes(out, "      </a:accent1>\n");
              writes(out, "      <a:accent2>\n");
              writes(out, "        <a:srgbClr val=\"C0504D\"/>\n");
              writes(out, "      </a:accent2>\n");
              writes(out, "      <a:accent3>\n");
              writes(out, "        <a:srgbClr val=\"9BBB59\"/>\n");
              writes(out, "      </a:accent3>\n");
              writes(out, "      <a:accent4>\n");
              writes(out, "        <a:srgbClr val=\"8064A2\"/>\n");
              writes(out, "      </a:accent4>\n");
              writes(out, "      <a:accent5>\n");
              writes(out, "        <a:srgbClr val=\"4BACC6\"/>\n");
              writes(out, "      </a:accent5>\n");
              writes(out, "      <a:accent6>\n");
              writes(out, "        <a:srgbClr val=\"F79646\"/>\n");
              writes(out, "      </a:accent6>\n");
              writes(out, "      <a:hlink>\n");
              writes(out, "        <a:srgbClr val=\"0000FF\"/>\n");
              writes(out, "      </a:hlink>\n");
              writes(out, "      <a:folHlink>\n");
              writes(out, "        <a:srgbClr val=\"800080\"/>\n");
              writes(out, "      </a:folHlink>\n");
              writes(out, "    </a:clrScheme>\n");
              writes(out, "    <a:fontScheme name=\"Office\">\n");
              writes(out, "      <a:majorFont>\n");
              writes(out, "        <a:latin typeface=\"Cambria\"/>\n");
              writes(out, "        <a:ea typeface=\"\"/>\n");
              writes(out, "        <a:cs typeface=\"\"/>\n");
              writes(out, "        <a:font script=\"Jpan\" typeface=\"&#65325;&#65331; &#12468;&#12471;&#12483;&#12463;\"/>\n");
              writes(out, "        <a:font script=\"Hang\" typeface=\"&#47569;&#51008; &#44256;&#46357;\"/>\n");
              writes(out, "        <a:font script=\"Hans\" typeface=\"&#23435;&#20307;\"/>\n");
              writes(out, "        <a:font script=\"Hant\" typeface=\"&#26032;&#32048;&#26126;&#39636;\"/>\n");
              writes(out, "        <a:font script=\"Arab\" typeface=\"Times New Roman\"/>\n");
              writes(out, "        <a:font script=\"Hebr\" typeface=\"Times New Roman\"/>\n");
              writes(out, "        <a:font script=\"Thai\" typeface=\"Angsana New\"/>\n");
              writes(out, "        <a:font script=\"Ethi\" typeface=\"Nyala\"/>\n");
              writes(out, "        <a:font script=\"Beng\" typeface=\"Vrinda\"/>\n");
              writes(out, "        <a:font script=\"Gujr\" typeface=\"Shruti\"/>\n");
              writes(out, "        <a:font script=\"Khmr\" typeface=\"MoolBoran\"/>\n");
              writes(out, "        <a:font script=\"Knda\" typeface=\"Tunga\"/>\n");
              writes(out, "        <a:font script=\"Guru\" typeface=\"Raavi\"/>\n");
              writes(out, "        <a:font script=\"Cans\" typeface=\"Euphemia\"/>\n");
              writes(out, "        <a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/>\n");
              writes(out, "        <a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/>\n");
              writes(out, "        <a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/>\n");
              writes(out, "        <a:font script=\"Thaa\" typeface=\"MV Boli\"/>\n");
              writes(out, "        <a:font script=\"Deva\" typeface=\"Mangal\"/>\n");
              writes(out, "        <a:font script=\"Telu\" typeface=\"Gautami\"/>\n");
              writes(out, "        <a:font script=\"Taml\" typeface=\"Latha\"/>\n");
              writes(out, "        <a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/>\n");
              writes(out, "        <a:font script=\"Orya\" typeface=\"Kalinga\"/>\n");
              writes(out, "        <a:font script=\"Mlym\" typeface=\"Kartika\"/>\n");
              writes(out, "        <a:font script=\"Laoo\" typeface=\"DokChampa\"/>\n");
              writes(out, "        <a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/>\n");
              writes(out, "        <a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/>\n");
              writes(out, "        <a:font script=\"Viet\" typeface=\"Times New Roman\"/>\n");
              writes(out, "        <a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/>\n");
              writes(out, "        <a:font script=\"Geor\" typeface=\"Sylfaen\"/>\n");
              writes(out, "      </a:majorFont>\n");
              writes(out, "      <a:minorFont>\n");
              writes(out, "        <a:latin typeface=\"Calibri\"/>\n");
              writes(out, "        <a:ea typeface=\"\"/>\n");
              writes(out, "        <a:cs typeface=\"\"/>\n");
              writes(out, "        <a:font script=\"Jpan\" typeface=\"&#65325;&#65331; &#26126;&#26397;\"/>\n");
              writes(out, "        <a:font script=\"Hang\" typeface=\"&#47569;&#51008; &#44256;&#46357;\"/>\n");
              writes(out, "        <a:font script=\"Hans\" typeface=\"&#23435;&#20307;\"/>\n");
              writes(out, "        <a:font script=\"Hant\" typeface=\"&#26032;&#32048;&#26126;&#39636;\"/>\n");
              writes(out, "        <a:font script=\"Arab\" typeface=\"Arial\"/>\n");
              writes(out, "        <a:font script=\"Hebr\" typeface=\"Arial\"/>\n");
              writes(out, "        <a:font script=\"Thai\" typeface=\"Cordia New\"/>\n");
              writes(out, "        <a:font script=\"Ethi\" typeface=\"Nyala\"/>\n");
              writes(out, "        <a:font script=\"Beng\" typeface=\"Vrinda\"/>\n");
              writes(out, "        <a:font script=\"Gujr\" typeface=\"Shruti\"/>\n");
              writes(out, "        <a:font script=\"Khmr\" typeface=\"DaunPenh\"/>\n");
              writes(out, "        <a:font script=\"Knda\" typeface=\"Tunga\"/>\n");
              writes(out, "        <a:font script=\"Guru\" typeface=\"Raavi\"/>\n");
              writes(out, "        <a:font script=\"Cans\" typeface=\"Euphemia\"/>\n");
              writes(out, "        <a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/>\n");
              writes(out, "        <a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/>\n");
              writes(out, "        <a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/>\n");
              writes(out, "        <a:font script=\"Thaa\" typeface=\"MV Boli\"/>\n");
              writes(out, "        <a:font script=\"Deva\" typeface=\"Mangal\"/>\n");
              writes(out, "        <a:font script=\"Telu\" typeface=\"Gautami\"/>\n");
              writes(out, "        <a:font script=\"Taml\" typeface=\"Latha\"/>\n");
              writes(out, "        <a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/>\n");
              writes(out, "        <a:font script=\"Orya\" typeface=\"Kalinga\"/>\n");
              writes(out, "        <a:font script=\"Mlym\" typeface=\"Kartika\"/>\n");
              writes(out, "        <a:font script=\"Laoo\" typeface=\"DokChampa\"/>\n");
              writes(out, "        <a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/>\n");
              writes(out, "        <a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/>\n");
              writes(out, "        <a:font script=\"Viet\" typeface=\"Arial\"/>\n");
              writes(out, "        <a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/>\n");
              writes(out, "        <a:font script=\"Geor\" typeface=\"Sylfaen\"/>\n");
              writes(out, "      </a:minorFont>\n");
              writes(out, "    </a:fontScheme>\n");
              writes(out, "    <a:fmtScheme name=\"Office\">\n");
              writes(out, "      <a:fillStyleLst>\n");
              writes(out, "        <a:solidFill>\n");
              writes(out, "          <a:schemeClr val=\"phClr\"/>\n");
              writes(out, "        </a:solidFill>\n");
              writes(out, "        <a:gradFill rotWithShape=\"1\">\n");
              writes(out, "          <a:gsLst>\n");
              writes(out, "            <a:gs pos=\"0\">\n");
              writes(out, "              <a:schemeClr val=\"phClr\">\n");
              writes(out, "                <a:tint val=\"50000\"/>\n");
              writes(out, "                <a:satMod val=\"300000\"/>\n");
              writes(out, "              </a:schemeClr>\n");
              writes(out, "            </a:gs>\n");
              writes(out, "            <a:gs pos=\"35000\">\n");
              writes(out, "              <a:schemeClr val=\"phClr\">\n");
              writes(out, "                <a:tint val=\"37000\"/>\n");
              writes(out, "                <a:satMod val=\"300000\"/>\n");
              writes(out, "              </a:schemeClr>\n");
              writes(out, "            </a:gs>\n");
              writes(out, "            <a:gs pos=\"100000\">\n");
              writes(out, "              <a:schemeClr val=\"phClr\">\n");
              writes(out, "                <a:tint val=\"15000\"/>\n");
              writes(out, "                <a:satMod val=\"350000\"/>\n");
              writes(out, "              </a:schemeClr>\n");
              writes(out, "            </a:gs>\n");
              writes(out, "          </a:gsLst>\n");
              writes(out, "          <a:lin ang=\"16200000\" scaled=\"1\"/>\n");
              writes(out, "        </a:gradFill>\n");
              writes(out, "        <a:gradFill rotWithShape=\"1\">\n");
              writes(out, "          <a:gsLst>\n");
              writes(out, "            <a:gs pos=\"0\">\n");
              writes(out, "              <a:schemeClr val=\"phClr\">\n");
              writes(out, "                <a:shade val=\"51000\"/>\n");
              writes(out, "                <a:satMod val=\"130000\"/>\n");
              writes(out, "              </a:schemeClr>\n");
              writes(out, "            </a:gs>\n");
              writes(out, "            <a:gs pos=\"80000\">\n");
              writes(out, "              <a:schemeClr val=\"phClr\">\n");
              writes(out, "                <a:shade val=\"93000\"/>\n");
              writes(out, "                <a:satMod val=\"130000\"/>\n");
              writes(out, "              </a:schemeClr>\n");
              writes(out, "            </a:gs>\n");
              writes(out, "            <a:gs pos=\"100000\">\n");
              writes(out, "              <a:schemeClr val=\"phClr\">\n");
              writes(out, "                <a:shade val=\"94000\"/>\n");
              writes(out, "                <a:satMod val=\"135000\"/>\n");
              writes(out, "              </a:schemeClr>\n");
              writes(out, "            </a:gs>\n");
              writes(out, "          </a:gsLst>\n");
              writes(out, "          <a:lin ang=\"16200000\" scaled=\"0\"/>\n");
              writes(out, "        </a:gradFill>\n");
              writes(out, "      </a:fillStyleLst>\n");
              writes(out, "      <a:lnStyleLst>\n");
              writes(out, "        <a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\n");
              writes(out, "          <a:solidFill>\n");
              writes(out, "            <a:schemeClr val=\"phClr\">\n");
              writes(out, "              <a:shade val=\"95000\"/>\n");
              writes(out, "              <a:satMod val=\"105000\"/>\n");
              writes(out, "            </a:schemeClr>\n");
              writes(out, "          </a:solidFill>\n");
              writes(out, "          <a:prstDash val=\"solid\"/>\n");
              writes(out, "        </a:ln>\n");
              writes(out, "        <a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\n");
              writes(out, "          <a:solidFill>\n");
              writes(out, "            <a:schemeClr val=\"phClr\"/>\n");
              writes(out, "          </a:solidFill>\n");
              writes(out, "          <a:prstDash val=\"solid\"/>\n");
              writes(out, "        </a:ln>\n");
              writes(out, "        <a:ln w=\"38100\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\n");
              writes(out, "          <a:solidFill>\n");
              writes(out, "            <a:schemeClr val=\"phClr\"/>\n");
              writes(out, "          </a:solidFill>\n");
              writes(out, "          <a:prstDash val=\"solid\"/>\n");
              writes(out, "        </a:ln>\n");
              writes(out, "      </a:lnStyleLst>\n");
              writes(out, "      <a:effectStyleLst>\n");
              writes(out, "        <a:effectStyle>\n");
              writes(out, "          <a:effectLst>\n");
              writes(out, "            <a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\">\n");
              writes(out, "              <a:srgbClr val=\"000000\">\n");
              writes(out, "                <a:alpha val=\"38000\"/>\n");
              writes(out, "              </a:srgbClr>\n");
              writes(out, "            </a:outerShdw>\n");
              writes(out, "          </a:effectLst>\n");
              writes(out, "        </a:effectStyle>\n");
              writes(out, "        <a:effectStyle>\n");
              writes(out, "          <a:effectLst>\n");
              writes(out, "            <a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">\n");
              writes(out, "              <a:srgbClr val=\"000000\">\n");
              writes(out, "                <a:alpha val=\"35000\"/>\n");
              writes(out, "              </a:srgbClr>\n");
              writes(out, "            </a:outerShdw>\n");
              writes(out, "          </a:effectLst>\n");
              writes(out, "        </a:effectStyle>\n");
              writes(out, "        <a:effectStyle>\n");
              writes(out, "          <a:effectLst>\n");
              writes(out, "            <a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">\n");
              writes(out, "              <a:srgbClr val=\"000000\">\n");
              writes(out, "                <a:alpha val=\"35000\"/>\n");
              writes(out, "              </a:srgbClr>\n");
              writes(out, "            </a:outerShdw>\n");
              writes(out, "          </a:effectLst>\n");
              writes(out, "          <a:scene3d>\n");
              writes(out, "            <a:camera prst=\"orthographicFront\">\n");
              writes(out, "              <a:rot lat=\"0\" lon=\"0\" rev=\"0\"/>\n");
              writes(out, "            </a:camera>\n");
              writes(out, "            <a:lightRig rig=\"threePt\" dir=\"t\">\n");
              writes(out, "              <a:rot lat=\"0\" lon=\"0\" rev=\"1200000\"/>\n");
              writes(out, "            </a:lightRig>\n");
              writes(out, "          </a:scene3d>\n");
              writes(out, "          <a:sp3d>\n");
              writes(out, "            <a:bevelT w=\"63500\" h=\"25400\"/>\n");
              writes(out, "          </a:sp3d>\n");
              writes(out, "        </a:effectStyle>\n");
              writes(out, "      </a:effectStyleLst>\n");
              writes(out, "      <a:bgFillStyleLst>\n");
              writes(out, "        <a:solidFill>\n");
              writes(out, "          <a:schemeClr val=\"phClr\"/>\n");
              writes(out, "        </a:solidFill>\n");
              writes(out, "        <a:gradFill rotWithShape=\"1\">\n");
              writes(out, "          <a:gsLst>\n");
              writes(out, "            <a:gs pos=\"0\">\n");
              writes(out, "              <a:schemeClr val=\"phClr\">\n");
              writes(out, "                <a:tint val=\"40000\"/>\n");
              writes(out, "                <a:satMod val=\"350000\"/>\n");
              writes(out, "              </a:schemeClr>\n");
              writes(out, "            </a:gs>\n");
              writes(out, "            <a:gs pos=\"40000\">\n");
              writes(out, "              <a:schemeClr val=\"phClr\">\n");
              writes(out, "                <a:tint val=\"45000\"/>\n");
              writes(out, "                <a:shade val=\"99000\"/>\n");
              writes(out, "                <a:satMod val=\"350000\"/>\n");
              writes(out, "              </a:schemeClr>\n");
              writes(out, "            </a:gs>\n");
              writes(out, "            <a:gs pos=\"100000\">\n");
              writes(out, "              <a:schemeClr val=\"phClr\">\n");
              writes(out, "                <a:shade val=\"20000\"/>\n");
              writes(out, "                <a:satMod val=\"255000\"/>\n");
              writes(out, "              </a:schemeClr>\n");
              writes(out, "            </a:gs>\n");
              writes(out, "          </a:gsLst>\n");
              writes(out, "          <a:path path=\"circle\">\n");
              writes(out, "            <a:fillToRect l=\"50000\" t=\"-80000\" r=\"50000\" b=\"180000\"/>\n");
              writes(out, "          </a:path>\n");
              writes(out, "        </a:gradFill>\n");
              writes(out, "        <a:gradFill rotWithShape=\"1\">\n");
              writes(out, "          <a:gsLst>\n");
              writes(out, "            <a:gs pos=\"0\">\n");
              writes(out, "              <a:schemeClr val=\"phClr\">\n");
              writes(out, "                <a:tint val=\"80000\"/>\n");
              writes(out, "                <a:satMod val=\"300000\"/>\n");
              writes(out, "              </a:schemeClr>\n");
              writes(out, "            </a:gs>\n");
              writes(out, "            <a:gs pos=\"100000\">\n");
              writes(out, "              <a:schemeClr val=\"phClr\">\n");
              writes(out, "                <a:shade val=\"30000\"/>\n");
              writes(out, "                <a:satMod val=\"200000\"/>\n");
              writes(out, "              </a:schemeClr>\n");
              writes(out, "            </a:gs>\n");
              writes(out, "          </a:gsLst>\n");
              writes(out, "          <a:path path=\"circle\">\n");
              writes(out, "            <a:fillToRect l=\"50000\" t=\"50000\" r=\"50000\" b=\"50000\"/>\n");
              writes(out, "          </a:path>\n");
              writes(out, "        </a:gradFill>\n");
              writes(out, "      </a:bgFillStyleLst>\n");
              writes(out, "    </a:fmtScheme>\n");
              writes(out, "  </a:themeElements>\n");
              writes(out, "  <a:objectDefaults/>\n");
              writes(out, "  <a:extraClrSchemeLst/>\n");
              writes(out, "</a:theme>\n");
              writes(out, "");
              opcContainerCloseOutputStream(out);
          }
          // adding relations
     }
     return ret;
}

static opcPart create_word_webSettings_xml(opcContainer *c) {
     opcPart ret=opcPartFind(c, _X("word/webSettings.xml"), _X("application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"), 0);
     if (OPC_PART_INVALID==ret && OPC_PART_INVALID!=(ret=opcPartCreate(c, _X("word/webSettings.xml"), _X("application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"), 0))) {
         //adding content
          opcContainerOutputStream *out=opcContainerCreateOutputStream(c, ret, OPC_COMPRESSIONOPTION_NORMAL);
          if (NULL!=out) {
              writes(out, "<w:webSettings xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">\n");
              writes(out, "  <w:optimizeForBrowser/>\n");
              writes(out, "</w:webSettings>\n");
              writes(out, "");
              opcContainerCloseOutputStream(out);
          }
          // adding relations
     }
     return ret;
}

void generate(opcContainer *c, opcContainer *xps) {
     // adding registered extensions
     opcExtensionRegister(c, _X("rels"), _X("application/vnd.openxmlformats-package.relationships+xml"));
     opcExtensionRegister(c, _X("xml"), _X("application/xml"));
     // adding root relations
     opcRelationAdd(c, OPC_PART_INVALID, _X("rId1"), create_word_document_xml(c, xps), _X("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"));
     opcRelationAdd(c, OPC_PART_INVALID, _X("rId2"), create_docProps_core_xml(c), _X("http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"));
     opcRelationAdd(c, OPC_PART_INVALID, _X("rId3"), create_docProps_app_xml(c), _X("http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"));
     // adding weak parts, i.e. parts which are not referenced by a relation
}

int main( int argc, const char* argv[] ) {
    if (OPC_ERROR_NONE==opcInitLibrary() && 3==argc) {
        opcContainer *xps=opcContainerOpen(_X(argv[1]), OPC_OPEN_READ_ONLY, NULL, NULL);
        if (NULL!=xps) {
            opcContainer *c=NULL;
            if (NULL!=(c=opcContainerOpen(_X(argv[2]), OPC_OPEN_WRITE_ONLY, NULL, NULL))) {
                generate(c, xps);
                opcContainerClose(c, OPC_CLOSE_NOW);
            }
            opcContainerClose(xps, OPC_CLOSE_NOW);
        }
    } else if (argc!=2) {
         printf("source and target file needed!\n E.g. %s \"sample.xps\" \"out.docx\"", argv[0]);
    }
}

Aug 22, 2011 at 3:41 PM

Hi Florian,

Thanks a lot for this code!

214557835

Aug 24, 2011 at 3:21 PM

Hi Florian,

How to get datas of the odttf file which was in xps files with libopc?

Would you please give some advice?

Thank you.

214557835

Coordinator
Aug 26, 2011 at 2:58 PM

Hi,

 

take a loot at http://libopc.codeplex.com/wikipage?title=Code%20Samples"Parts and Input Stream".

Simply open the odttf part and read the binary data,

 

Florian

Aug 27, 2011 at 10:01 AM

Hi Florian,

How could I determine the data that needed such as bold,italic,etc?

Thanks for your reply!

214557835

Oct 10, 2014 at 6:50 PM
Edited Oct 10, 2014 at 6:54 PM
That's a great example. I got the (more simple example above, not the longer one) example to run, but I'm not sure how to tell if it's working. What's going on with 1.fpage? Where does it handle the pieces and how would you test it? I'm not converting to docx like he is. I'm opening xps file, read it, extract content, handle pieces. Thanks!