Hidden layer or text on image to make embedded images searchable

Hi

We are create a new PDF document images and Text with .Net PDF.
Our goal is to insert the image and add the text to make the PDF searchable.

I have looked in the docuumentation and google but found nothing, also this link below regarding the layers is dead http://www.aspose.com/docs/display/pdfnet/how+to+create+multilayer+pdf+document

Could you please be so kind to answer the following questions

1) Is the layer best way to add hidden text ? if not what should I use then
2) Could you provide a working example, in vb.net

Cheers

Hi Christian,


Thanks for your inquriy. I am afraid currently Aspose.Pdf for .NET does not support to add hidden text. However in upcoming release i.e. Aspose.Pdf for .NET 11.4.0, hidden text feature will be available. A new “Invisible” property of TextState will be used as following. Hopefully it will help you to accomplish the task.

TextFragment frag2 = new
TextFragment(“This
is invisible text.”
);<o:p></o:p>

//Set text property - invisible

frag2.TextState.Invisible = true;


Please feel free to contact us for any further assistance.


Best Regards,

Hi Tilal,

We need to be able to read the Invisible property too
Do you know when will this feature be available or could you give me any workaround to query this property?

Thank you,

Christophe

Hi Christophe,


Thanks for your inquriy. As stated above the feature would be available in upcoming release 11.4.0 and hopefully it will be published in next week.

Furthermore, you can read Invisible property of TextState as following in 11.4.0 version. Please note this will only work for the hidden text added by Aspose.Pdf API, as different applications follow different techniques for hidden text.

//Create document with hidden text<o:p></o:p>

Aspose.Pdf.Document doc = new Aspose.Pdf.Document();

Page page = doc.Pages.Add();

TextFragment frag1 = new TextFragment("This is common text.");

TextFragment frag2 = new TextFragment("This is invisible text.");

//Set text property - invisible

frag2.TextState.Invisible = true;

page.Paragraphs.Add(frag1);

page.Paragraphs.Add(frag2);

doc.Save(myDir + "39400_out.pdf");

doc.Dispose();

//Search text in the document

doc = new Aspose.Pdf.Document(myDir + "39400_out.pdf");

TextFragmentAbsorber absorber = new TextFragmentAbsorber();

absorber.Visit(doc.Pages[1]);

foreach (TextFragment fragment in absorber.TextFragments)

{

//Do something with fragments

Console.WriteLine("Text '{0}' on pos {1} invisibility: {2} ",

fragment.Text, fragment.Position.ToString(), fragment.TextState.Invisible);

}

doc.Dispose();

Please feel free to contact us for any further assistance.


Best Regards,

Hi Tilal,


Thank you for this precise answer.

Do you know any other way to detect searchable PDF (where text is hidden) using current Aspose PDF API?

Please find attached a searchable PDF

Regards,

Christophe

Hi Christophe,


Thanks for your inquriy. I am afraid currently Aspose.Pdf does not have any option to identify a searchable(scanned) PDF document. We have already logged a ticket PDFNEWNET-40293 for the requirement. We will keep you updated about the issue resolution progress.

We are sorry for the inconvenience caused.

Best Regards,

The issues you have found earlier (filed as PDFNEWNET-39400) have been fixed in Aspose.Pdf for .NET 11.4.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.