private void CreateAltChunkPart(DocxChunk chunk, string altChunkPath, string altChunkId, PackagePart parentPart) { Uri altChunkUri = new Uri(altChunkPath, UriKind.Relative); PackagePart altChunkPart = this.CreatePart(altChunkUri, chunk.Type); using (var writer = new StreamWriter(altChunkPart.GetStream())) writer.Write(chunk.Content); CreatePartRelationship(altChunkUri, Resources.AltChunkRelationshipType, altChunkId, parentPart); }
private void WriteAltChunks(DocxContentBuilder chunks, DocxXmlWriter writer, PackagePart parentPart) { for (int chunkIndex = 0; chunkIndex < chunks.Count; chunkIndex++) { DocxChunk chunk = chunks[chunkIndex]; this.altChunkCounter++; string altChunkId = DocxPackageWriter.AltChunkPartialId + altChunkCounter; writer.WriteElement("altChunk", "id", altChunkId); string altChunkPath = DocxPackageWriter.AltChunkPartialPath + altChunkCounter + chunk.Extension; this.CreateAltChunkPart(chunk, altChunkPath, altChunkId, parentPart); } }