![]() Please don't ask several questions in the same thread. Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask questions about third-party software in these forums as they are intended for Microsoft's own products and technologies only. Open the XPS file in a Google Chrome window (you can do this by right-clicking the file and going to Open with > Google Chrome). the conversion of the XPS document to PDF, you should ask in the following forum: If you have any questions or issues regarding PdfSharp, i.e. Size pageSize = new Size(printDlg.PrintableAreaWidth, printDlg.PrintableAreaHeight - 100) CalibrationReportTemplate cr = new CalibrationReportTemplate() ![]() Source.UriSource = new Uri("pack://application:,/WpfApplication5 component/av1.jpg") The following code prints the image inside the Border to the XPS document as expected: private void Save()īorder _reportBorder = new Border() ![]() Make sure that the source of the Image element is set to a valid Uri. However, we notice that the () from Xps to PDF, the images inside wpf control lost.ĭoes anyone use PdfSharp library without losing image controls?ĭoes anyone has idea how to export WPF control which includes images into PDF format? Thx! We use the library PdfSharp from the link: XWriter.Write(fixedDoc.DocumentPaginator) XpsDocumentWriter xWriter = XpsDocument.CreateXpsDocumentWriter(xpsDoc) XpsDocument xpsDoc = new XpsDocument(tempFilename, FileAccess.Write) _reportBorder.Arrange(new Rect(10, 50, pageSize.Width, pageSize.Height)) Size pageSize = new Size(printDlg.PrintableAreaWidth, printDlg.PrintableAreaHeight-100) PrintDialog printDlg = new PrintDialog() ![]() PageContent pageContent = new PageContent() What we learn is export WPF control into XPS file format first and then using var dialog = new SaveFileDialog() ĭialog.Filter = "PDF Document (*.pdf)|*.pdf" ĭialog.FileName = "xxxReport_" + Utility.FormatDate(DateTime.Now).Replace("/", "_") įixedDocument fixedDoc = new FixedDocument() Our WPF application needs to export WPF UserControl into a PDF format file. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |