public void SaveSingleSVGScore() { string pageFilename = Path.GetFileNameWithoutExtension(FilePath) + " (scroll).svg"; string pagePath = Path.GetDirectoryName(FilePath) + @"\" + pageFilename; TextInfo infoTextInfo = GetInfoTextAtTopOfPage(0); SvgPage singlePage = new SvgPage(this, _pageFormat, 0, infoTextInfo, this.Systems, true); SaveSVGPage(pagePath, singlePage, this.Metadata); }
/// <summary> /// Writes an SVG file containing one page of the score. /// </summary> public void SaveSVGPage(string pagePath, SvgPage page, Metadata metadata) { if (File.Exists(pagePath)) { File.Delete(pagePath); } XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; settings.IndentChars = ("\t"); settings.CloseOutput = true; settings.NewLineOnAttributes = true; settings.NamespaceHandling = NamespaceHandling.OmitDuplicates; settings.Encoding = Encoding.GetEncoding("utf-8"); using (SvgWriter w = new SvgWriter(pagePath, settings)) { page.WriteSVG(w, metadata); } }
protected bool CreatePages() { bool success = true; int pageNumber = 1; int systemIndex = 0; while (systemIndex < Systems.Count) { int oldSystemIndex = systemIndex; SvgPage newPage = NewSvgPage(pageNumber++, ref systemIndex); if (oldSystemIndex == systemIndex) { MessageBox.Show("The systems are too high for the page height.\n\n" + "Reduce the height of the systems, or increase the page height.", "Problem", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); success = false; break; } _pages.Add(newPage); } return(success); }
/// <summary> /// Writes an SVG file containing one page of the score. /// </summary> public void SaveSVGPage(string pagePath, SvgPage page, Metadata metadata) { if(File.Exists(pagePath)) { File.Delete(pagePath); } XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; settings.IndentChars = ("\t"); settings.CloseOutput = true; settings.NewLineOnAttributes = true; settings.NamespaceHandling = NamespaceHandling.OmitDuplicates; settings.Encoding = Encoding.GetEncoding("utf-8"); using(SvgWriter w = new SvgWriter(pagePath, settings)) { page.WriteSVG(w, metadata); } }