Hi,
I have implemented richtextbox editor in asp.net MVC, but actually, I need to load/open a pdf file within the richtextbox editor. so please suggest how to implement it.
Thanks and help will be appreciable.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mohamed AbedallahPosted Sep 28, 2017, 11:42 AM
https://www.leadtools.com/help/leadtools/v19m/dh/pdf/pdfobject.html
The code is very simple:
/**********************************/
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Pdf;
StringBuilder sb;
sb = new StringBuilder();
PDFDocument document = new PDFDocument(@"PDFs\leadtools.pdf");
PDFParsePagesOptions options = PDFParsePagesOptions.Objects;
document.ParsePages(options, 1, -1);
foreach (PDFDocumentPage page in document.Pages)
{
Console.WriteLine("Page #" + page.PageNumber.ToString() + " Started");
foreach (PDFObject obj in page.Objects)
{
if (obj.ObjectType == PDFObjectType.Text)
{
if (obj.TextProperties.IsEndOfLine)
sb.AppendLine(obj.Code.ToString());
else
sb.Append(obj.Code);
}
}
Console.WriteLine("Page #" + page.PageNumber.ToString() + " finished");
}
this.Text = "Finished";
Sameer ShaikPosted Sep 25, 2017, 7:15 AM