We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Word wrap not working as expected

Hello,

Where entering a long line of text with spaces as word-breaks it does not wrap at end of line.
This happens where the words are separated by instead of
Example below.
Thanks
Martin

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"><fo:layout-master-set>	<fo:simple-page-master master-name="A4" page-width="210mm" page-height="297mm"><fo:region-body/></fo:simple-page-master></fo:layout-master-set><fo:page-sequence master-reference="A4"><fo:flow flow-name="xsl-region-body"><fo:block><fo:inline>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ,bbbbbbbbbbbbbbbbbbbbbbbbbbb ,ccccccccccccccccccccccccccccc ,dddddddddddddddddddddddddd</fo:inline></fo:block></fo:flow></fo:page-sequence></fo:root>

@Martin_Osterberg

Thanks for contacting support.

Would you please share sample input XSL and XML files along with a sample code snippet. Also, it would be helpful if you can please share expected output PDF. We will test the scenario in our environment and address it accordingly.

Hello,

There is no xml or xsl , just a the attached piece of xsl:fo used to generate a pdf in c#.
Attached is actual and expected output pdf.

correct.pdf (75.7 KB)
wrong.pdf

static void Main(string[] args)
    {
        FileStream fo = File.Open("c:\\temp\\aspose.fo", FileMode.Open);
        GeneratePdfFile(fo);
    }

    public static void GeneratePdfFile(Stream input)
    {
        SetPdfLicense();
        input.Position = 0;
        using (var doc = new Aspose.Pdf.Document(input, new XslFoLoadOptions()))
        {
            doc.EmbedStandardFonts = true;
            doc.Info.Title ="title";
            doc.Info.Author = "Document generated by xxx;
            doc.Info.Subject = "title"; (499.3 KB);
            var pdf = new MemoryStream();
            doc.Save(pdf, SaveFormat.Pdf);
            pdf.Position = 0;
            doc.Save("c:\\temp\\aspose.pdf", SaveFormat.Pdf);
        }
    }

    public static void SetPdfLicense()
    {
        const string asposePdfLic = "Aspose.Pdf.lic";
        try
        {
            var license = new License();
            license.SetLicense(asposePdfLic);
        }
        catch (Exception exception)
        {
            throw new Exception($"Could not load Apsose PDF license from {asposePdfLic}", exception);
        }
    }

@Martin_Osterberg

Thanks for sharing more details.

We have tested the scenario in our environment and managed to observe the issue. We have also tried to use wrap-option = "wrap" property for <fo:block> but it did not help. For the sake of detailed investigation, we have logged this issue as PDFNET-45408 in our issue tracking system. We will further look into details of the issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.