Hi,
I am a new user of your libraries and I am doing a demo for a client.
I downloaded the GroupDocs.Viewer library version 20.11.0 via NuGet (VS 2017), there and I’m trying to view a file (in this case .docx reading from Azure).
Testing and debugging locally, I get the following error:
GroupDocs.Viewer.Exceptions.GroupDocsViewerException
HResult=0x80131500
Message=Accesso al percorso ‘C:\Program Files (x86)\IIS Express\output.pdf’ negato.
Source=GroupDocs.Viewer
StackTrace:
at . (Int32[] , IFileStreamFactory )
at .(Int32[] , PdfViewOptions , )
at . (Func2 , ViewOptions , Int32[] ) at . (Func2 , ViewOptions )
at GroupDocs.Viewer.Viewer.View(ViewOptions options)
at DocMaster.Page.Preview.Page_Load(Object sender, EventArgs e) in C:\Source\Repos\Silversea\Silversea-DocumentMaster\DocMaster\Page\Preview.aspx.cs:line 92
We’ve an update on VIEWERNET-2948. Your code is fine. However, it seems that the app doesn’t have access to the folder. When rendering any file, the default view options e.g. new PdfViewOptions() is saving output file to the current directory. In this case current directory is 'C:\Program Files (x86)\IIS Express', and error says that the application doesn’t have access to this folder. There are few options:
Try running Visual Studio as Administrator
Set output path in PdfViewOptions to some folder that is accessible by the application
Have a look at following code:
using (Viewer viewer = new Viewer(streamFactory))
{
PdfViewOptions viewOptions = new PdfViewOptions(@"D:\output\output.pdf");
viewer.View(viewOptions);
}
Hi,
I tried as Administrator and I don’thave the error, but the page that appears is completely blank.
I tried to change File ( .pdf and .pptx) it always remains blank.
I also tried to put a path in the PdfPreviewoption, but nothing changes.
Could you please confirm if you are getting output/resultant PDF file in the output directory? If yes, please tell, how you are rendering/displaying that PDF in browser?
The core feature of the API is just to convert the source file into PDF, HTML or Image. Later, you have to render the resultant file(s) in browser using custom logic/code.
Hi,
I confirm that the file is generated correctly in the output folder.
I did not realize that the rendering part was left to a custom logic. No problem.
Question: Can the rendering function directly return a byte[] or stream of the generated file (.PDF in this case)? So to integrate everything into a C# handler?