# PdfResourcePolicy

Controls whether a source-to-PDF conversion may read resources from the host environment.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfResourcePolicy.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfResourcePolicy.cs#L68)

**Modifiers**

sealed

Controls whether a source-to-PDF conversion may read resources from the host environment. Explicit in-memory font and image data remains available in every policy.

## Inheritance

- object
- PdfResourcePolicy

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Convert HTML to PDF](/docs/html/html-to-pdf/) Guide
  
  Convert HTML pages and reports to PDF in .NET without a browser, with page size, margins, extra CSS, headers and footers, and local images and fonts.

## Usage

Explore 5 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 5

- Method [PdfResourcePolicy.Clone](/api/pdf/officeimo-pdf-pdfresourcepolicy/#method-clone)
- Method [PdfResourcePolicy.CreateDefault](/api/pdf/officeimo-pdf-pdfresourcepolicy/#method-createdefault)
- Method [PdfResourcePolicy.CreateLibraryFontDefault](/api/pdf/officeimo-pdf-pdfresourcepolicy/#method-createlibraryfontdefault)
- Method [PdfResourcePolicy.CreatePortableDeterministic](/api/pdf/officeimo-pdf-pdfresourcepolicy/#method-createportabledeterministic)
- Method [PdfResourcePolicy.CreateTrustedHost](/api/pdf/officeimo-pdf-pdfresourcepolicy/#method-createtrustedhost)

Filter members 

Show inherited

## Constructors

`public PdfResourcePolicy()` [#](#constructor-ctor)

[PdfResourcePolicy.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfResourcePolicy.cs#L68)

## Methods

`public PdfResourcePolicy Clone()` [#](#method-clone)

[PdfResourcePolicy.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfResourcePolicy.cs#L74)

Creates an independent policy snapshot.

Returns

`PdfResourcePolicy`

`public static PdfResourcePolicy CreateDefault()` [#](#method-createdefault)

[PdfResourcePolicy.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfResourcePolicy.cs#L13)

Creates the balanced document-conversion default. Library-selected installed fonts and bounded in-source resources are allowed for document fidelity, including document-selected installed fonts. Arbitrary local files and remote resources remain disabled.

Returns

`PdfResourcePolicy`

`public static PdfResourcePolicy CreateLibraryFontDefault()` [#](#method-createlibraryfontdefault)

[PdfResourcePolicy.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfResourcePolicy.cs#L24)

Allows library-selected installed fonts and bounded in-source resources, while document-selected host fonts, arbitrary local files and remote resources remain disabled.

Returns

`PdfResourcePolicy`

`public static PdfResourcePolicy CreatePortableDeterministic()` [#](#method-createportabledeterministic)

[PdfResourcePolicy.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfResourcePolicy.cs#L34)

Creates the portable deterministic policy. Host fonts, local files, and remote resources are disabled; bounded in-document data resources remain available.

Returns

`PdfResourcePolicy`

`public static PdfResourcePolicy CreateTrustedHost()` [#](#method-createtrustedhost)

[PdfResourcePolicy.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfResourcePolicy.cs#L43)

Creates an explicit trusted-host policy. Resolvers and format-specific options are still required before local or remote content is loaded.

Returns

`PdfResourcePolicy`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public bool AllowSystemFontEmbedding { get; set; }` [#](#property-allowsystemfontembedding)

[PdfResourcePolicy.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfResourcePolicy.cs#L53)

When true, converters may load and embed installed system fonts. Enabled by the balanced default.

`public bool AllowDocumentFontEmbedding { get; set; }` [#](#property-allowdocumentfontembedding)

[PdfResourcePolicy.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfResourcePolicy.cs#L59)

When true, Office converters may use font family names from the source document to locate and embed installed system fonts. Enabled by the balanced default; disabled by [PdfResourcePolicy.CreatePortableDeterministic](/api/pdf/officeimo-pdf-pdfresourcepolicy/).

`public bool AllowLocalFileAccess { get; set; }` [#](#property-allowlocalfileaccess)

[PdfResourcePolicy.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfResourcePolicy.cs#L62)

When true, format-specific local-resource options may read files from explicitly allowed locations.

`public bool AllowRemoteResourceResolution { get; set; }` [#](#property-allowremoteresourceresolution)

[PdfResourcePolicy.cs:65](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfResourcePolicy.cs#L65)

When true, application-supplied resolvers may obtain remote resources.

`public bool AllowDataUris { get; set; }` [#](#property-allowdatauris)

[PdfResourcePolicy.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfResourcePolicy.cs#L68)

When true, bounded data-URI resources embedded in the source document may be decoded.

`public bool AllowEmbeddedPackageResources { get; set; }` [#](#property-allowembeddedpackageresources)

[PdfResourcePolicy.cs:71](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfResourcePolicy.cs#L71)

When true, bounded resources already contained in a source package, such as MHTML cid: parts, may be resolved.

<!-- PowerForge markdown artifact sha256:22C7B6DAA5CF5CBD84ABC0873D55B6928D6CA53FDE10339E84C8D5BEF9D66904 -->
