Aspose.PDF (.Net版本)PDF转.doc格式时候内容会紧紧贴在文档左侧而没有左边距

Aspose.PDF (.Net版本)PDF转.doc格式时候没有左边距,内容会紧紧贴在文档左侧,而Docx格式正常示例文档(转换前后).zip (776.8 KB)

@uniqbarry

感谢您与支持人员联系。

您能否分享您用于这些转化的代码段。 另请确保使用Aspose.PDF for .NET 19.8

您好,同一个文件,PDF转.docx格式正常,转.doc就会左边没有间距。
try
{
Document pdfDocument = new Document(path);
DocSaveOptions saveOptions = new DocSaveOptions();
saveOptions.Mode = DocSaveOptions.RecognitionMode.Flow;
string fileSaveName = savePath + “\” + Path.GetFileNameWithoutExtension(path);
if (convertType == “保持编辑”)
{
saveOptions.Mode = DocSaveOptions.RecognitionMode.Textbox;
}
if (saveType == “DOCX”)
{
saveOptions.Format = DocSaveOptions.DocFormat.DocX;
fileSaveName += “_out.docx”;
}
else
{
fileSaveName += “_out.doc”;
}
saveOptions.RelativeHorizontalProximity = 2.5f;
saveOptions.RecognizeBullets = true;
lock (objLock)
{
pdfDocument.Save(fileSaveName, saveOptions);
}
}
catch (Exception ex)
{ }

@uniqbarry

我们使用以下代码生成DOC文件,空间没有任何差异。 您能否与生成的文件共享比较截图。
DOCdocx.jpg

try
{
    if (Aspose.Pdf.Document.IsLicensed)
    {
        Console.WriteLine("License set successfully.");
        Document pdfDocument = new Document(dataDir + "+¡-++-+¦.pdf");
        DocSaveOptions saveOptions = new DocSaveOptions();
        saveOptions.Mode = DocSaveOptions.RecognitionMode.Flow;
        saveOptions.Mode = DocSaveOptions.RecognitionMode.Textbox;
        //saveOptions.Format = DocSaveOptions.DocFormat.DocX;
        saveOptions.RelativeHorizontalProximity = 2.5f;
        saveOptions.RecognizeBullets = true;
        pdfDocument.Save(dataDir + "Aspose.PDF_19.8.doc", saveOptions);
    }
    else {
        Console.WriteLine("License not set!");
    }
}
catch (Exception ex)
{
}

当保存为doc格式的时候,使用saveOptions.Mode = DocSaveOptions.RecognitionMode.Flow才会出现格式问题。而使用saveOptions.Mode = DocSaveOptions.RecognitionMode.Textbox格式是正常的。
格式异常截图.png (119.3 KB)
格式正常截图.png (118.3 KB)

@uniqbarry

我们仍然无法使用最新版本重现它。 请在此处分享您生成的文件。Flow_Textbox.zip

你回复的Flow_Textbox.zip压缩包中的Flow_Aspose.PDF_19.8.doc文件,你打开文档后,没发现文档是有问题的吗?明显和Textbox_Aspose.PDF_19.8.doc不一样啊,有问题的文档是不局中的,是紧挨着左侧的,没有左边距的。你不明白我意思的话,就看下我给你回复的格式异常截图.png标红的部分。

@uniqbarry

我们了解此问题,并能够在屏幕截图中注意到该问题。 但我们无法在我们这边重现这个问题(Flow_Textbox.zip)。 因此,请分享使用最新版API创建的输出文件。