Skip to content

Commit 679d4e1

Browse files
author
epolevikov
committed
Upd
1 parent 4a80857 commit 679d4e1

15 files changed

+76
-34
lines changed

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

Lines changed: 76 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,81 +2,123 @@
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:
9+
10+
* *Default*. Render each PDF file page as a separate report page.
11+
12+
![Render PDF content on separate pages](../../../../images/eurd-web-pdf-content-diagram.png)
13+
14+
* Embed PDF content into a report.
15+
16+
![Embed PDF content to a report](../../../../images/xrpdfcontent-generate-own-pages-on.png)
17+
18+
Refer to the following documentation section for more details: [Embed PDF File Content into a Report](#embed-pdf-file-content-into-a-report).
19+
20+
## Add the PDF Content Control to a Report
821

9-
PDF content is rendered on separate pages and uses its own page settings.
22+
Drop the **PDF Content** item from the Toolbox onto a [band](../../introduction-to-banded-reports.md) on the design surface.
23+
24+
![Drop the PDF Content control from Toolbox](../../../../images/xrpdfcontent-drop-from-toolbox.png)
1025

11-
![](../../../../images/eurd-pdf-content-diagram.png)
26+
## Specify PDF Content
1227

13-
Use one of the following options to specify PDF content:
28+
Use one of the following methods:
1429

15-
* [Specify PDF data](#specify-pdf-data).
30+
* [Specify binary PDF data](#specify-pdf-data)
1631

1732
This data is stored in the report file. The source of this data does not need to be available when the report is rendered.
1833

19-
* [Specify a reference to a PDF document](#specify-a-reference-to-a-pdf-document).
34+
* [Specify a reference to a PDF document](#specify-a-reference-to-a-pdf-document)
2035

2136
The reference to the document is stored in the report definition file. The referenced document should be available when the report is rendered.
2237

23-
## Add a PDF Content Control to a Report
38+
### Specify PDF Data
2439

25-
Drop the **PDF Content** item from the Toolbox onto a [band](../../introduction-to-banded-reports.md) on the design surface.
40+
Select the **PDF Content** control, navigate to the [Properties panel](../../report-designer-tools/ui-panels/properties-panel.md), click the **Source** property's ellipsis button, and select a PDF file.
2641

27-
![](../../../../images/eurd-pdf-content-drop-from-toolbox.png)
42+
![Click the Source property's ellipsis button and select PDF file](../../../../images/xrpdfcontent-source-ellipsis.png)
2843

29-
## Specify PDF Data
44+
When users save a report, the **Source** property value persists in the report file.
3045

31-
You can assign PDF data to the control's **Source** property.
46+
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).
3247

33-
Expand the **PDF Content**'s smart tag and click the **Source** property's ellipsis button to obtain the binary data from a file.
48+
### Specify a Reference to a PDF Document
3449

35-
![](../../../../images/eurd-pdf-content-source-ellipsis.png)
50+
Select the **PDF Content** control, navigate to the [Properties panel](../../report-designer-tools/ui-panels/properties-panel.md), and assign a path to a PDF file to this property.
3651

37-
When users save a report, the **Source** property value persists in the report file.
52+
![Assign a path to a PDF file to the Source URL property](../../../../images/xrpdfcontent-sourceurl-ellipsis.png)
3853

39-
> [!TIP]
40-
> 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.
54+
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).
4155

42-
## Specify a Reference to a PDF Document
56+
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.
4357

44-
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.
58+
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.
4559

46-
To specify the PDF document's location on the Web, specify the URL as the **Source URL** property's value.
60+
### Use Expressions
4761

48-
![](../../../../images/eurd-pdf-content-sourceurl.png)
62+
Select the **PDF Content** control and navigate to the [Properties panel](../../report-designer-tools/ui-panels/properties-panel.md). Click the **f** symbol right to the **Source** or **Source URL** property.
4963

50-
When users save a report, the URL 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.
64+
![Assign an expression to the Source URL property](../../../../images/xrpdfcontent-sourceurl-expression.png)
5165

52-
> [!TIP]
53-
> 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.
66+
Use the invoked **Expression Editor** to create an expression that identifies the source of a PDF file.
5467

55-
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.
68+
## Embed PDF File Content into a Report
5669

57-
## Use Expressions
70+
[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.
5871

59-
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.
72+
![Disable the Generate Own Pages property](../../../../images/disable-generate-own-pages-property.png)
6073

61-
Expand the **PDF Content**'s smart tag.
74+
### Use Cases
6275

63-
* 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.
76+
* Create a report with PDF file content and headers / footers that are printed on PDF file pages.
6477

65-
![](../../../../images/eurd-pdf-content-source-expression.png)
78+
* Print pictures, bar codes, page numbers, a report watermark, and other elements over the content of a PDF file.
6679

67-
* 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.
80+
* 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).
6881

69-
![](../../../../images/eurd-pdf-content-sourceurl-expression.png)
82+
* 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.
7083

84+
* Design a pre-printed form and use PDF file as a watermark.
7185

72-
## Limitations
86+
If your PDF file contains one page, follow the steps below:
87+
88+
1. Embed this page into a report's *Detail* band.
89+
2. Remove the report's margins to prevent duplication with PDF page margins.
90+
3. Adjust the page size to make it fit the entire *Detail* band.
7391

74-
* PDF content always starts on a new page. Report content is printed?on a new page after the PDF content is finished.
92+
If your PDF file contains multiple pages, do the following:
93+
* 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.
94+
* Include each of these subreports to one report.
95+
96+
### Fit PDF File's Page Size to Report's Page Size
97+
98+
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.
99+
100+
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.
101+
102+
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.
103+
104+
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.
105+
106+
3. Remove the report's margins and adjust the **PDF Content** control size to make PDF content fit the entire *Detail* band.
107+
108+
![Adjust the Pdf Content control's size](../../../../images/xrpdfcontent-adjust-size.png)
109+
110+
4. Add the report as a subreport to your main report. Use the [Subreport](subreport.md) control with the **Generate Own Pages** property enabled.
111+
112+
![Add the Pdf Content control as a subreport to the main report](../../../../images/xrpdfcontent-add-as-subreport.png)
113+
114+
Open the main report's Preview to show the result.
115+
116+
## Limitations
75117

76118
* 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.
77119

78120
* You cannot add the **PDF Content** control to the following bands:
79121
* **Top Margin** / **Bottom Margin**
80122
* **Page Header** / **Page Footer**
81123
* **Group Header** / **Group Footer** bands (if their **Repeat Every Page** properties are enabled).
82-
* **Vertical Header** / **Vertical Detail** / **Vertical Total**
124+
* **Vertical Header** / **Vertical Detail** / **Vertical Total**
7.31 KB
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-48.1 KB
Binary file not shown.
18.2 KB
Loading
40.6 KB
Loading
148 KB
Loading

0 commit comments

Comments
 (0)