示例#1
0
        private bool Write(NoteBlockElement notes)
        {
            if (notes == null)
            {
                return(false);
            }

            if (!ShowNotes)
            {
                return(true);
            }

            var lines = notes.Value.Trim()
                        .Replace("\r\n", "\n").Replace('\r', '\n')
                        .Replace("\n\n", "\r")
                        .Replace("\n", "")
                        .Split('\r');

            _page.SetFont(_courierItalic, _settings.FontSize);
            foreach (string line in lines)
            {
                if (!HaveRoomFor(1))
                {
                    NewPage();
                }

                if (line.Length == 0)
                {
                    EmptyLine();
                }
                else
                {
                    string[] sublines = BreakIntoLines(line, _settings.WritablePageWidth());
                    foreach (string subline in sublines)
                    {
                        WriteLine(subline);
                        EmptyLine();
                    }
                }
            }

            _page.SetFont(_courier, _settings.FontSize);

            return(true);
        }
示例#2
0
        private bool Write(NoteBlockElement notes)
        {
            if (notes == null)
                return false;

            if (!ShowNotes)
                return true;

            var lines = notes.Value.Trim()
                .Replace("\r\n", "\n").Replace('\r','\n')
                .Replace("\n\n", "\r")
                .Replace("\n", "")
                .Split('\r');

            _page.SetFont(_courierItalic, _settings.FontSize);
            foreach (string line in lines) {
                if (!HaveRoomFor(1))
                    NewPage();

                if (line.Length == 0) {
                    EmptyLine();
                } else {
                    string[] sublines = BreakIntoLines(line, _settings.WritablePageWidth());
                    foreach (string subline in sublines) {
                        WriteLine(subline);
                        EmptyLine();
                    }
                }
            }

            _page.SetFont(_courier, _settings.FontSize);

            return true;
        }