Hyperlinks in Final Generated PDF(converting from rtf to PDF) are opening in same iframe instead of new window

Hi ,

Issue in my case is after converting from rtf to PDF the final the generated PDF has Hyperlinks in it where when I try to open the links in the PDF they are opening in the same iframe instead of different window. I want the link to open in new window. Please help me with this.
Below is the code which I tried.
Document doc = new Document(srcFilePath);
PdfSaveOptions options = new PdfSaveOptions()
options.setOpenHyperlinksInNewWindow(true);
doc.save(destFilePath, options);

Thanks :slight_smile:

@nikesh898

Thanks for your inquiry. Please share your input and output documents as ZIP file along some more details to replicate the issue at our end. We will test the scenario and will guide you accordingly.

Hi Tilal,

Thanks for the Quick reply.
Scenario is when the link is converted from RTF to PDF and in the final generated PDF when we click on the link it is opening in the same iframe, instead of opening in the different window, and am also including the iframe code below,

Please include the Src attribute as in the iframe, src="<%=System_Token_Manager.addSecurityTokenToURL(request_URL)%>" style=" width:100%; text-align:center; height:460px;" name=“myIframe” id = “myIframe”

Sorry,

find the Correct Src Attribute below

src=“PdfFileWithEmbeddedLink.pdf” style=" width:100%; text-align:center; height:460px;" name=“myIframe” id = "myIframe

@nikesh898

Thanks for your feedback. I am afraid we cannot replicate issue with provided information at our end. Please share following resources here to investigate and address your issue exactly.

  • Your input Word document.
  • You output PDF document.
  • Please create a simple application (source code without compilation errors) that helps us to reproduce your problem on our end.

Hi Tilal,

I have tried pdfSaveoptions Class and also used setOpenHyperlinksInNewWindow method in it. can you tell me is there any other alternate method i can use. OR do i need to get the latest version of aspose-words because currently i am using aspose-words-17.5-jdk16 version.
Can you please tell me other Ways where i can resolve this issue.
Issue:
In our Current Application the Hyper links in the final Generated PDF are opening in the same window. We want to open the hyperlinks in the new window whenever our Users click on the links. we are using Aspose.words 17.5 verison to convert Word to PDF.
Please Tell me the which Version i can use to resolve the issue.

Thanks in advance.

@nikesh898

Thanks for your feedback. You may try latest version of Aspose.Words for Java. But I am afraid we cannot suggest you anything without replicating the issue at our end. As already requested above, please share following resources. We will look into the issue and will guide you accordingly.

  • Your input Word document.
  • You output PDF document.
  • Please create a simple application (source code without compilation errors) that helps us to reproduce your problem on our end.