Ticket T213126
Visible to All Users

How to integrate a PDF viewer to display PDF files in an XAF application

created 10 years ago (modified 9 months ago)

In general, accomplishing this task consists of several independent parts:
1.  Configure DxPdfViewer (ASP.NET Core Blazor), DevExpress.XtraPdfViewer > PdfViewer  (WinForms) or  DevExpress.Pdf > PdfDocumentProcessor in conjunction with some custom visual components (ASP.NET WebForms) according to their corresponding product documentation, demos, examples and articles in the Support Center knowledge base, because this is unrelated to XAF itself. For faster resolution on pure PdfViewer and component questions in the future, submit them under the corresponding Blazor, .NET | WinForms or ASP.NET WebForms platforms directly.

2.  Embed a configured PDF viewer or other suitable UI control into an XAF View (or displaying a fully custom form separately using traditional approaches for each target platform), and feeding it with data from the application database or external sources. Check out the following XAF documentation for this:
    Concepts > UI Construction > Using a Custom Control that is not Integrated by Default
    Concepts > UI Construction > View Items > Implement Custom Property Editors
    Task-Based Help > How to: Show a Custom Data-Bound Control in an XAF View (WinForms)
    Task-Based Help > How to: Show a Custom Data-Bound Control in an XAF View (ASP.NET)
    Concepts > Data Manipulation and Business Logic > Create, Read, Update and Delete Data
    Concepts > Extend Functionality > Actions
If PDF files are stored in the database as a BLOB object, exposed via a business object property as byte array, the most appropriate solution is to implement a custom property editor that will create a suitable UI control and bind it to data stored in the object's property.

You can also find several integration examples provided by our users or us in the following tickets:

Typical use-case scenarios include, but are not limited to:
 - previewing FileData object contents (created using our FileAttachment module) inside the application (directly in DetailView or ListView) using a specialized PDF viewer control;
 - displaying a PDF file from a file system or network in a DetailView or custom form;
 - displaying a PDF file stored inside a binary database column in a DetailView or custom form;
 - opening a PDF file preview coming from an arbitrary source after clicking on a navigation item.

We would also greatly appreciate it if you describe your planned use-case scenarios or exactly how and for what your end-users are supposed to use PDF viewer control in your app.
If possible, attach screenshots, test samples and database to clarify expected results and user steps within the application UI. With that, we will be able to better understand your requirements and provide more specific solutions or consider improvements to our products for the future. Thanks in advance.

Search keywords:
PDF, Adobe, portable document format, XtraPdfViewer, PdfDocumentProcessor

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.