Rich text format to pdf5/19/2023 Private void button3_Click(object sender, EventArgs e) MessageBox.Show(String.Concat("Error during saving: ", e.Message)) RichTextBox.SaveFile(newFileDialog.FileName, RichTextBoxStreamType.PlainText) If (newFileDialog.ShowDialog() = DialogResult.OK) If the user confirm the dialog window. NewFileDialog.Filter = "PDF Files|*.pdf" SaveFileDialog newFileDialog = new SaveFileDialog() Private bool ShowRichTextBoxSaveDialog(RichTextBox richTextBox) Look here and here.ĮDIT: I just answer to the questioneer's comment asking for some helping code: // This method opens a dialog and save the content of the passed RichTextBox Īs you see, the main supported type is RTF (Rich Text Format), a plain-text multi-platform format: this is very different from PDF. Here you can find the currently available stream format types the can be used. ![]() The problem is that, using the method, you cannot save the content of a RichTextBox in the PDF format. MySmtp.Port = Convert.ToInt32(ThePort.Text) SmtpClient MySmtp = new SmtpClient(TheServer.Text) MailAddress mail = new MailAddress(richTextBox1.Text) MyMail.To.Add(new MailAddress(richTextBox4.Text)) I also made send button to send an email with attachments but the problem is I'm unable to send the email: MailMessage MyMail = new MailMessage(richTextBox1.Text, richTextBox4.Text) RichTextBox5.SaveFile(MyFiles.FileName, RichTextBoxStreamType.PlainText) RichTextBox4.SaveFile(MyFiles.FileName, RichTextBoxStreamType.PlainText) RichTextBox3.SaveFile(MyFiles.FileName, RichTextBoxStreamType.PlainText) RichTextBox1.SaveFile(MyFiles.FileName, RichTextBoxStreamType.PlainText) If (MyFiles.ShowDialog() = DialogResult.OK) SaveFileDialog MyFiles = new SaveFileDialog() private void button3_Click(object sender, EventArgs e) Each time I save a file Adobe Reader can't open it. To disable full rich-text formatting for the selected rich text box, clear the Full rich text (images, tables, etc.) check box.I want to save rich text boxes as pdf files. To prevent users from inserting any kind of picture into the rich text box, clear both the Embedded images and Linked images check boxes. To allow users to link to pictures from the rich text box, select the Linked images check box. To allow users to embed pictures inside the rich text box, select the Embedded images check box. To enable full rich-text formatting for the selected rich text box, select the Full rich text (images, tables, etc.) check box, and then do one of the following: Right-click the rich text box for which you want to enable or disable full rich-text formatting, and then click Rich Text Box Properties on the shortcut menu. Otherwise, the picture will not appear in the rich text box. ![]() If users link to a picture, they must have access to the location of the picture source file. ![]() ![]() Linking to a picture stores the picture outside the form and is a better choice if you think that your users will need to update the linked picture, or if you want to reduce the file size of the completed form. Embedding a picture stores the picture as part of the form and is a good choice if your users don't need to update the picture. For example, they can apply a different font or character style to the text inside the rich text box or even insert a table into the rich text box.ĭepending on the options that you choose, users also may be able to link to or embed pictures in the rich text box. If you enable rich-text formatting for a rich text box, users can use a variety of options to format the text that they enter in that control.
0 Comments
Leave a Reply. |