Flags enumeration to manage the advanced rasterization options to be applied.
publicenumAdvancedRasterizationOptions
Values
Name
Value
Description
None
0
No advanced options to apply.
Tilt
1
Tilt to incline the rasterized image to a random angle.
Noise
2
Add random spots to rasterized page images.
Border
4
Add border line to imitate page scan effect.
Grayscale
8
Make page images grayscale to imitate grayscale scan.
Examples
The following example demonstrates how to apply the advanced rasterization options with default settings.
using(Redactorredactor=newRedactor(@"C:\sample.docx")){// Save the document with default options (convert pages into images, save as PDF)varso=newSaveOptions();so.Rasterization.Enabled=true;so.RedactedFileSuffix="_scan";so.Rasterization.AddAdvancedOption(AdvancedRasterizationOptions.Border);so.Rasterization.AddAdvancedOption(AdvancedRasterizationOptions.Noise);so.Rasterization.AddAdvancedOption(AdvancedRasterizationOptions.Grayscale);so.Rasterization.AddAdvancedOption(AdvancedRasterizationOptions.Tilt);redactor.Save(so);}
The following example demonstrates how to apply the border advanced rasterization option with custom settings.
using(Redactorredactor=newRedactor(@"C:\sample.docx")){// Save the document with a custom bordervarso=newSaveOptions();so.Rasterization.Enabled=true;so.RedactedFileSuffix="_scan";so.Rasterization.AddAdvancedOption(AdvancedRasterizationOptions.Border,newDictionary<string,string>(){{"border","10"}});redactor.Save(so);}
The following example demonstrates how to apply the noise advanced rasterization option with custom settings.
using(Redactorredactor=newRedactor(@"C:\sample.docx")){// Save the document with the custom number and size of noise effectsvarso=newSaveOptions();so.Rasterization.Enabled=true;so.RedactedFileSuffix="_scan";so.Rasterization.AddAdvancedOption(AdvancedRasterizationOptions.Noise,newDictionary<string,string>(){{"maxSpots","150"},{"spotMaxSize","15"}});redactor.Save(so);}
The following example demonstrates how to apply the tilt advanced rasterization option with custom settings.
using(Redactorredactor=newRedactor(@"C:\sample.docx")){// Save the document with the custom tilt effectvarso=newSaveOptions();so.Rasterization.Enabled=true;so.RedactedFileSuffix="_scan";so.Rasterization.AddAdvancedOption(AdvancedRasterizationOptions.Tilt,newDictionary<string,string>(){{{"minAngle","85"},{"randomAngleMax","5"}});redactor.Save(so);}