You are viewing limited content. For full access, please sign in.

Question

Question

DocumentExporter.ExportPDF failing with "Access denied. [9013]" error

asked on March 17, 2017

Hi,

When I run the SDK DocumentExporter.ExportPDF method with a windows user account, I have no problems.  When I use an application ID license account, I receive the "Access denied. [9013]" error.

This same code, same license, username, rights, etc. runs on my Development and Test environments (with both windows account and Application ID login) so, I know the code is good.  I am running out of ideas of what to look for on my Production platform.

Thanks,

Bruce

 

0 0

Replies

replied on March 20, 2017

Thanks Robert!

I think you nailed it.

Production user only has "Browse" rights.

You made my day,

Bruce

1 0
replied on March 17, 2017

Check the exception for a call stack, it should help narrow down which part of the export is failing.

Also, try retrieving the document image/text data using a different method and see if that also fails with Access Denied:

PageInfo page = lfpages.GetPage(1);

String imageTempFile = Path.GetTempFileName();
using (Stream imageStream = page.ReadPagePart(PagePart.Image))
using (var tempStream = File.OpenWrite(imageTempFile))
{
    imageStream.CopyTo(tempStream);
}

String textTempFile = Path.GetTempFileName();
using (Stream textStream = page.ReadPagePart(PagePart.Text))
using (var tempStream = File.OpenWrite(textTempFile))
{
    textStream.CopyTo(tempStream);
}

 

0 0
replied on March 17, 2017

Thanks for the tip.

I tried to implement your suggestion and my code failed when attempting to get any page info, same error.

DocumentInfo documentInfo = Document.GetDocumentInfo(entryIdIn, sessionIn);

PageInfo page = documentInfo.GetPageInfo(1);//Fails here with the 9013 'Laserfiche.RepositoryAccess.AccessDeniedException'

 

0 0
replied on March 17, 2017

For some reason that account lacks read access on the document.  Try calling documentInfo.GetEffectiveRights() and verify that the user has EntryRights.Read.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.