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

Free Support Forum - aspose.com

No space between form field and text

Hi,
I'm using Aspose.Pdf version 3.6.2.0 and Aspose.Words version 5.0.2.
I've converted the attached dot file to pdf, but the document was not converted correctly.
For example there is COGNOME BRANDANINOME AGNESESESSO (no space between brandani and nome and no space between agnese and sesso).
Could you please look at it?
Thanks for help.
Greatings

Hi,

Can you also provide us with the code that you use to fill the fields in the template file.

Thanks.

Hi,

Document _doc = null;

private string _dateFormat = "dd/MM/yyyy";

public WordAspose(string sdoc)

{

try

{

// Settare la licenza ogni volta che si crea una nuova istanza di Aspose.Words.Document in caso contrario si usa la versione valutativa

Aspose.Words.License licenseWord = new Aspose.Words.License();

licenseWord.SetLicense(GetLicenseStream());

}

catch

{ }

_doc = new Document(sdoc);

}

public override bool scrivi_segnalibro(string nome, object val, TipoSegnalibro tipo, ref string errors)

{

bool retVal = true;

try

{

if (tipo == TipoSegnalibro.FORMFIELD)

{

Aspose.Words.Fields.FormField formField = _doc.Range.FormFields[nome];

if (formField != null)

{

if (formField.Type == Aspose.Words.Fields.FieldType.FieldFormTextInput)

{

if (formField.TextInputType == Aspose.Words.Fields.TextFormFieldType.DateText || formField.TextInputType == Aspose.Words.Fields.TextFormFieldType.NumberText)

{

if (!(val is String && (string)val == ""))

{

formField.SetTextInputValue(val);

}

}

else if (formField.TextInputType == Aspose.Words.Fields.TextFormFieldType.RegularText)

{

if (val is DateTime)

{

formField.SetTextInputValue(String.Format("{0:" + _dateFormat + "}", (DateTime)val));

}

else

{

formField.SetTextInputValue(val);

}

}

}

else if (formField.Type == Aspose.Words.Fields.FieldType.FieldFormCheckBox)

{

formField.Checked = Convert.ToBoolean(val);

}

else if (formField.Type == Aspose.Words.Fields.FieldType.FieldFormDropDown)

{

formField.DropDownItems.Clear();

formField.DropDownItems.Add(Convert.ToString(val));

}

}

}

else if (tipo == TipoSegnalibro.BOOKMARK)

{

Bookmark bookmark = _doc.Range.Bookmarks[nome];

if (bookmark != null)

{

if (val is DateTime)

{

bookmark.Text = String.Format("{0:" + _dateFormat + "}", (DateTime)val);

}

else

{

bookmark.Text = Convert.ToString(val);

}

}

}

}

catch (Exception exc)

{

retVal = false;

errors = String.Format(exc.Message + " " + exc.StackTrace + " Il campo che va in errore è {0}", nome);

}

return retVal;

}

Greatings

Hi,

I have tested this issue and found that the xml produced by Aspose.Words doesn't have the spaces, hence the Pdf produced will also not have spaces. I am moving this thread to the Aspose.Words forum so that the Aspose.Words team can take a look at it.

Thanks.

Hello!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for addressing us. I have investigated the issue. It should be fixed in Aspose.Pdf. I can explain what happens.

The characters that are present in the document but eaten in the PDF are long spaces. I created a document from scratch and inserted some test lines here. See the attachment. When I convert it to PDF everything goes fine. But in the XML of the original document there are the same characters, namely long spaces. Plain text editors like Notepad don’t show this character correctly. You can open the intermediate XML files in any binary editor. For instance I use MS Visual Studio binary editor. Here you could see that in both XML files long spaces are represented by code sequence “E2 80 <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />83”. Just search for this sequence.

What I conclude is that Aspose.Words gives equal output on the segment level but Aspose.Pdf renders long space in some conditions and doesn’t render in other. Please initiate some more investigation in Aspose.Pdf.

As a workaround you can replace these long spaces with one or more non-breaking space each.

Thank you,

Hi,

can you explain to your collegues of Aspose.Pdf this issue so you and they can solve the problem?

Greatings

Hello!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I wrote them about this issue and referred the thread. There's enough technical information to reproduce the problem. Aspose.Pdf staff will answer you shortly.

Best regards,

Hi,

I have logged this as PDFNET-4504 in our issue tracking system. We will try our best to resolve this as soon as possible.

Thanks.

Hi,

any news?
Greatings

Hi,

We are working on this issue now and we will try our best to fix it late this month. Sorry for inconvenience.

Best regards.

Hi, any news?

Greatings

Hi,



Sorry for the delay. We have met some technichal problem on it and I am
afraid we need more time to fix it. Now the priority of this issue is
top. We will give you a reply here once we have made any progress.
Thanks for your patience.



Best regards.

Hi,

when do you think it will be a new version with the correction?

Greatings

Hi,

We will try our best to send you an update in about one week. Thanks very much for your patience.

Best regards.

Hi,

I am sorry it is not resolved yet. We have met some technical problem on it. We hope to give you a solution late this month. Thank you very much for your patience.

Best regards.

Hi,

in the new release of Aspose.Words for .NET 5.2.1 and Aspose.Pdf for .Net 3.7.0.0 is there the solution to these problems?
Greatings

Hello!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your patience. I have reminded Aspose.Pdf Team about your requests. They’ll answer here shortly.

Regards,

Hi,

The bug has been fixed. Please try the attached dll before our new hotfix. To get right result, please make sure the font “WINGDNG 2” is installed on your machine. I have also attached the font file. If the font is not installed, little rectangle signs will be rendered as the english currency pound sign (£). Thank you very much for your patience.

Best regards.

Hi,
in the new release of Aspose.Words for .NET 5.2.2 and Aspose.Pdf for .Net 3.8.0.0 is there the solution to these problems?
Greatings

Hi,

In my test, it works well when using Aspose.Words 5.2.2.0 and Aspose.Pdf 3.8.0.0. Please try it and feel free to let us know if you have any other problem. Thanks.
P.S. please note my previous post.

Hans.firefox:
Hi,

The bug has been fixed. Please try the attached dll before our new hotfix. To get right result, please make sure the font “WINGDNG 2” is installed on your machine. I have also attached the font file. If the font is not installed, little rectangle signs will be rendered as the english currency pound sign (£). Thank you very much for your patience.

Best regards.