How to convert TIFF to PDF with no margins around image in .NET

I’m trying to use GroupDocs.Conversion for .NET to convert TIFF images (from document scans) to PDF and there’s no way to control the size of the image in the PDF file. It always comes out squashed with big margins around it:

image.png (28.8 KB)

(The blue shading is because the image is selected in Adobe Reader to highlight the problem.)

In my code I’m setting the margins on the document to 1px in PdfConvertOptions but it makes no difference.

Here’s my code:

using var converter = new Converter(Load, () => new ImageLoadOptions
{
    Format = ImageFileType.Tiff,
});

converter.Convert(Save, new PdfConvertOptions
{
    MarginTop = 1,
    MarginBottom = 1,
    MarginLeft = 1,
    MarginRight = 1,
});

@mrendlemindgrub

We’re investigating this scenario. Your investigation ticket ID is CONVERSIONNET-4123. As there’s any update, you’ll be notified.

1 Like