RTF to PDF image cut off

I’m converting a RTF that displays a full image properly when shown in MS Word, but when it’s converted using aspose (python version), the image is cut off:

Before in Word:

After in PDF:

Any ideas how to fix?

@dticson

It sounds like you’re experiencing an issue with images being cut off during the conversion of RTF to PDF using Aspose.Words for Python. This can occur due to various reasons, such as the image’s dimensions or the way it’s embedded in the RTF file.

Cause: The images may be too large for the page margins, or the settings used during conversion may not be optimal for preserving the image quality.

Solution: Here are a few steps you can take to troubleshoot and potentially resolve the issue:

  1. Check Image Size: Ensure that the image size in the RTF file is appropriate and does not exceed the page margins. Images that are too large can get clipped during conversion.

  2. Adjust Page Margins: Try adjusting the page margins in the PDF output to provide more space for the image. This can be done by modifying the PageSetup properties in your Aspose.Words document.

  3. Use Different Export Options: When saving the document to PDF, specify different options that might help preserve the image better. For example, you can use PdfSaveOptions to set the EmbedFullFonts property to true.

Here’s a minimal code example to illustrate how you might adjust the save options:

from aspose.words import Document, SaveFormat, PdfSaveOptions

# Load the RTF document
doc = Document("input.rtf")

# Create PDF save options
pdf_options = PdfSaveOptions()
pdf_options.embed_full_fonts = True  # Adjust as needed

# Save the document as PDF
doc.save("output.pdf", pdf_options)
  1. Update Aspose.Words: Ensure you are using the latest version of Aspose.Words for Python, as updates often include bug fixes and improvements that could resolve your issue.

Next Steps: If these steps do not resolve the problem, please provide more details about the RTF file or any specific settings you are using. This information will help me assist you further.

I look forward to your response!

I’ve tried the AI suggestions, and no luck

actually - further testing shows it’s a margins issue - i think i can resolve by fixing margins.

@dticson Could you please zip and attach your problematic input document here for testing? We will check the issue and provide you more information. Unfortunately, it is impossible to analyze the problem using screenshots.