GroupDocs.Conversion for Java 19.4 Release Notes

Major Features 

This regular monthly release contains 5+ new features, improvements and bug fixes. Most notable are: 

  • Improved options to make them more meaningful
  • Conversions from EPS
  • Conversions from/to TSV
  • Conversion from Pcl
  • Rotate feature when converting to image
  • ConvertedDocument extended with additional property which contain conversion elapsed time
  • Fixed bug where ImageOptions width and height are not working
  • Fixed bug where text is too light when rendering a google slide exported pptx file to pdf
  • Fixed bug where was no access to GroupDocs.Conversion exception classes

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
CONVERSIONNET‑2814Move HideWordTrackedChanges option to WordsLoadOptions classImprovement
CONVERSIONNET‑2815Move HidePdfAnnotations option to PdfLoadOptions classImprovement
CONVERSIONNET‑2816Move HideComments option to CellsLoadOptions, SlidesLoadOptions and WordsLoadOptions classImprovement
CONVERSIONNET‑1509Implement conversion from EPSFeature
CONVERSIONNET‑2781Implement conversion from TSV and to TSVFeature
CONVERSIONNET‑2786Implement conversion from PclFeature
CONVERSIONNET‑2797Implement setting default font and font substitution options when converting One documentFeature
CONVERSIONNET‑2799Implement setting default font when converting Psd, Emf, Wmf documentsFeature
CONVERSIONNET‑2801Measure conversion time and return it as property of ConvertedDocument classFeature
CONVERSIONNET‑2802Set font load folders when converting Image documentsFeature
CONVERSIONNET‑2810Implement rotation feature when converting to imageFeature
CONVERSIONNET‑2818Implement option for flatten all form fields when converting PdfFeature
CONVERSIONNET‑2825Implement page rotation when converting to PdfFeature
CONVERSIONNET‑2826Implement option for including hidden slides in converted document when converting from SlidesFeature
CONVERSIONNET‑2828Set default font when converting from DiagramFeature
CONVERSIONJAVA‑518Spreadsheets sometimes show incorrect graph dataFix
CONVERSIONJAVA‑542Stax2 inclusion from 18.12 creates a class resolver conflictFix
CONVERSIONJAVA‑545Some text is too light when rendering a google slide exported pptx file to pdfFix
CONVERSIONJAVA‑551Image to Image conversion issueFix
CONVERSIONJAVA‑556Visio to image conversion issueFix
CONVERSIONJAVA‑564ImageOptions width and height are not workingFix
CONVERSIONJAVA‑566eml to pdf conversion issue in sent filedFix
CONVERSIONJAVA‑567Not able to access “PasswordProtectedException” in Java APIFix
CONVERSIONJAVA‑574License issue with groupdocs.conversion java 19.3Fix
CONVERSIONNET‑2686Improve per page savings when converting to Words, Images, Slides, Cells, Pdf, Xps, HtmlFix

