I am uploading document from UI and open it with Adobe Reader view in my web application in c# language. I have used Aspose.Pdf namespaces.
When I set option ‘Disable Print’ to true in document then document’s all hyperlink is not working and redirecting (treated as text only with underline) but when I set option ‘Disable Print’ to false then its working fine.
We want to customized only Enable print and disable print , that shouldn’t affect to hyperlink or any other permissions.
Version : Aspose.PDF 22.12.0
PDF - There is FileUpload control in UI, so any one can upload file from their local system. Any file upload by UI is converted to aspose pdf with customize things like add password protection, disable printing etc.
I am attaching two file TestPDF.pdf is the one which is initially uploaded by user and TestPdfConverted.pdf is after converting to aspose PDF with all settings applied.
TestPdfConverted.pdf - Hyperlink is not working when I set disable printing option to true.TestPdfConverted.pdf (38.3 KB) TestPdf.pdf (37.4 KB)
I do not know what type of validations are you using.
I generated that document via Aspose using the source document that you provide us, then I executed only the lines I showed abode. Then I opened via Adobe Acrobat DC:
The links are working. as you can see in the picture.
If you do not want to open the files I attached, you can simply replicate everything I did including the code.
Keep in mind I am using Version 23.1
When else part is executed its working fine but not working for If part. So how is this related to flatten(), becuase for both cases flatten() will call.
I removed the if, let the code be executed always(as if the the boolean was false) and the hyperlinks dissapear.
The Flatten method is the one removing the hyperlinks.