Gets or sets a value indicating whether all pages in the document need to be converted to images and put in a single PDF file. TRUE by default, set to FALSE in order to avoid rasterization.
The following example demonstrates how to set options for the rasterization process.
using(varredactor=newRedactor("SomePresentation.pptx")){// redact sensitive data on the first slide varrasterizationOptions=newRasterizationOptions();rasterizationOptions.PageIndex=0;rasterizationOptions.PageCount=1;rasterizationOptions.Compliance=PdfComplianceLevel.PdfA1a;using(varstream=File.Open(Path.Combine(@"C:\Temp","PresentationFirstSlide.pdf"))){redactor.Save(stream,rasterizationOptions);}}
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);}