Public API and Backward Incompatible Changes

  1. ** Measure conversion time and return it as property of ConvertedDocument class**

    /// <summary>
    /// Class for handling converted document
    /// </summary>
    public final class ConvertedDocument implements IDisposable
    
    {
        ...
        /// <summary>
        /// Get the total elapsed time for the conversion in milliseconds
        /// </summary>
     public long getElapsed() {
        return auto_Elapsed;
      }
    
        ...
    }
    

    Usage

    ...
    ConversionConfig config = new ConversionConfig();
    ConversionHandler conversionHandler = new ConversionHandler(config);
    String source = "source.docx";
    PdfSaveOptions saveOptions = new PdfSaveOptions();
    ConvertedDocument convertedDocument = conversionHandler.convert(source, saveOptions);
    System.out.println("Elapsed time: " + convertedDocument.getElapsed() + "ms");
    ...
    
  2. Option for including hidden slides in converted document when converting from Slides

    /// <summary>
    /// Slide document load options
    /// </summary>
    public class SlidesLoadOptions extends LoadOptions
    {
        ...
         /**
     * <p>
     * Show hidden slides
     * </p>
     */
     public final boolean getShowHiddenSlides(){ return auto_ShowHiddenSlides; }
     /**
     * <p>
     * Show hidden slides
     * </p>
     */
     public final void setShowHiddenSlides(boolean value){ auto_ShowHiddenSlides = value; }
    
        ...
    }
    

    Usage

    ...
    ConversionConfig config = new ConversionConfig();
    ConversionHandler conversionHandler = new ConversionHandler(config);
    String source = "source.pptx";
    SlidesLoadOptions loadOptions = new SlidesLoadOptions();
    loadOptions.setShowHiddenSlides(true);
    PdfSaveOptions saveOptions = new PdfSaveOptions();
    ConvertedDocument convertedDocument = conversionHandler.convert(source, loadOptions, saveOptions);
    convertedDocument.save("result");
    ...
    
  3. Option for page rotation when converting to Pdf

    /// <summary>
    /// Options for to PDF conversion
    /// </summary>
    public class PdfSaveOptions extends SaveOptions
    {
        ...
         /**
     * <p>
     * Rotation enum
     * </p>
     */
     public static final class Rotation extends Enum {
          private Rotation() {
          }
    
          /**
     * <p>
     * None
     * </p>
     */
      public static final int None = 0;
          /**
     * <p>
     * 90 degrees
     * </p>
     */
      public static final int On90 = 1;
          /**
     * <p>
     * 180 degrees
     * </p>
     */
      public static final int On180 = 2;
          /**
     * <p>
     * 270 degrees
     * </p>
     */
      public static final int On270 = 3;
    
          static {
              GDEnum en = new GDEnum(Rotation.class, Integer.class);
              en.add("None", None);
              en.add("On90", On90);
              en.add("On180", On180);
              en.add("On270", On270);
              Enum.register(en);
          }
      }
    
        ...
         /**
     * <p>
     * Rotate page
     * </p>
     */
     public final int getRotate(){ return auto_Rotate; }
     /**
     * <p>
     * Rotate page
     * </p>
     */
     public final void setRotate(int value){ auto_Rotate = value; }
     private int auto_Rotate;
    
        ...
    }
    

    Usage

    ...
    ConversionConfig config = new ConversionConfig();
    ConversionHandler conversionHandler = new ConversionHandler(config);
    String source = "source.docx";
    PdfSaveOptions saveOptions = new PdfSaveOptions();
    saveOptions.setRotate(PdfSaveOptions.Rotation.On90);
    ConvertedDocument convertedDocument = conversionHandler.convert(source, saveOptions);
    convertedDocument.save("result");
    ...
    
  4. Option to flatten all form fields when converting Pdf

    /// <summary>
    /// Pdf document load options
    /// </summary>
    public class PdfLoadOptions extends LoadOptions
    {
        ...
     /**
     * <p>
     * Flatten all the fields of the PDF form
     * </p>
     */
     public final boolean getFlattenAllFields(){ return auto_FlattenAllFields; }
     /**
     * <p>
     * Flatten all the fields of the PDF form
     * </p>
     */
     public final void setFlattenAllFields(boolean value){ auto_FlattenAllFields = value; }
     private boolean auto_FlattenAllFields;
        ...
    }
    

    Usage

    ...
    ConversionConfig config = new ConversionConfig();
    ConversionHandler conversionHandler = new ConversionHandler(config);
    String source = "source.pdf";
    PdfLoadOptions loadOptions = new PdfLoadOptions();
    loadOptions.setFlattenAllFields(true);
    WordsSaveOptions saveOptions = new WordsSaveOptions();
    ConvertedDocument convertedDocument = conversionHandler.convert(source, loadOptions, saveOptions);
    convertedDocument.save("result");
    ...
    
  5. Rotation feature when converting to image

    /// <summary>
    /// Options for to Image conversion
    /// </summary>
    public class ImageSaveOptions extends SaveOptions
    {
        ...
         /**
     * <p>
     * Image rotation angle
     * </p>
     */
     public final int getRotateAngle(){ return auto_RotateAngle; }
     /**
     * <p>
     * Image rotation angle
     * </p>
     */
     public final void setRotateAngle(int value){ auto_RotateAngle = value; }
     private int auto_RotateAngle;
    
        ...
    }
    

    Usage

    ...
    ConversionConfig config = new ConversionConfig();
    ConversionHandler conversionHandler = new ConversionHandler(config);
    String source = "source.pdf";
    ImageSaveOptions saveOptions = new ImageSaveOptions();
    saveOptions.setRotateAngle(45);
    ConvertedDocument convertedDocument = conversionHandler.convert(source, saveOptions);
    convertedDocument.save("result");
    ...
    
  6. Set default font and font substitution options when converting One document

    /**
     * <p>
     * One document load options
     * </p>
     */
    
    public class OneLoadOptions extends LoadOptions
    {
        /**
     * <p>
     * Default font for Note document. The following font will be used if a font is missing.
     * </p>
     */
     public final void setDefaultFont(String value){ auto_DefaultFont = value; }
     private String auto_DefaultFont;
    
     /**
     * <p>
     * Substitute specific fonts when converting Note document.
     * </p>
     */
     public final IGenericList<KeyValuePair<String,String>> getFontSubstitutes(){ return auto_FontSubstitutes; }
     /**
     * <p>
     * Substitute specific fonts when converting Note document.
     * </p>
     */
     private void setFontSubstitutes(IGenericList<KeyValuePair<String,String>> value){ auto_FontSubstitutes = value; }
     private IGenericList<KeyValuePair<String,String>> auto_FontSubstitutes;
    
     /**
     * <p>
     * Set password to unprotect protected document
     * </p>
     */
     public final /*new*/String getPassword_OneLoadOptions_New(){ return auto_Password; }
     /**
     * <p>
     * Set password to unprotect protected document
     * </p>
     */
     public final /*new*/void setPassword_OneLoadOptions_New(String value){ auto_Password = value; }
     private String auto_Password;
    
    }
    

    Usage

    ...
    ConversionConfig config = new ConversionConfig();
    ConversionHandler conversionHandler = new ConversionHandler(config);
    String source = "source.one";
    OneLoadOptions loadOptions = new OneLoadOptions();
    loadOptions.setDefaultFont("Helvetica");
    loadOptions.getFontSubstitutes().addItem(new KeyValuePair<String, String>("Arial", "Helvetica"));
    loadOptions.getFontSubstitutes().addItem(new KeyValuePair<String, String>("Harriet", "Transcript"));
    PdfSaveOptions saveOptions = new PdfSaveOptions();
    ConvertedDocument convertedDocument = conversionHandler.convert(source, loadOptions, saveOptions);
    convertedDocument.save("result");
    ...
    
  7. Set default font when converting from Diagram

    /**
     * <p>
     * Diagram document load options
     * </p>
     */
    public class DiagramLoadOptions extends LoadOptions
    {
        /**
     * <p>
     * Default font for Diagram document. The following font will be used if a font is missing.
     * </p>
     */
     public final String getDefaultFont(){ return auto_DefaultFont; }
        /**
     * <p>
     * Default font for Diagram document. The following font will be used if a font is missing.
     * </p>
     */
     public final void setDefaultFont(String value){ auto_DefaultFont = value; }
        private String auto_DefaultFont;
    }
    

    Usage

    ...
    ConversionConfig config = new ConversionConfig();
    ConversionHandler conversionHandler = new ConversionHandler(config);
    String source = "source.vsd";
    DiagramLoadOptions loadOptions = new DiagramLoadOptions();
    loadOptions.setDefaultFont("Helvetica");
    PdfSaveOptions saveOptions = new PdfSaveOptions();
    ConvertedDocument convertedDocument = conversionHandler.convert(source, loadOptions, saveOptions);
    convertedDocument.save("result");
    ...
    
  8. Set default font when converting Psd, Emf, Wmf documents

    **
     * <p>
     * Image document load options
     * </p>
     */
    public class ImageLoadOptions extends LoadOptions
    {
        /**
     * <p>
     * Default font for Psd, Emf, Wmf document types. The following font will be used if a font is missing.
     * </p>
     */
     public final String getDefaultFont(){ return auto_DefaultFont; }
        /**
     * <p>
     * Default font for Psd, Emf, Wmf document types. The following font will be used if a font is missing.
     * </p>
     */
     public final void setDefaultFont(String value){ auto_DefaultFont = value; }
        private String auto_DefaultFont;
    }
    

    Usage

    ...
    ConversionConfig config = new ConversionConfig();
    ConversionHandler conversionHandler = new ConversionHandler(config);
    String source = "source.psd";
    ImageLoadOptions loadOptions = new ImageLoadOptions();
    loadOptions.setDefaultFont("Helvetica");
    PdfSaveOptions saveOptions = new PdfSaveOptions();
    ConvertedDocument convertedDocument = conversionHandler.convert(source, loadOptions, saveOptions);
    convertedDocument.save("result"); 
    ...