Sign In  Sign Up Live-Chat

Portion font format

Last post 06-04-2008, 2:08 PM by ivica.v. 7 replies.
Sort Posts: Previous Next
  •  03-27-2008, 1:33 PM 119513

    Portion font format

    Attachment: Present (inaccessible)
    Hi, can you please look at this code snippet:
    String path = "test/fonts.ppt";
       
        InputStream inputStream = getClass().getClassLoader().getResourceAsStream(path);
       
        Presentation presentation;
       
        try {
            presentation = new Presentation(inputStream);
        } catch (PptException e) {
            throw new RuntimeException(e);
        }
       
        Slides slides = presentation.getSlides();
       
        Slide slide = slides.get(0);
       
        Placeholders placeholders = slide.getPlaceholders();
       
        TextHolder textHolder = null;
       
        for(int i = 0; i < placeholders.size(); i++) {
            Placeholder placeholder = placeholders.get(i);
           
            if(placeholder instanceof TextHolder) {
            textHolder = (TextHolder) placeholder;
           
            break;
            }
        }
       
        Paragraphs paragraphs = textHolder.getParagraphs();
       
        Paragraph paragraph = paragraphs.get(0);
       
        Portions portions = paragraph.getPortions();
       
        Portion portion;
       
        for(int i = 0; i < portions.size(); i++) {
            portion = portions.get(i);
        }
       
        portions.clear();
       
        portion = new Portion();
       
        try {
            portion.setText("New Text For Portion");
        } catch (PptEditException e) {
            e.printStackTrace();
        }
       
        portion.setFontItalic(true);
       
        try {
            portions.add(portion);
        } catch (PptEditException e) {
            e.printStackTrace();
        }
       
        try {
            presentation.write(new FileOutputStream(new File("d:/font.ppt")));
        } catch (PptWriteException e) {
            e.printStackTrace();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

    Problem is that in the output document there is no portion with italic text, there is test document in the attachment.

    Thanks, Ivica.
     
  •  03-28-2008, 2:06 AM 119560 in reply to 119513

    Re: Portion font format

    Dear Ivica,

    This is because of master styles, since the title placeholder is already Italic, you don't need to set it again, so delete this statement from your code.

    portion.setFontItalic(true);

    Since the master style is already Italic, when you set it italic again, it turns into non-italic, however, I will confirm it from technical team and let you know.


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  03-31-2008, 6:26 AM 119839 in reply to 119560

    Re: Portion font format

    Ok, but I need to set font styles independently of master styles, is there any whay to do this?

    Thanks, Ivica.
     
  •  03-31-2008, 7:28 PM 119971 in reply to 119839

    Re: Portion font format

    Dear ivica,

     

    Actually, it is a bug and I have reported it for a fix. You should be able to override the master styles.


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  04-18-2008, 8:20 AM 122997 in reply to 119971

    Re: Portion font format

    Hi, can you tell me what is status on this problem. Can you send me bug fix or something?

    Thanks, Ivica
     
  •  05-08-2008, 12:12 PM 126069 in reply to 122997

    Re: Portion font format

    Hi, I have just downladed 1.8.4.0 hot fix, and it seems that neither there this problem is not solved, can you just tell me when can I espect some fix for this.

    Thanks a lot.

    Ivica.
     
  •  05-08-2008, 2:07 PM 126085 in reply to 126069

    Re: Portion font format

    No, it is not yet fixed. Are you getting this problem with other presentations too? If yes, then please provide them too.
    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  06-04-2008, 2:08 PM 130084 in reply to 126085

    Re: Portion font format

    Attachment: Present (inaccessible)
    Hi, I did not manage to reply earlier, here is two more file with this problem.

    Thanks, Ivica.
     
View as RSS news feed in XML