Image is displayed very small in PDF when converted from RTF with linked image

We are converting RTF files to PDF; using INCLUDEPICTURE to link to external images succeeds in that the image is embedded in the PDF however the image is always very tiny, so tiny that you have to zoom in to see it - if your monitor is dirty you may think it is a spec of dirt! However if you open the RTF in Word or WordPad then it shows the image fine.

We are using v9.1 of the components, and have yet to try 9.4. I have stripped the RTF down to verify that there is nothing going on with other codes in the document:

{\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard This is some text.\par {\field\fldedit{*\fldinst {INCLUDEPICTURE “C:\\Users\\Mark\\Pictures\\My Desktop Photos\\clyde sunset6.jpg” \* MERGEFORMAT \d}}{\fldrslt }} \par This is some more text \par }

I’ve attached the Test.RTF and resultant PDF file. Do you have any idea if is this is a known issue (having scanned the forums I haven’t seen a previous case). Can you confirm if you can reproduce the issue?

Regards, MC

Mark Critchley

Hello

Thank you for reporting this problem to us. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.
Best regards,

Hi Folks

I now need to deal with this urgently. Can you tell me of this is likely to be resolved in the next month or so, otherwise I have to find an alternative tool for this task.

Regards, MC.

Hello
Thanks for your request. Unfortunately the issue is still unresolved. And currently I cannot provide you any reliable estimate regarding this problem.
While you are waiting for the fix you can try using the following code to work this problem around:

Document doc = new Document("test.rtf");
// Get collection of shapes from the document
Node[] shapes = doc.GetChildNodes(NodeType.Shape, true).ToArray();
// Loop though all shapes
foreach(Shape shape in shapes)
{
    // Check if shape is include picture field
    if (shape.ImageData.IsLinkOnly)
    {
        string src = shape.ImageData.SourceFullName;
        Image img = Image.FromFile(src);
        // Get width and height of the image in points.
        double width = ConvertUtil.PixelToPoint(img.Width, img.HorizontalResolution);
        double height = ConvertUtil.PixelToPoint(img.Height, img.VerticalResolution);
        // Set width and height of the shape
        shape.Width = width;
        shape.Height = height;
    }
}
doc.Save("out.pdf");

Best regards,

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

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