Skip to content

Commit

Permalink
Task #VIEWERNET-4568 (#76)
Browse files Browse the repository at this point in the history
Move "Wrap images in SVG when rendering PDF and Page Layout files" section from release notes to documentation
Task #VIEWERNET-4569
Move "Bypass font license verification when rendering XPS and OXPS files" section from release notes to documentation
  • Loading branch information
Pavel-A-Sokolov committed Nov 8, 2023
1 parent 9aeacd3 commit c9fb682
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions net/rendering-basics/render-pdf-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,3 +452,46 @@ using (var viewer = new Viewer("resume.pdf"))
{{< /tabs >}}

![Extract and display PDF text](/viewer/net/images/rendering-basics/render-pdf-documents/extract-pdf-text.png)

## Skip font license verification when rendering XPS and OXPS files

If an XPS or OXPS file contains a font that cannot be embedded due to licensing restrictions, GroupDocs.Viewer throws an exception at runtime. If you have a license for this font, enable the [PdfOptions.DisableFontLicenseVerifications](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.options/pdfoptions/disablefontlicenseverifications) option to skip font license verification.

{{< tabs "example15">}}
{{< tab "C#" >}}
```csharp
using (Viewer viewer = new Viewer("resume.oxps"))
{
HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources();
options.PdfOptions.DisableFontLicenseVerifications = true;
viewer.View(viewOptions);
}
```
{{< /tab >}}
{{< /tabs >}}

## Enclose images in SVG when rendering PDF and Page Layout files

By default, when rendering to the PDF and Page Layout file formats, all images are combined into a single PNG file, which serves as the background for the output HTML document.

The [PdfOptions.WrapImagesInSvg](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.options/pdfoptions/wrapimagesinsvg) option allows you to wrap each image in the output HTML document with an SVG tag to improve output quality.

This option is available when rendering PDF and Page Layout file formats to HTML with embedded or external resources.

{{< tabs "example16">}}
{{< tab "C#" >}}
```csharp
using (Viewer viewer = new Viewer("resume.pdf"))
{
HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources();
viewOptions.PdfOptions.WrapImagesInSvg = true;

viewer.View(viewOptions);
}
```
{{< /tab >}}
{{< /tabs >}}

The following image shows the rendering [resume.pdf](/viewer/net/images/rendering-basics/render-pdf-documents/resume.pdf) with the disabled (left) and enabled (right) `WrapImagesInSvg` option:

![Images as background vs embedded in SVG](/viewer/net/images/rendering-basics/render-pdf-documents/wrap-images-in-svg.png)

0 comments on commit c9fb682

Please sign in to comment.