Free Support Forum - groupdocs.com

Unable to open document error in file loading


#1

Hii,
I am using GroupDocs Comparison .When i am trying to implement it gives an error ‘Unable to open Documents’.I also want to compare files which comes from database .


#2

Hello,


Thank you for your request. Sorry but Comparison doesn’t support streams. To work with files from the DB you should save them to the root storage and then after comparing you can remove them.

As for the issue - make sure that you have read/write access for the root storage folder.

Thank you.

#3

Thnx for reply .But i am using static file which is present in App_Data but still it will not work gives error as Unable to open document .


#4

Hello,


Thank you for coming back. Could you please share with us the Comparison widget code and the screenshot of the App_Data folder structure.

Also will be helpful if you will share with us the documents which you try to compare.

Thank you

#5

I already share my code .Did you get it or not plz inform me


#6

Hello,


Sorry I don’t get your code. Could you please send it again.

Thank you

#7

@using Groupdocs.Web.UI.Comparison



@(Html.Comparison("#comparison-wrapper")
.SourceFileName(“Suchi2.pdf”)
.TargetFileName(“Suchi3.pdf”)
.ResultFileName(“Suchi5.pdf”)
.ImmediateCompare())






#8

Hello,


Thank you for the code example. We have checked it and all works fine for us. Looks like the issue is document related - please share with us the Suchi2.pdf and Suchi3.pdf.

Also please make sure that in the Gloabal.asax in the App_Start action you have exactly the same code:
AreaRegistration.RegisterAllAreas();

FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);

var comparisonSettings = new ComparisonWidgetSettings
{
RootStoragePath = Server.MapPath("~/App_Data/"),
ComparisonBehavior =
{
StyleChangesDetection = true,
SummaryPageGenerationEnabled = true
}
};
GroupdocsComparison.Init(comparisonSettings);

And in the Web.config you have:
<system.webServer>
</system.webServer>

Thank you.

#9

Thnx for quick response.i already mentioned code which is provided by you in Global.asax and Web.config files


#10

Hello,


Thank you for the documents. We have checked them in our common demo examples and your documents were opened successfully.Could you please try your documents in our demo examples.
Also about your documents - you will not get any changes since this documents are scanned and they don’t have text layer. Please check attached pdf documents to found out which pdf could be compared.

Also please note that our Comparison can compare only the text content.

If in our common examples pdf documents will work please compare it with your project to found out what is wrong or share with us your project example and we will fix it for you.

Thank you.

#11

Thnx .It is working fine for attached document .I think it creates problem in Result file name .So Can you plz tell me what file should be remain in .ResultFileName is it a new pdf having empty text ??If possible plz provide me sample pdf for that.


@(Html.Comparison("#comparison-wrapper")
.SourceFileName(“test1.pdf”)
.TargetFileName(“test2.pdf”)
.ResultFileName(“Suchi5.pdf”)
.ImmediateCompare())


#12

Hello,


Glad to hear that the issue is resolved. The result file will be created by the Comparison library and this file will be overwritten if you will use the same file name for several times. Since that you don’t need to create a pdf with empty text. Also you can use any file name that you want for the result file. Only it’s extension does matter.

Thank you .

#13

Yes this issue was resolved .Thnx Pavel for your quick response.


#14

Hello,


Glad to hear that the issue is resolved.

Thank you.