Blank spaces in PDF java

Hi

I want to display some data after two Blank spaces.

I am using #$TAB for tab, It is working fine, But I want only two blank spaces.

Could you please guide me.

Thanks

Hello Srinivas,

Thanks for considering Aspose.

Aspose.Pdf for Java also supports the capability to place HTML tags inside text object and these objects can be rendered accordingly when generating the PDF document. As per your requirements, please try using the following code snippet. I have tested the scenario with Aspose.Pdf for Java 2.8.0 and I am able to see the expected behavior.

[Java]

// create a PDF object
Pdf pdf = new Pdf();
// create a section object and add it to sections collection of pdf object
Section sec1 = pdf.getSections().add();
// create a text object containing sample text with HTML tags
Text sampletext = new Text("Hello    World");
// set the property of text object so that HTML tags are rendered accordingly
// rather than just displaying them inside PDF
sampletext.setIsHtmlTagSupported(true);
// add the text object to paragraphs collection of section object
sec1.getParagraphs().add(sampletext);
// save the resultant PDF
pdf.save("d:/pdftest/TextWithSpaces.pdf");

In case it does not satisfy your requirements or you have any further query, please feel free to contact.

Thanks for your response.

But I want to display in the existing PDF, My data is coming from database.

Can you give any solution ?

Thanks

Hi Srinivas,

I’m sorry to inform you that Aspose.Pdf.Kit doesn’t allow you to add HTML tags in an existing PDF file. However, if you could share some details regarding your requirement along with some sample output which you want to create using Aspose.Pdf.Kit, we’ll be able to investigate it in detail and guide you accordingly.

We’re sorry for the inconvenience.
Regards,