Save as PDF - Change image

hello,
when I save the document as PDF the image changes, you can check it out.

thanks in advance
input.docx (238.8 KB)

@benestom

It seems that you are experiencing an issue where the image in your document changes when you save it as a PDF. This can happen due to various reasons, such as the way images are rendered or the settings used during the PDF conversion process.

To address this issue, you can try the following steps:

  1. Check Image Format: Ensure that the images in your document are in a supported format. Some formats may not render correctly when converted to PDF.

  2. Use PdfSaveOptions: When saving your document, you can customize the PdfSaveOptions to control how images are handled. For example, you can set options for image compression or specify how metafiles are rendered. Here’s a sample code snippet to illustrate how to set these options:

    Document doc = new Document("input.docx");
    PdfSaveOptions saveOptions = new PdfSaveOptions();
    
    // Example: Set image compression
    saveOptions.setImageCompression(PdfImageCompression.Jpeg);
    saveOptions.setJpegQuality(100); // Set quality to maximum
    
    // Save the document as PDF
    doc.save("output.pdf", saveOptions);
    
  3. Check for Warnings: During the conversion process, Aspose.Words may generate warnings if it encounters issues rendering certain elements. You can implement a warning callback to capture these warnings and understand what might be going wrong.

  4. Test with Different Settings: Experiment with different settings in PdfSaveOptions, such as enabling or disabling font embedding, adjusting image quality, or changing the rendering mode for metafiles.

If the problem persists, consider sharing more details about the specific changes you observe in the image after conversion, as well as any relevant code snippets or settings you are using. This information can help in diagnosing the issue more effectively.

If you need further assistance, feel free to ask!

@benestom
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-28051

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.