I am a new user of Aspose.slides Java and i am trying to access the TextAutofitTypeEx of a text frame. But there is no accessor method in TextFrameEx to do so.
Question: How can i access the TextAutofitTypeEx property of a text frame ?
I have observed the requirements shared by you and like to share that during coming week we are going to share the latest version of Aspose.Slides for Java 3.0.0. This version does have methods for setting and getting TextAutofitEx. The following code snippet will be used to serve the purpose.
public static void AddTextFrame() throws Exception
{
//Instantiate PresentationEx
PresentationEx pres = new PresentationEx();
//Get the first slide
SlideEx sld = pres.getSlides().get_Item(0);
//Add an AutoShape of Rectangle type
int idx = sld.getShapes().addAutoShape(ShapeTypeEx.Rectangle, 150, 75,150 , 50);
Thanks for the update. I have some questions about the new release:
- There are deprecated methods and classes, is there documentation on how to replace them ?
- Some of the naming convention looks more like .NET rather than Java (for example get_Item). Will there be another release that has Java naming convention ? (we don't want to alter lots of code if the situation is temporary)
I like to share that Aspose.Slides for Java 3.0.0 is the maiden release that has been developed by auto porting features from Aspose.Slides for .NET. In fact, you will find it more similar to Aspose.Slides for .NET as compared to older version of Aspose.Slides for Java. This has in fact brought uniformity in both API’s. Please visit this documentation link for your kind reference about migrating from older product version to newer one.
We migrated from Aspose.Slides Java 2.9.1 to 3.0.0 but opening a pptx now results in an error:
java.lang.UnsupportedOperationException: Culture "English" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.
Can you please share the source presentation along with sample code snippet. Please also share the generated corrupted presentation as well for reference.
I have modified your code snippet to get things going on my end and have been able to generate the PDF without any issue using Aspose.Slides for Java 3.0.0 without any issue. For your kind reference, I have shared the used code snippet and generated PDF. I have used JDK 1.6_27 installed on Windows 7 x64 on my end.
public static PresentationEx createPptxFromFile(String templateFile)
{
try
{
java.io.InputStream in = getResource(templateFile);
PresentationEx pptxPresentation = new PresentationEx(in);
return pptxPresentation;
} catch (Exception e)
{
//throw new TechnicalException(“Could not read template file”, e);
Apparently you could not reproduce the exception, which is :
java.lang.UnsupportedOperationException: Culture "English" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.
The fix you had to make is for finding the file (because you don't have the Renderer class), but is not the solution to our problem.
I doubt that you may be using wrong jar file for your implementation. For JDK 1.4 and 1.5, you need to use aspose.slides-3.0.0-jdk14.jar. For JDK 1.6 and above, you need to use aspose.slides-3.0.0.jar. If you are using the wrong jar file then please use the correct jar file. If there is still an issue then kindly share your feedback and I will create the issue for this as I have not been able to reproduce the issue on my end using JDK 1.6 installed on Windows 7.
You can find the aspose.slides-3.0.0-jdk14.jar inside the lib folder of extracted Aspose.Slides for Java 3.0.0 package. Please share, if I may help you further in this regard.
I ran my code now with the aspose.slides-3.0.0-jdk14 jar file, but I still get:
java.lang.UnsupportedOperationException: Culture "English" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.
I have created an issue with ID SLIDESJAVA-33580 in our issue tracking system to further investigate the issue shared in Websphere v6.1 with J2SE 1.5. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.