Skip to content

Commit 63193b3

Browse files
author
epolevikov
committed
Merge branch 'pdf-content-control'
2 parents 25e190f + 679d4e1 commit 63193b3

File tree

37 files changed

+160
-71
lines changed

37 files changed

+160
-71
lines changed

interface-elements-for-desktop/articles/report-designer/report-designer-for-winforms/use-report-elements/use-basic-report-controls/pdf-content.md

Lines changed: 84 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,84 +2,131 @@
22
title: PDF Content
33
author: Sergey Andreev
44
---
5+
56
# PDF Content
67

7-
**PDF Content** is a control that renders PDF content in a report.
8+
The **PDF Content** control allows you to render PDF file content in two ways:
89

9-
PDF content is rendered on separate pages and uses its own page settings.
10+
* *Default*. Render each PDF file page as a separate report page.
11+
12+
![Render PDF content on separate pages](../../../../../images/eurd-win-pdf-content-diagram.png)
1013

11-
![](../../../../../images/eurd-win-pdf-content-diagram.png)
14+
* Embed PDF content into a report.
1215

13-
Use one of the following options to specify PDF content:
16+
![Embed PDF content to a report](../../../../../images/xrpdfcontent-generate-own-pages-on.png)
1417

15-
* [Specify PDF data](#specify-pdf-data).
18+
Refer to the following documentation section for more details: [Embed PDF File Content into a Report](#embed-pdf-file-content-into-a-report).
1619

17-
This data is stored in the report file. The source of this data does not need to be available when the report is rendered.
20+
## Add the PDF Content Control to a Report
1821

19-
* [Specify a reference to a PDF document](#specify-a-reference-to-a-pdf-document).
22+
Drop the **PDF Content** item from the Toolbox onto a [band](../../introduction-to-banded-reports.md) on the design surface.
2023

21-
The reference to the document is stored in the report definition file. The referenced document should be available when the report is rendered.
24+
![Drop the PDF Content control from Toolbox](../../../../../images/xrpdfcontent-drop-from-toolbox.png)
2225

23-
## Add a PDF Content Control to a Report
26+
You can also copy a PDF document from an external application and paste it in your report, or drag a document and drop it onto the design surface.
2427

25-
Drop the **PDF Content** item from the Toolbox onto a [band](../../introduction-to-banded-reports.md) on the design surface.
28+
![Drag a PDF file from an external resource to a report band](../../../../../images/xrpdfcontent-drag-file.png)
29+
30+
The dragged file's content is assigned to the control's **Source** property as [binary data](#specify-pdf-data).
2631

27-
![](../../../../../images/eurd-win-pdf-content-drop-from-toolbox.png)
32+
## Specify PDF Content
2833

29-
You can also copy a PDF document from an external application and paste it in your report, or drag a document and drop it onto the design surface. The dragged file's content is assigned to the control's **Source** property as [PDF data](#specify-pdf-data).
34+
Use one of the following methods:
3035

31-
![](../../../../../images/eurd-win-pdf-content-drag-file.png)
36+
* [Specify binary PDF data](#specify-pdf-data)
3237

33-
## Specify PDF Data
38+
This data is stored in the report file. The source of this data does not need to be available when the report is rendered.
3439

35-
You can assign PDF data to the control's **Source** property.
40+
* [Specify a reference to a PDF document](#specify-a-reference-to-a-pdf-document)
3641

37-
Expand the **PDF Content**'s smart tag and click the **Source** property's ellipsis button to obtain the binary data from a file.
42+
The reference to the document is stored in the report definition file. The referenced document should be available when the report is rendered.
3843

39-
![](../../../../../images/eurd-win-pdf-content-source-ellipsis.png)
44+
### Specify PDF Data
45+
46+
Expand the **PDF Content** control's smart tag, click the **Source** property's ellipsis button, and select a PDF file.
47+
48+
![Click the Source property's ellipsis button and select PDF file](../../../../../images/xrpdfcontent-source-ellipsis.png)
4049

4150
When users save a report, the **Source** property value persists in the report file.
4251

43-
> [!TIP]
44-
> See the [Use Expressions](#use-expressions) section below for information on how to conditionally specify the **Source** property value, or bind it to a report parameter or data source field.
52+
You can also use [report parameters](../../shape-report-data/use-report-parameters.md) to conditionally specify the **Source** property value or bind the property to a data source field. Refer to the following section for details: [Use Expressions](#use-expressions).
4553

46-
## Specify a Reference to a PDF Document
54+
### Specify a Reference to a PDF Document
4755

48-
You can use an external PDF document as a source of PDF data. Set the **Source URL** property to a local file system path or URL.
56+
Expand the **PDF Content** control's smart tag, click the **Source URL** property's ellipsis button, and select a PDF file.
4957

50-
Expand the **PDF Content**'s smart tag and click the **Source URL** property's ellipsis button to specify the PDF document location in the file system.
58+
![Click the Source URL property's ellipsis button and select PDF file](../../../../../images/xrpdfcontent-sourceurl-ellipsis.png)
5159

52-
![](../../../../../images/eurd-win-pdf-content-sourceurl-ellipsis.png)
60+
To specify a PDF document location on the Web, assign a document URL to the **Source URL** property.
5361

54-
To specify the PDF document's location on the Web, use the URL as the **Source URL** property's value.
62+
![Assign a Web URL to the Source URL property](../../../../../images/xrpdfcontent-sourceurl.png)
5563

56-
![](../../../../../images/eurd-win-pdf-content-sourceurl.png)
64+
You can also use [report parameters](../../shape-report-data/use-report-parameters.md) to conditionally specify the **Source Url** property value or bind the property to a data source field. Refer to the following section for details: [Use Expressions](#use-expressions).
5765

5866
When users save a report, the URL or path specified in the **Source URL** property is included in the report file. The PDF document should be available at the specified location when a report is printed or rendered in Preview.
5967

60-
> [!TIP]
61-
> See the [Use Expressions](#use-expressions) section for information on how to conditionally specify the **Source URL** property value, or bind it to a report parameter or data source field.
68+
The **Source Url** property value takes precedence over the **Source** property value. If you specify both properties, **PDF Content** includes the content specified by **Source Url**. If the file specified in the **Source Url** property cannot be loaded, the PDF data from the **Source** property is used.
6269

63-
The **Source URL** property value takes precedence over the **Source** property value. If you specify both properties, **PDF Content** includes the content specified by **Source URL**. However, if the file specified in the **Source URL** property cannot be loaded, the binary data from the **Source** property is used.
70+
### Use Expressions
6471

65-
## Use Expressions
72+
Expand the **PDF Content** control's smart tag and click the **Expression** property's ellipsis button below the **Source** or **Source URL** property.
6673

67-
You can specify an expression that specifies the **Source** or **Source URL** property value. An expression can include [report parameters](../../shape-report-data/use-report-parameters.md) or [data source](../../bind-to-data.md) fields, or it can conditionally specify a property value.
74+
![Assign an expression to the Source URL property](../../../../../images/xrpdfcontent-sourceurl-expression.png)
6875

69-
Expand the **PDF Content**'s smart tag.
76+
Use the invoked **Expression Editor** to create an expression that identifies the source of a PDF file.
7077

71-
* Click the **Expression** property's ellipsis button below the **Source** property. Use the invoked **Expression Editor** to create an expression that identifies the source of binary PDF data.
78+
## Embed PDF File Content into a Report
7279

73-
![](../../../../../images/eurd-win-pdf-content-source-expression.png)
80+
[Add](#add-the-pdf-content-control-to-a-report) the **PDF Content** control to a report, [specify](#specify-pdf-content) a PDF file location, and disable the control's **Generate Own Pages** property.
7481

75-
* Click the **Expression** property's ellipsis button below the **Source URL** property. Use the invoked **Expression Editor** to create an expression the value of which identifies a URL or path to a PDF document.
82+
![Disable the Generate Own Pages property](../../../../../images/disable-generate-own-pages-property.png)
7683

77-
![](../../../../../images/eurd-win-pdf-content-sourceurl-expression.png)
84+
### Use Cases
7885

86+
* Create a report with PDF file content and headers / footers that are printed on PDF file pages.
7987

80-
## Limitations
88+
* Print pictures, bar codes, page numbers, a report watermark, and other elements over the content of a PDF file.
89+
90+
* Create a report document with paper kind that differs from PDF pages paper kind. Refer to the following section for instructions: [Fit PDF File's Page Size to Report's Page Size](#fit-pdf-files-page-size-to-reports-page-size).
91+
92+
* Append PDF file content to report content and add sequential numbering to all report pages. For this, add PDF file content as a subreport to your report as described in the following section: [Fit PDF File's Page Size to Report's Page Size](#fit-pdf-files-page-size-to-reports-page-size). Then, [add page numbers](../../add-navigation/add-page-numbers.md) to both the subreport and main report.
93+
94+
* Design a pre-printed form and use PDF file as a watermark.
95+
96+
If your PDF file contains one page, follow the steps below:
97+
1. Embed this page into a report's *Detail* band.
98+
2. Remove the report's margins to prevent duplication with PDF page margins.
99+
3. Adjust the page size to make it fit the entire *Detail* band.
81100

82-
* PDF content always starts on a new page. Report content is printed?on a new page after the PDF content is finished.
101+
If your PDF file contains multiple pages, do the following:
102+
1. Create a subreport for each of the pages. Follow the instructions in this section: [Fit PDF File's Page Size to Report's Page Size](#fit-pdf-files-page-size-to-reports-page-size). Use the **PDF Content** control's **Page Range** property to specify the PDF file page that should be included to a subreport.
103+
2. Include each of these subreports to one report.
104+
105+
### Fit PDF File's Page Size to Report's Page Size
106+
107+
A PDF file and a report to which you embed PDF file content might have different paper kind. PDF file pages can also be generated with double margins: page margins and report margins.
108+
109+
This section explains how to set the same paper kind for a report and its embedded PDF file and how to include only the PDF file's page margins to the report. The main idea is to create a subreport that includes PDF pages in embedded mode, and then, add this subreport to the main report that contains initial content.
110+
111+
1. Create a blank report. Set the report's **Paper Kind** property to the paper kind of the main report to which you want to embed PDF content.
112+
113+
2. Drop the **PDF Content** control from the **Toolbox** onto the created report's _Detail_ band, specify a PDF file source, and disable the control's **Generate Own Pages** property.
114+
115+
![Add Pdf Content control to a report](../../../../../images/xrpdfcontent-add-to-a-report.png)
116+
117+
3. Remove the report's margins and adjust the **PDF Content** control size to make PDF content fit the entire *Detail* band.
118+
119+
![Adjust the Pdf Content control's size](../../../../../images/xrpdfcontent-adjust-size.png)
120+
121+
4. Add the report as a subreport to your main report. Use the [Subreport](subreport.md) control with the **Generate Own Pages** property enabled.
122+
123+
![Add the Pdf Content control as a subreport to the main report](../../../../../images/xrpdfcontent-add-as-subreport.png)
124+
125+
The following image demonstrates the main report's Preview:
126+
127+
![The main report's Preview](../../../../../images/xrpdfcontent-main-report-preview.png)
128+
129+
## Limitations
83130

84131
* PDF content is displayed as an image in Preview. Users cannot select text in PDF content. To allow users to select text, export the report to PDF.
85132

14.5 KB
Loading
-1.22 KB
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)