Aspose.Words saveas PDF/Print margin problems

Hi Aspose,

I am using version 14.12. (latest version)
I have created a document by docx - html - docx using.

When i open the document in word and print it from Word everything is perfect.
When i open the document in word and saveas PDF, everything is perfect.

When the document is loaded with Aspose.Words and then saved as PDF with Aspose.Words, the PDF is saved with extra left/right margins.

When the docx document is printed with Aspose.Words, then Aspose.Words makes the same extra margins on the left and right.

I have attached the following files,

  1. The converted docx file (convertedfiletest.docx)
  2. The converted docx file savedas PDF in word (convertedfiletest.pdf)

I have also added our code which saves the document as pdf and the code that print out the document with aspose.words.

The pdf code,

public byte[] GetDocumentAsPdf(byte[] data)
{
    SetAsposeWordsLicense();
    Aspose.Words.Document wordsDocument = CreateDocument(data);
    return ConvertDocumentToBytes(wordsDocument, true, Aspose.Words.SaveFormat.Pdf);
}

public Aspose.Words.Document CreateDocument(byte[] documentFile, Aspose.Words.LoadOptions loadOptions = null)
{
    Aspose.Words.Document wordsDocument;

    using (var mStream = new MemoryStream(documentFile))
    {
        wordsDocument = (loadOptions != null) ? new Aspose.Words.Document(mStream, loadOptions) : new Aspose.Words.Document(mStream);
    }

    return wordsDocument;
}

private byte[] ConvertDocumentToBytes(Aspose.Words.Document mergedDocument, bool convertToPdf, Aspose.Words.SaveFormat saveFormat)
{
    using (var ms = new MemoryStream())
    {
        mergedDocument.Save(ms, convertToPdf ? Aspose.Words.SaveFormat.Pdf : saveFormat);
        byte[] documentBytes = ms.ToArray();
        return documentBytes;
    }
}

And the printing code,

public void PrintDocument(string FileName)
{
    var doc = new Document(FileName);
    var printDocument = new AsposeWordsPrintDocument(doc);
    SetPrinterSettingsOnDocument(printDocument.PrinterSettings, settings);
    if (printDocument.PrinterSettings.IsValid)
    {
        try
        {
            printDocument.Print();
        }
        catch (Exception ex)
        {
            Logger.Exception(ex); // not include in example
            throw;
        }
    }
}

public void SetPrinterSettingsOnDocument(PrinterSettings documentPrinterSettings, PrinterSettings printerSettings)
{
    documentPrinterSettings.Copies = printerSettings.Copies;
    documentPrinterSettings.PrinterName = printerSettings.PrinterName;
    documentPrinterSettings.DefaultPageSettings.Landscape = printerSettings.DefaultPageSettings.Landscape;
}

Best Regards,

Jakob Petersen
Team Lead
Edora A/S

Hi Jakob,

Thanks for your inquiry. I tested the scenario and have managed to reproduce the same problem on my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-11388. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

Hi Aspose,

I hope You prioritize this, because our customers is dependent on this problem being fixed quickly.

Best Regards,

Jakob Petersen
Team Lead
Edora A/S

Hi Jakob,

Thanks for your inquiry. Unfortunately, this issue is not resolved yet. Currently, this issue is pending for analysis and is in the queue. Normally when an issue is reported by a customer it is added to the pool of current issues being worked on by our developers. It is then analysed in a timely manner. However due to the nature of some bugs and the number of features we are working on, this doesn’t always mean we can fix every bug within a short time after it is reported.

If this issue is important to you, and for the fast resolution of your issues, please have a look at enhanced support options - e.g. purchasing Priority Support will allow you to post your issues in our Priority Support forum and raise the priority of these issues directly with our development teams, if possible, we will then aim to get a resolution to your issues as soon as we can. Many Priority Support customers find that this leads to their issue being fixed in the next release of the software.

If you would like to take advantage of Enhanced Support then please request a quote in our purchase forum -https://forum.aspose.com/c/purchase/6 Sorry for the inconvenience.

Best regards,

Hi Support,

Anything new on this problem. Do You know when this bug is being fixed?

Best Regards,

Jakob Petersen
Team Lead
Edora A/S

Hi Jakob,

Thanks for your inquiry. Unfortunately, your issue is not resolved yet. We have asked the ETA of this issue from our development team and will update you as soon as any estimates are available. We apologize for your inconvenience.

Best regards,

Hi Support
Any news on this problem or the ETA?
Is there any way for me to follow the progress / ETA on the WORDSNET-11388 solution besides this thread?
Best regards,
Rasmus

Hi Rasmus,

Thanks for your inquiry. Unfortunately, your issue is not resolved yet and there is no news about estimates either. We will inform you via this thread as soon as this issue is resolved. We apologize for any inconvenience.

Secondly, unfortunately, there is no way you can track issues by yourself. But, you are welcome to ask the issue status via forum threads. We will verify the status from our internal issue tracking system and reply you back.

Best regards,

The issues you have found earlier (filed as WORDSNET-11388) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.