Page 1 of 1

How to eliminate blue text and hyperlink from documents?

Posted: Tue Apr 30, 2019 4:11 am
by Prakasha NB
We are rendering some of the documents like Closing Statement,Disclosure Form,CDF and Master Statement by following lines of code(For Reference). Documents are getting generating fine but we are getting blue text and hyperlink in the documents.

How can we eliminate blue text and hyperlink from rendered documents?. I have attached the sample document generated from this.

IDocumentInfo docInfo = docMgr.Documents.Where(t => t.Title == docName && t.Identifier.Name.Contains("DOC")).First();
RenderPrompts prompts = new RenderPrompts();
context = GetContext(identifier, Order);
IRendering rendering = renderer.Render(docInfo, context, prompts);
string FileName = string.Format("{0}_{1}", OrderNumber, docInfo.Title);
string FilePath = Convert.ToString(ConfigurationManager.AppSettings["SoftProDocPath"]);
string GeneratedFile = string.Format("{0}\\{1}.pdf", FilePath, FileName);
using (Stream file = File.Create(GeneratedFile))
{
ExportSettings Settings = new ExportSettings() { Format = DocumentFormat.PortableDocumentFormat, Redacted = true };
Stream docStream = rendering.Export(Settings);
docStream.Seek(0, SeekOrigin.Begin);
docStream.CopyTo(file);
}
docDict.Add(string.Format("{0}.pdf", FileName), new MemoryStream(File.ReadAllBytes(GeneratedFile)));
File.Delete(GeneratedFile);

Thanks in Advance.

Re: How to eliminate blue text and hyperlink from documents?

Posted: Tue Apr 30, 2019 4:40 pm
by Lisa Ennis
There is a Boolean property you need to set called RemoveHotspots in the ExportSettings class. This needs to be set to True.

If you are on an older version of Select, and the RemoveHotspots property is not on the ExportSettings class, the IRenderer interface has a DisableHotspots Boolean property that, if set to true, would do the same thing.

Hope this helps.

Re: How to eliminate blue text and hyperlink from documents?

Posted: Thu May 02, 2019 7:38 am
by Prakasha NB
I could not find both RemoveHotspots property on the ExportSettings class and DisableHotspots Boolean property on the IRenderer interface :( .

See below ExportSettings and IRenderer metadata. Our Select version is 4.3.60210.48, Are those properties private? :roll:

public sealed class ExportSettings
{
public static readonly ExportSettings Default;

public ExportSettings();

public DocumentFormat Format { get; set; }
public bool Redacted { get; set; }
}

public interface IRenderer : IDisposable
{
void RegisterService(Type serviceType, object serviceInstance);
IRendering Render(IDocumentInfo document, object context, IPrompt<PromptEventArgs> prompt);
IRendering Render(IRenderable renderable, object context, IPrompt<PromptEventArgs> prompt);
IRendering Render(IRenderingSnapshot snapshot, object context, IPrompt<PromptEventArgs> prompt);
Task<IRendering> RenderAsync(IDocumentInfo document, object context, IPrompt<PromptEventArgs> prompt, IProgress<ProgressEventArgs> progress, CancellationToken cancellationToken);
Task<IRendering> RenderAsync(IRenderable renderable, object context, IPrompt<PromptEventArgs> prompt, IProgress<ProgressEventArgs> progress, CancellationToken cancellationToken);
Task<IRendering> RenderAsync(IRenderingSnapshot snapshot, object context, IPrompt<PromptEventArgs> prompt, IProgress<ProgressEventArgs> progress, CancellationToken cancellationToken);
}

Re: How to eliminate blue text and hyperlink from documents?

Posted: Thu May 02, 2019 10:33 am
by Lisa Ennis
This is available as a public option in version 4.4.0 and above. This was not a public option in earlier versions.