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
This article shows a sample approach how to convert a colored PDF document to a grayscale one with RadPdfProcessing.
20
+
This article shows a sample approach how to convert a **colored** PDF document to a **grayscale** one with [RadPdfProcessing]({%slug radpdfprocessing-overview%}).
21
+
22
+

21
23
22
24
## Solution
23
25
24
26
To convert a colored PDF file to black and white using Telerik Document Processing, follow the steps below:
25
27
26
-
1. Use the [RadPdfProcessing](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/overview) library to import the PDF file.
27
-
2. Iterate through the content of the PDF file, including Path, TextFragment, and Image instances.
28
+
1. Use the [RadPdfProcessing]({%slug radpdfprocessing-overview%}) library to import the PDF file.
29
+
2. Iterate through the content of the PDF file, including [Path]({%slug radpdfprocessing-model-path%}), [TextFragment]({%slug radpdfprocessing-model-textfragment%}), and [Image]({%slug radpdfprocessing-model-image%}) instances.
28
30
3. Modify the colors to grayscale and export the processed file as a new PDF document.
29
31
30
32
Here is a complete code snippet that demonstrates how to achieve this conversion:
Ensure to adjust the `MakeGrayscale` methods for `ColorBase`, `Path`, and `Image` according to your specific needs. This sample demonstrates the basic approach to converting document elements to grayscale but might require adjustments for complex scenarios or specific color processing requirements.
-[Conditional Formatting in Telerik Reporting](https://docs.telerik.com/reporting/designing-reports/connecting-to-data/expressions/using-expressions/conditional-formatting)
-[Converting Colored PDF Documents to GrayScale with Telerik Document Processing]({%slug convert-color-pdf-to-black-and-white-telerik-document-processing%})
-[Converting Colored PDF Documents to GrayScale with Telerik Document Processing]({%slug convert-color-pdf-to-black-and-white-telerik-document-processing%})
0 commit comments