We have an issue with GroupDocs.Conversion on Ubuntu (we use Ubuntu 22.04.5 LTS).
We use GroupDocs.Conversion for .NET 25.2.1.
The input file is a .potx file. The desired output format is PNG. I can provide the file upon request (no way to upload here…)
On Windows, the resulting PNG file looks fine, aspect ratio is OK.
On Linux, the resulting PNG file is ultra-wide, and the image is heavily distorted.
This is the code used to convert:
var imageConvertOptions = new ImageConvertOptions()
{
Format = ImageFileType.Png,
Height = 1600,
HorizontalResolution = 300,
VerticalResolution = 300,
PageNumber = 1,
PagesCount = 1
};
using var outputStream = new MemoryStream();
using var converter = new Converter(
() => inputStream,
(loadContext) =>
new PresentationLoadOptions()
{
DefaultFont = “Arial”
},
settings: null
);
converter.Convert(convertOptions, (ConvertedContext convertedContext) => convertedContext.ConvertedStream.CopyTo(outputStream));
1 Like
@reinhardholzner
It seems you are experiencing an issue with the conversion of a .potx file to PNG format using GroupDocs.Conversion on Ubuntu, where the resulting image appears distorted and ultra-wide compared to the output on Windows.
This problem has been noted in similar scenarios where PDF to PNG conversions on Linux environments yield different results than on Windows. The distortion may be related to how the library handles the intermediate TIFF generation on Linux, which can have different quality settings, such as lower bits per pixel. This discrepancy can significantly affect the quality and aspect ratio of the final image.
Here are a few suggestions to troubleshoot and potentially resolve the issue:
-
Check for Updates: Ensure you are using the latest version of GroupDocs.Conversion. Sometimes, issues are resolved in newer releases.
-
Adjust ImageConvertOptions: You might want to experiment with the Height
, HorizontalResolution
, and VerticalResolution
settings in your ImageConvertOptions
. For instance, try adjusting the height or resolution to see if it affects the output.
-
Test with Different Fonts: Since you are specifying “Arial” as the default font, consider testing with other fonts or removing the font specification to see if it impacts the conversion.
-
Review Intermediate Formats: If possible, check the intermediate TIFF files generated during the conversion process. This can help identify if the issue arises at that stage.
-
Consult Documentation and Community: Review the GroupDocs documentation for any notes on Linux-specific issues or settings. Additionally, consider reaching out to the community or support for insights on similar experiences.
If the problem persists, providing a sample file to the support team may help them diagnose the issue more effectively.
For further reference, you might find it useful to look at discussions regarding similar conversion issues on Linux environments, as they may provide additional insights or workarounds.
Sources:
[1]: PDF to PNG conversion issue in .NET
@reinhardholzner
Could you please provide the problematic and output files? You can compress it into a ZIP format and upload it here, or alternatively, upload it to a cloud storage service (like Google Drive) and share the link. We’ll then further investigate this scenario.
Ah - yes here is the file. Thanks!
OOCHIALI_presentation_template.zip (425.0 KB)
@reinhardholzner
Can you share the distorted PNG output for comparison? Also, please check if the required fonts are installed on Ubuntu and confirm if libgdiplus
is installed (sudo apt install libgdiplus
).
@atir.tahir Thank you very much. Attached you find the output image.
OOCHIALI-presentation-template.jpg (542.6 KB)
No we didnt have libgdiplus installed, but did so now - shouldnt there be a warning if something is missing? How does GroupDocs.Conversion handle this better with libgdiplus installed? Whats the difference in behavior?
@reinhardholzner
Thanks for the details. We are further investigating this issue. You’ll be notified in case of any update.
GroupDocs.Conversion does not rely on libgdiplus, but libgdiplus can be an environment dependency, especially on Linux/macOS, for rendering certain image formats. Installing it may help in specific cases, but GroupDocs.Conversion itself works independently.
@reinhardholzner
This issue is fixed and will be introduced in API version 25.3. As the release gets on-board, we’ll notify you.