Free Support Forum - aspose.cloud

Draw horizontal line at the end of a line to page margin in PHP using Aspose Cloud APIs

Hi there,

I’m developing a php-based web application which should (1) generate docx, pdf and pdf/a files from a docx-template from which some text variables should be replaced and other text blocks should be discarded.

In these generated pdf and pdf/a documents, (2) straight solid horizontal lines should programmatically be drawn from the end of every text line to the right page margin. (or maybe it would be possible to do this within a docx document which could be converted to a pdf or pdf/a document)

Could the above requirements be met when using Aspose.PDF Cloud PHP SDK and Aspose.Words Cloud PHP SDK? Maybe by detecting the coordinates of the end of each line or maybe by detecting each line break?

https://docs.aspose.com/pdf/net/determine-line-break/ seems like a possible solution but it’s the .NET solution… :frowning:

If so, where can I find the documentation to do so (especially when it comes to drawing these lines) and if not, is it possible to extract all of the text from an existing pdf document line by line?

If that also couldn’t be done, what other solution could Aspose provide for the above requirements?

I was also wondering whether the PHP SDK for Words and PDF provide the same functionality as (for example) the similar Java or .NET solutions…

@EPSSThomas

We are investigating your requirement. Meanwhile, please share your input document and expected output document. It will help us to address your requirement exactly.

Check out this example in docx. Take notice: the bold text would be a variable. In the second example the variable breaks the text line. Nevertheless, the horizontal line should be drawn… as far as I know this is not possible in docx, because single text lines are not defined in ooxml. So, that’s why I guess the lines should be drawn in pdf…

Happy the learn about your solution :slight_smile:

1 Like

@EPSSThomas

1. replace some variables with new values
You may use Mail Merge feature to replace the variables with new values in a single API call

2. discard(delete text)
You can use replace text/delete range/delete paragraph, what you want, we have many methods to do it.

3. add a horizontal line (straight solid horizontal lines should programmatically be drawn from the end of every text line to the right page margin).
We have logged a ticket(WORDSCLOUD-1573) to investigate the requirement and suggest a solution.

Thank you, Tilal! I’m looking forward to your response.

In addition to above: would it also be possible - when generating an output docx- or pdf(/a) document from a template docx - to add table rows depending on the number of the records I’d input?

@EPSSThomas

Yes, Aspose.Words Cloud API supports working with the feature. You can create a table in a Word document or add new rows to a table. Please check the following documentation article for more details.

Working with Tables

Hi Tilal,

You’ve logged ticket WORDSCLOUD-1573 to investigate my requirement and to suggest a solution. That’s great! How much time do you expect it will take to investigate?

@EPSSThomas

I am afraid we cannot share any ETA at the moment. As we have recently logged the issue and it is pending for investigation in a queue. We will update you as soon as its investigation is planned and completes.

Hi there Tilal,

Is there any news already?

@EPSSThomas

We have completed the analysis of your requirement. Now we will plan the feature implementation. But I am afraid we cannot share any ETA at the moment. However, we will update you as soon as any further update gets available.

To be sure: you are talking about the line drawing?

Will this be available in your Java solution when implemented?

@EPSSThomas

Yes, we are talking about the WORDSCLOUD-1573, drawing horizontal lines in a Word document.

Yes, once we implement the feature in Aspose.Words REST API then it will be included in Aspose.Wods Cloud SDKs include Java SDK.