I am having issues when using Aspose.Pdf.Generator v8.1.0 with hyphens. I have prepared a simple test case so you can reproduce. Two issues are apparent:
1) Alignment does not align correctly when set to justify
2) Words are broken in half at the end of lines
Dim txtinfo As New Aspose.Pdf.Generator.TextInfo
txtinfo.FontSize = 6
txtinfo.WordSpace = 1
txtinfo.FontName = “Arial, Helvetica, sans-serif”
txtinfo.Alignment = AlignmentType.Justify
Dim pdf1 As New Pdf()
Dim sec1 As Section = pdf1.Sections.Add()
sec1.PageInfo.Margin.Left = 20
sec1.PageInfo.Margin.Right = 20
sec1.PageInfo.Margin.Top = 20
sec1.PageInfo.Margin.Bottom = 20
For x As Integer = 1 To 10
Dim str As String = “”
For y As Integer = 1 To 10
If y >= x Then
str += “The quick brown fox jumps over the lazy dog. "
Else
str += “The quick brown fox jumps over the lazy dog - "
End If
Next
str = str.Trim()
Dim txt As New Text(sec1)
Dim sgmnt As New Segment(str, txtinfo)
txt.Segments.Add(sgmnt)
txt.TextInfo = txtinfo
sec1.Paragraphs.Add(txt)
Next
Dim ms As New MemoryStream()
pdf1.Save(ms)
Response.BinaryWrite(ms.ToArray())
Resulting PDF - Paragraph
#1 without hyphens is perfect, Paragraph
#2 with 1 hyphen is misaligned. Paragraph
#3 and on break words in half.
Using a unicode hyphen instead seems to fix the linebreak issue, but not the alignment.
Dim sgmnt As New Segment(str.Replace(”-”, ChrW(&HAD)), txtinfo)
Hi there,
Sorry for the inconvenience faced. I’ve managed to reproduce the reported issue on my side and logged the issue in our bug tracking system for further investigation and resolution. The issue ID is PDFNEWNET-35493. I’ve also linked your request to this issue and you will be notified via this thread as soon as it is resolved.
Please feel free to contact us for any further assistance.
Best Regards,
Can you confirm that this ticket covers both issues presented in the proof of concept, justification and word break?
Hi there,
Thanks for your inquiry. Yes above logged ticket covers both issues. We will keep you updated about issue progress via this forum thread.
Best Regards,
I have also noticed that in the first paragraph, their is a slight alignment issue. This occurs when the period ends at the end of the line. You can see this by highlighting the first paragraph; you will see the highlights are not perfectly aligned.
Please create a ticket for this issue as well.
Please also advise when all three issues are scheduled to be fixed.
Hi John,
Sorry for the delayed response.
I have tested the scenario and as per my observations, the indent of paragraphs is increasing. On every subsequent paragraph, one character is moved to next line. See attached image file. For the sake of correction, I have separately logged this problem in our issue tracking system as PDFNEWNET-35553. We will investigate this
issue in details and will keep you updated on the status of a correction.
In case your problem is different from above specified issue, please share some further details and if possible, mark the areas in image file for better understanding. We apologize for your inconvenience.
I am not able to reproduce the third issue PDFNEWNET-35553 with Aspose 8.3.0. However I see you were not either able to reproduce identically to what I got because of another bug similar to what is reported at https://forum.aspose.com/t/82688. You can see in your screenshot the right margin and left margin are not the same even though the code says both sides should be 20.
The first two issues (<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””>PDFNEWNET-35493) are still affecting Aspose 8.3.0
Hi John,
The development team has been busy resolving other priority issues and I am afraid the above stated problem is not yet resolved. However, as soon as we have made some significant progress towards the resolution of this issue, we would be more than happy to update you with the status of correction. Please be patient and spare us little time. Your patience and comprehension is greatly appreciated in this regard.
Is there any update on these issues? The latest 8.4.0 does not seem to resolve these issues. These issues have been open for 2 1/2 months without any update.
Hi John,
Thanks for your patience.
The development team has been busy resolving other priority issues and I am afraid the earlier reported issues are not yet resolved. Please note that as a normal rule of practice, issues are resolved on a first come, first serve basis; but the problems logged/reported under Enterprise or Priority support model, have high precedence in terms of resolution, as compared to issues under normal/ free support model.
In case you need to have your issue prioritized, you may consider opting for Enterprise or Priority support options. Nonetheless, note that ES/PS support does not guarantee any immediate resolution of issues (because it might be dependent on other issues or features which need to be implemented) but under this model, the development team starts investigating the problem on high priority. For further details, please visit Support Options.
We are sorry for this delay and inconvenience.
I understand the support model and have suggested to my company getting priority support. But as you said, there are no guarantees, so my company prefers not waste money on this. They would more quickly look for a competing product that is more stable than opt for non-existent support and hopes.
Regardless, the next release of Aspose PDF would be October 4, which would make this issue 3 1/2 months old (since creating a POC, it was discovered way before that and I don’t understand how this has never been reported before). I don’t think waiting 3 1/2 months is acceptable under ANY support model, particularly that there are no guarantees and we would still need to build the client requirements after that. That would be setting back our clients 6-9 months or so, taking into account when they first requested these changes, when we discovered these bugs (this and several others reported on the forums), when we were finally able to replicate in a POC, when you guys might fix this, when client changes can be implemented, tested (and this would take extremely long knowing that Aspose has so many quirks that need to be tested) and pushed to production. Certainly this is not acceptable for our company, and in turn our vendors.
Hi John,
We truly sorry for the inconvenience caused. I’ve recorded your concerns and raised issue priority to expedite its investigation. I’ve also requested our development team to share an ETA at their earliest. We will update you as soon as we get a feedback.
Moreover in reference to priority support model, it guarantees an initial response within 12 hours of an issue being raised during business days and issue will be put in the development queue above issues raised via free support. We cannot guarantee a complete resolution in this timescale but you will get an assessment of the issue. Where we can, we provide simple fixes and work-arounds immediately. Issues that demand a fix can take longer. Hotfixes can be provided in consultation with the customer. Large fixes are prioritized and fed into the normal product development cycle. Usually issues are fixed in next release If it doesn’t need some major structural change in API.
Please feel free to contact us for any further assistance.
Best Regards,
Hi,
Thanks for your patience. I am pleased to share that the issue PDFNEWNET-35493 Alignment justification issue with hyphens reported earlier has been resolved the latest release of Aspose.Pdf for .NET 8.5.0. Please try using the new DOM approach to generate correct output. Please take a look at the following code snippet.
For your reference, I have also attached the resultant PDF generated over my end.
C#
Document doc = new Document();
Page page = doc.Pages.Add();
TextState textState = new TextState();
textState.FontSize = 6;
textState.WordSpacing = 1;
textState.Font = FontRepository.FindFont("Arial");
page.PageInfo.Margin.Left = 20;
page.PageInfo.Margin.Right = 20;
page.PageInfo.Margin.Top = 20;
page.PageInfo.Margin.Bottom = 20;
for (int x = 1; x <= 10; x++)
{
String str = "";
for (int y = 1; y <= 10; y++)
{
if (y >= x)
str += "The quick brown fox jumps over the lazy dog. ";
else
str += "The quick brown fox jumps over the lazy dog - ";
}
str = str.Trim();
TextFragment txt = new TextFragment();
txt.Text = str;
txt.TextState.ApplyChangesFrom(textState);
txt.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment. Justify;
page.Paragraphs.Add(txt);
}
doc.Save("c:/pdftest/JustifyText_output.pdf");
The issues you have found earlier (filed as PDFNEWNET-35493) have been fixed in Aspose.Pdf for .NET 8.5.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.