Text overlapping while generating thumbnails from PPTX

Hello.

When converting a PPT file into slide images, we have a text overlapping issue.
I tried to find a similar issue but there was no exact match.
Server setting environment, specific problem, and questions are as follows.

  1. Server setting environment

    1. Server: UNIX
    2. aspose slides version : 19.2.jdk16
  2. Specific problem

    1. Text Overlapping
    2. Special characters are not displayed intermittently
  3. Questions

    1. Do you have a guide to resolve text overlapping on UNIX servers?
    2. When converting PPT to slide image, is there a way to set the font on the UNIX server as default font?

If you need an attachment, I will upload it.
I’ll be looking forward to hearing from you.
Thank you.

@piaoseya,

Can you please share source files along with sample code so that we may further investigate to help you out.

I had the same problem. It’s related to the fact, that you’re trying to add or embed fonts that conflicts with built-in windows fonts. Without adding or embedding a font the presentation will not looks correct but the text will not be overlaped.

And by the way this is a question to the fonts adding/embedding mechanism of Aspose

@obrusentsov,

Actually, such type of issues occur when font used in presentation is unavailable on machine where rendering is performed. In such cases, Aspose.Slides use the default available font for rendering. One solution is to install the fonts used in presentation and other is to simply copy them in some directory and loading them externally in your application.

  1. This is our source, and we set up Arita Font using LoadOptions, but it doesn’t apply.

    public void executeConversionSlides(String fileId, InputStream inputStream, FileStore asposeFileStore) {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    try {
    writeInfoLog(fileId, “PPT”, “START”);

    // Use load options to define the default regualr and asian fonts
    LoadOptions lo = new LoadOptions(LoadFormat.Auto);
    lo.setDefaultRegularFont(“Arita”);
    lo.setDefaultAsianFont(“Arita”);

    Presentation pres = new Presentation(inputStream);

    Map<String, InputStream> convertedImages = new HashMap<String, InputStream>();
    ISlideCollection slides = pres.getSlides();
    int totalCount = slides.size();
    byte [] byteArrImage = null;
    for(int i = 0; i < totalCount; i++) {
    bos = new ByteArrayOutputStream();
    byteArrImage = null;

    ISlide slide = slides.get_Item(i);
    BufferedImage thumnail = slide.getThumbnail(2f,2f);
    ImageIO.write(thumnail, "jpg", bos );
    
    byteArrImage = bos.toByteArray();
    
    String filePath = fileId + "/" + String.format("%03d.%03d", i+1, totalCount);
    asposeFileStore.write(filePath, byteArrImage);
    convertedImages.put("aspose" + "/" + filePath, new ByteArrayInputStream(byteArrImage));
    

    }
    writeInfoLog(fileId, “PPT”, “SUCCESS”);
    if(this.getTransportable()){
    ftpTaskExecutor.execute(new FTPTask(ftpFileSendExecutor, “upload”, fileId, convertedImages));
    }
    } catch(Exception e) {
    writeInfoLog(fileId, “PPT”, “ERROR”);
    writeErrorLog(APConst.COMMON_ERR_MSG);
    } finally{
    try{
    bos.close();
    inputStream.close();
    }
    catch(IOException e){
    if(LOG.isErrorEnabled()){
    LOG.error(e.getMessage());
    }
    }
    }
    }

  2. We have used the following sources to confirm that Arita Font is currently installed on the UNIX server.

    FolderFontSource folderFontSource = new FolderFontSource("~server font location~", true);
    FontSourceBase[] sources = FontSettings.getDefaultInstance().getFontsSources();
    for(FontSourceBase base : sources){
    List fontList = base.getAvailableFonts();
    Iterator iter = fontList.iterator();
    while(iter.hasNext()){
    PhysicalFontInfo font = iter.next();
    LOG.info(“fontFamilyName : {}”, font.getFontFamilyName());
    LOG.info(“fullFontName : {}”, font.getFullFontName());
    LOG.info(“Aspose.Word Font : {}”, font.getFilePath());
    }
    }

I’ll be looking forward to hearing from you.
Thank you.