You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Document-Processing/PDF/Conversions/HTML-To-PDF/NET/troubleshooting.md
+29-5Lines changed: 29 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1560,22 +1560,46 @@ N> We have option to exclude the default Blink binaries from the installation pa
1560
1560
1561
1561
## How to Exclude BlinkBinaries or Runtime Files in Build or Deployment
1562
1562
1563
-
The runtime files, or blink binaries, will be copied into a bin or published folder while building and publishing the application.
1564
-
By including the <ExcludeAssets>native</ExcludeAssets> option in the package reference of the csproj file, you can exclude the runtime files or blink binaries from being copied into the bin or publish folder while building and publishing the application. But you need to place the BlinkBinaries in the server disk and set the BlinkPath in the BlinkConverterSettings to perform the conversion.
1563
+
When you build or publish the application, the Syncfusion HTML‑to‑PDF converter automatically copies the Blink runtime files (BlinkBinaries) into the <i>bin</i> or <i>publish</i> output folder. These binaries are required for HTML‑to‑PDF conversion at runtime. However, in certain deployment scenarios—such as reducing the deployment size or using a shared/system‑installed Chromium—you can exclude these files and instead provide the Blink binaries manually on the host machine.
1564
+
1565
+
To exclude BlinkBinaries during the build process, configure your project file depending on whether you are using <b>.NET Core/.NET or .NET Framework</b>.
1565
1566
1566
-
N> Using this approach, you can reduce the deployment size on your own servers.
1567
+
<b>Exclude BlinkBinaries in .NET Core</b>
1568
+
You can prevent runtime files from being included by restricting the package to <b>compile-only</b> assets using the <b>IncludeAssets</b> tag in the <b>PackageReference</b>. This stops all Blink runtime binaries from being copied into the output folder.
By using <b>IncludeAssets="compile"</b>, only the required compile-time metadata is included, and all runtime dependencies (BlinkBinaries) are excluded from the final build or publish output.
1585
+
1586
+
N> If you exclude runtime files, you must manually place BlinkBinaries on the server and configure BlinkPath in BlinkConverterSettings for conversion to work.
1587
+
1588
+
<b>Exclude BlinkBinaries in .NET Framework Projects</b>
1589
+
1590
+
For .NET Framework applications, Blink runtime files are included through a .targets file referenced in the project.
1591
+
To exclude BlinkBinaries, simply remove this import entry.
Removing this line prevents the Syncfusion<sup>®</sup> build targets from copying BlinkBinaries and other runtime files into your bin folder during build or publish.
1602
+
1603
+
N> By excluding BlinkBinaries, you can significantly reduce the size of your deployment package, especially in server environments where disk usage and deployment time matter.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Library/NET/Working-with-Security.md
+77Lines changed: 77 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1603,6 +1603,83 @@ loadedDocument.Close(True)
1603
1603
1604
1604
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/Security/Change-the-permission-of-the-PDF-document/).
1605
1605
1606
+
## View document permission flags
1607
+
1608
+
Read a PDF document permission flags via the [Security.Permissions](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Security.PdfSecurity.html#Syncfusion_Pdf_Security_PdfSecurity_Permissions) property, which returns a bitwise combination of values from the [PdfPermissionsFlags](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Security.PdfPermissionsFlags.html) enumeration.
1609
+
1610
+
{% tabs %}
1611
+
{% highlight c# tabtitle="C# [Cross-platform]" %}
1612
+
1613
+
// Load an existing PDF
1614
+
using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf"))
Using loadedDocument As New PdfLoadedDocument("Input.pdf")
1661
+
' Access the document security settings
1662
+
Dim security As PdfSecurity = loadedDocument.Security
1663
+
' Get the permission flags (bitwise enum)
1664
+
Dim permissions As PdfPermissionsFlags = security.Permissions
1665
+
Console.WriteLine("Permissions in the document:")
1666
+
' Enumerate all flags and print the enabled ones
1667
+
For Each flag As PdfPermissionsFlags In [Enum].GetValues(GetType(PdfPermissionsFlags))
1668
+
If flag = 0 Then
1669
+
Continue For ' Skip None (0)
1670
+
End If
1671
+
' Check whether the specific flag is set
1672
+
If permissions.HasFlag(flag) Then
1673
+
Console.WriteLine($"- {flag}")
1674
+
End If
1675
+
Next
1676
+
End Using
1677
+
1678
+
{% endhighlight %}
1679
+
{% endtabs %}
1680
+
1681
+
You can download a complete working sample from GitHub.
1682
+
1606
1683
## Remove password from the user password PDF document
1607
1684
1608
1685
You can remove the [UserPassword](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Security.PdfSecurity.html#Syncfusion_Pdf_Security_PdfSecurity_UserPassword) from the encrypted PDF document by using the following code snippet.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Library/NET/Working-with-Text.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3149,6 +3149,40 @@ if (!searchText.Any(text => pageText.Contains(text)))
3149
3149
<br>
3150
3150
Create fonts, brushes, and pens once and reuse them throughout the document to reduce memory usage and improve rendering speed.
3151
3151
3152
+
</td>
3153
+
</tr>
3154
+
</table>
3155
+
3156
+
### Why does `PdfTrueTypeFont` fail to load system fonts automatically?
3157
+
3158
+
<table>
3159
+
<thstyle="font-size:14px"width="100px">Issue
3160
+
</th>
3161
+
<thstyle="font-size:14px">When you create a PdfTrueTypeFont using only a font family name (e.g., "Arial") in .NET Core or cross‑platform apps, the font can fail to load causing missing text, wrong rendering, or "font not found".
3162
+
</th>
3163
+
3164
+
<tr>
3165
+
<thstyle="font-size:14px"width="100px">Reason
3166
+
</th>
3167
+
<td><b>In .NET Framework</b>: the PDF library can resolve installed fonts by name <i>(e.g., new Font("Arial", 20) → new PdfTrueTypeFont(font, true) works)</i>.
3168
+
<br>
3169
+
<b>In .NET Core and cross‑platform environments</b>: system font APIs aren't exposed the same way, so PdfTrueTypeFont cannot locate fonts by name you must provide the actual <i>.ttf</i> file (path or stream) to load the font reliably.
3170
+
</td>
3171
+
</tr>
3172
+
3173
+
<tr>
3174
+
<thstyle="font-size:14px"width="100px">Solution
3175
+
</th>
3176
+
<td>
3177
+
Load the font directly from a <i>.ttf</i> file using a path or stream, then pass it to <ahref="https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Graphics.PdfTrueTypeFont.html">PdfTrueTypeFont</a>. This ensures consistent font embedding across all platforms.
3178
+
{% tabs %}
3179
+
{% highlight C# tabtitle="C#" %}
3180
+
3181
+
PdfTrueTypeFont ttf = new PdfTrueTypeFont("Arial.ttf", 20);
0 commit comments