Пример #1
0
        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);
        }
Пример #2
0
        /// <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);
            }
        }
Пример #3
0
        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);
        }
Пример #4
0
        /// <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);
            }
        }
Пример #5
0
        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);
        }