The Umbraco Import from Pdf allows user to get contents from Pdf document. This macro make it easy to get from Pdf file on any location either Adobe Reader is not available and displayed them online.It adds a simple file browser control and Import from Pdf button, by clicking on Import from Pdf it converts into html and then display content of Pdf document online.
Below are few screenshots to show hows it work.
Please check our blog post for more details
Below the Codebehind Import from Pdf:
~~~~~
if (FU_Doc.HasFile)
{
// Check for license and apply if exists
string licenseFile = Server.MapPath("~/App_Data/Aspose.Total.lic");
if (File.Exists(licenseFile))
{
License license = new License();
license.SetLicense(licenseFile);
}
// Initialize the stream to read the uploaded file. Stream myStream = FU_Doc.FileContent; //open document Document pdfDocument = new Document(myStream); string path = Server.MapPath(".")+"//"+FU_Doc.FileName.Replace(".pdf",".html"); pdfDocument.Save(path,SaveFormat.Html); string extractedText = File.ReadAllText(path); div_display.InnerHtml = extractedText; } else { LBL_Error.Text = "Please Upload File"; }
~~~~
Please check the video below to see this macro in action.