DPI issue in generated PDF

Hi,

I like to convert my word to pdf. While saving as PDF is it a way to save in particular dpi. eg save in 600 dpi. However after converting to pdf the quality is not good. We are using following code.

// Start MS word application 
wordDoc = OpenWordDoc(ref spoolFilePath);
// save Document as PDF
if (wordDoc != null)
{
    wordDoc.Activate();
    object fileFormat = WdSaveFormat.wdFormatPDF;
    object oPdfFilePath = Convert.ChangeType(pdfFilePath, typeof(object));
    // C# doesn't have optional arguments so we'll need a dummy value object 
    oMissing = System.Reflection.Missing.Value;
    wordDoc.SaveAs(ref oPdfFilePath, ref fileFormat, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
}

Many Thanks,

This message was posted using Email2Forum by Mudassir Fayyaz.

Hi Mathan,

Thanks for your inquiry.
Aspose.Words for .NET is a class library that enables your applications
to perform a great range of document processing tasks. Aspose.Words
supports DOC, DOCX, RTF, HTML, OpenDocument, PDF, XPS, EPUB and other
formats. With Aspose.Words you can generate, modify, convert, render and
print documents without utilizing Microsoft Word®. Please check more
detail from here:
https://docs.aspose.com/words/net/

Please download latest version of Aspose.Words for .NET 14.10.0 from here:
https://downloads.aspose.com/words/net

Please use the following code example to achieve your requirements and let us know if you have any more queries. Hope this helps you.

Document doc = new Document(MyDir + "in.docx");
PdfSaveOptions saveoptions = new PdfSaveOptions();
saveoptions.DownsampleOptions.Resolution = 600;
doc.Save(MyDir + "Out.pdf", saveoptions);

Hi Tahir manzoor,

Thanks For the reply. Please clarify my below doubts.

  1. Till what DPI its supported? If i don’t specify what is the default resolution?

  2. If the resolution of the image in the doc(word doc) is more than the one we are setting, what resolution it would be in the PDF?

  3. Is it supported only for Doc or the support is for PPT as well?

Hi Mathan,

Thanks for your inquiry.

mthnkmr21:

1. Till what DPI its supported? If i don’t specify what is the default resolution?
2. If the resolution of the image in the
doc(word doc) is more than the one we are setting, what resolution it
would be in the PDF?

DownsampleOptions.Resolution property specifies the resolution in pixels per inch which the images should be downsampled to. The default value is 220 ppi.

DownsampleOptions.DownsampleImages property specifies whether images should be downsampled. The default value is true.

DownsampleOptions.ResolutionThreshold property specifies the threshold resolution in pixels per inch. If resolution of an image in the document is less than threshold value, the downsampling algorithm will not be applied. A value of 0 means the threshold check is not used and all images that can be reduced in size are downsampled. The default value is 0.

mthnkmr21:

3. Is it supported only for Doc or the support is for PPT as well?

I have posted your query in Aspose.Slides forum here. My colleagues from Aspose.Slides team will reply you shortly about your query related to PPT/PPTX.