Hi,
I am converting excel to pdf. When excel has date, I am applying some styles on it and converting it to pdf. The next cell of this row i.e. B2 is shifting its content towards right. Attaching the Actual excel and output generated.
Test.zip (48.7 KB)
@shreyap
Could you provide code you are using?
Aspose PDF can export PDF to Excel but as I know can’t backwards
maybe your case is related to Aspose Cells
var doc = new Aspose.Pdf.Document(tempFileName);
var searchTerm = "\\[(?s)(.*?)\\]";
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber(searchTerm);
TextSearchOptions textSearchOptions = new TextSearchOptions(true);
textFragmentAbsorber.TextSearchOptions = textSearchOptions;
doc.Pages.Accept(textFragmentAbsorber);
TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;
var foregroundColor = isTranslucent ? Color.Black : Color.White;
var backgroundColor = isTranslucent ? Color.Gray : Color.Black;
foreach (var textFragment in textFragmentCollection)
{
textFragment.Text = textFragment.Text.Replace("[", "").Replace("]", "");
textFragment.TextState.ForegroundColor = foregroundColor;
textFragment.TextState.BackgroundColor = backgroundColor;
}
doc.Save(tempFileName);
This is the code I am running on the pdf generated. Attaching the test pdf and the output pdf for reference.
TestShiftOutput.pdf (30.1 KB)
TestShift.pdf (29.7 KB)
@shreyap
Let me clarify - your issue is related to excel to pdf converson or with TextAbsorber when you process pdf you are not satisfied with?
@shreyap
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PDFNET-58136
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
On first sight it seems like some bug, therefore I added task for development team
@ilyazhuykov
I did some debugging from my side and I suspect below line of code is the culprit.
textFragment.Text = textFragment.Text.Replace("[", "").Replace("]", "");
FYI, It is happening only in the cases when I am trying to replace date kind of texts.
Quicker response is really appreciated.
@shreyap
Thank you for additional information
For now task is added and wasn’t assigned to anyone
If there will be fix it won’t arrive until next version which is 24.10