Hello,
For PDF documents which have a SYSTEM entity, we would like to disable the expansion of this entity.
<!ENTITY entity SYSTEM ...>
I saw that for word documents, there is a ResourceLoadingCallback property where we can say for external references, skip doing the load (DocumentBase.ResourceLoadingCallback | Aspose.Words for .NET). Is there something similar for PDF? I could not find anything about that in the documentation.
This is the code we’re using. Our use case is simply to get the first page of a PDF document as an image.
Document document = new Document(request.sourcePath);
using (var imageStream = new FileStream(firstPagePngPath, FileMode.Create))
{
var resolution = new Resolution(300);
var pngDevice = new PngDevice(resolution);
pngDevice.Process(pdfDocument.Pages[1], imageStream);
}
I can provide a sample PDF document that has this SYSTEM entity if that is helpful.
@vincenc
Thank you for contacting support.
Please share the source PDF document so that we may investigate and assist you accordingly.
test.pdf (113.2 KB)
I’ve attached a PDF document. To reproduce the issue, you will need an endpoint that you control for which you can monitor network traffic. Then, you would need to open the document I’ve attached above in a text editor like notepad and replace “https://d5n9e4ssea.execute-api.us-east-1.amazonaws.com/Prod/” (the endpoint I was using with testing) with your own endpoint. After you run the sample code I attached in the original post, you should be able to see that your endpoint was called in the logs for your endpoint.
I happened to create my endpoint using AWS’s API gateway and had a lambda to print a debug line to cloudwatch logs to indicate that the endpoint was being invoked, but if you have other ways of creating an endpoint, that should work as well.
@vincenc
Thank you for sharing requested information.
We have logged an investigation ticket with ID PDFNET-46426 in our issue management system. We will update you as soon as any significant information is available in this regard.
@vincenc
We have investigated it further and are unable to reproduce it with Aspose.PDF for .NET 19.5 in our environment. Would you please ensure using latest version of the API and share your kind feedback with us. In case the issue persists, then please provide more information about this, .NET version, OS version, any other special condition to use so that we may proceed further.