My Document was changed when I convert from .docx to .pdf

Hi, everyone.

I want some help because when I try to convert my document from .docx to .pdf, I can do it successfully, but the document is not the same as the original, I add a picture where you can see that a paragraph of the document has been cut and you can even see a big white space between both paragraphs.

image.png (113.1 KB)

Do you know how can I fix it?

@cesar.garcia

Please share following details and we’ll investigate this scenario:

  • API variant that you are using (.NET or Java)
  • API version (e.g. 20.10, 21.1)
  • Sample code
  • Problematic DOCX file

Hi, Thank you so much for your response.

I share with you all the details you asked.

  • API variant (.NET)
  • API version (19.1.0.0)
  • Sample Code:

private string WordToPdfFile (string source) {
string target = Service.PathTmp + “\” + System.IO.Path.GetRandomFileName () + “.pdf”;
int state = -0x01;
try {
GroupDocs.Conversion.Config.ConversionConfig config = new GroupDocs.Conversion.Config.ConversionConfig {
StoragePath = “.”,
OutputPath = “.”,
TempDataHandler = new MyTempDataHandler ()
};

GroupDocs.Conversion.Handler.ConversionHandler Handler = new GroupDocs.Conversion.Handler.ConversionHandler (config);
var result = Handler.Convert (source, new GroupDocs.Conversion.Options.Save.PdfSaveOptions ());
result.Save (target);
state = 0x00;
result.Dispose ();
result = null;
Handler = null;
} catch (Exception ee) {
try { System.IO.File.AppendAllText (AppDomain.CurrentDomain.BaseDirectory + “[\BitacoraConver.log](file://bitacoraconver.log/)”, "HtmlToPdfFile: " + ee.ToString ()); } catch {}
target = “”;
ee.ToString ();
}
return target;
}

  • Here in the forum there is a message that says I can’t share .docx files, so I let you the link of the file in google drive:
    https://drive.google.com/file/d/1cyfWoNoOlC9r4DkVoy-4VT5pUmNIh04N/view?usp=sharing

Regards!

@cesar.garcia

Please have a look at the source and output files.zip (1.5 MB). Let us know if this output is what you are expecting.

Yes, that’s the output we’re expecting but as I showed you in the image when we convert the document with our current version the document is not the same after the convertion…

What do we need to do?

@cesar.garcia

You’ve to integrate latest version of the API in your project.