diff --git a/.gitignore b/.gitignore index b105810c..69a809f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,40 +1,41 @@ -# Eclipse project files -.classpath -.project -.settings/ -test-output/ - -# IntelliJ project files -.idea/ -*.iws -*.iml -*.ipr - -# Mac -.DS_Store - -# Others -Temp/ -obj/ -classes/ -generated/ -bin/ -* Out* -* out* -*.ldb -_ReSharper*/ -*.eml -out/ -*.user -*.resx -nbproject/ -target/ -build/ -build.xml -Thumbs.db -manifest.mf -Out/ -Out*/ -*.lic -Data/*Out* -/dist/ +# Eclipse project files +.classpath +.project +.settings/ +test-output/ + +# IntelliJ project files +.idea/ +*.iws +*.iml +*.ipr + +# Mac +.DS_Store + +# Others +Temp/ +obj/ +classes/ +generated/ +bin/ +* Out* +* out* +*.ldb +_ReSharper*/ +*.eml +out/ +*.user +*.resx +nbproject/ +target/ +build/ +build.xml +Thumbs.db +manifest.mf +Out/ +Out*/ +*.lic +Data/*Out* +/dist/ +/.vs diff --git a/Examples/.project b/Examples/.project deleted file mode 100644 index ee8166c2..00000000 --- a/Examples/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - Aspose.Slides Examples - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - - - 1356841242113 - src - 26 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-bin - - - - diff --git a/Examples/Data/ActiveX/ActiveX.pptm b/Examples/Data/ActiveX/ActiveX.pptm new file mode 100644 index 00000000..75470fe8 Binary files /dev/null and b/Examples/Data/ActiveX/ActiveX.pptm differ diff --git a/Examples/Data/ActiveX/LinkingVideoActiveXControl_out.pptx b/Examples/Data/ActiveX/LinkingVideoActiveXControl_out.pptx new file mode 100644 index 00000000..94a4ae09 Binary files /dev/null and b/Examples/Data/ActiveX/LinkingVideoActiveXControl_out.pptx differ diff --git a/Examples/Data/ActiveX/template.pptx b/Examples/Data/ActiveX/template.pptx new file mode 100644 index 00000000..1705d254 Binary files /dev/null and b/Examples/Data/ActiveX/template.pptx differ diff --git a/Examples/Data/Charts/AnimatingCategoriesElements_out.pptx b/Examples/Data/Charts/AnimatingCategoriesElements_out.pptx new file mode 100644 index 00000000..e88ffdac Binary files /dev/null and b/Examples/Data/Charts/AnimatingCategoriesElements_out.pptx differ diff --git a/Examples/Data/Charts/AnimatingSeriesElements_out.pptx b/Examples/Data/Charts/AnimatingSeriesElements_out.pptx new file mode 100644 index 00000000..3e73d362 Binary files /dev/null and b/Examples/Data/Charts/AnimatingSeriesElements_out.pptx differ diff --git a/Examples/Data/Charts/AnimatingSeries_out.pptx b/Examples/Data/Charts/AnimatingSeries_out.pptx new file mode 100644 index 00000000..d6fab25e Binary files /dev/null and b/Examples/Data/Charts/AnimatingSeries_out.pptx differ diff --git a/Examples/Data/Charts/AsposeChartModified_out.pptx b/Examples/Data/Charts/AsposeChartModified_out.pptx new file mode 100644 index 00000000..926eed11 Binary files /dev/null and b/Examples/Data/Charts/AsposeChartModified_out.pptx differ diff --git a/Examples/Data/Charts/AsposeChart_out.pptx b/Examples/Data/Charts/AsposeChart_out.pptx new file mode 100644 index 00000000..c67eec1a Binary files /dev/null and b/Examples/Data/Charts/AsposeChart_out.pptx differ diff --git a/Examples/Data/Charts/AsposeScatterChart.pptx b/Examples/Data/Charts/AsposeScatterChart.pptx new file mode 100644 index 00000000..4cc9ac1b Binary files /dev/null and b/Examples/Data/Charts/AsposeScatterChart.pptx differ diff --git a/Examples/Data/Charts/AutoFillSeries_out.pptx b/Examples/Data/Charts/AutoFillSeries_out.pptx new file mode 100644 index 00000000..c44df697 Binary files /dev/null and b/Examples/Data/Charts/AutoFillSeries_out.pptx differ diff --git a/Examples/Data/Charts/AutomaticColor_out.pptx b/Examples/Data/Charts/AutomaticColor_out.pptx new file mode 100644 index 00000000..29eb6f57 Binary files /dev/null and b/Examples/Data/Charts/AutomaticColor_out.pptx differ diff --git a/Examples/Data/Charts/ChangeChartCategoryAxis_out.pptx b/Examples/Data/Charts/ChangeChartCategoryAxis_out.pptx new file mode 100644 index 00000000..e1d16c46 Binary files /dev/null and b/Examples/Data/Charts/ChangeChartCategoryAxis_out.pptx differ diff --git a/Examples/Data/Charts/Chart2.pptx b/Examples/Data/Charts/Chart2.pptx new file mode 100644 index 00000000..bf752f91 Binary files /dev/null and b/Examples/Data/Charts/Chart2.pptx differ diff --git a/Examples/Data/Charts/ChartEntities.pptx b/Examples/Data/Charts/ChartEntities.pptx new file mode 100644 index 00000000..fd5ed572 Binary files /dev/null and b/Examples/Data/Charts/ChartEntities.pptx differ diff --git a/Examples/Data/Charts/ChartIndex.pptx b/Examples/Data/Charts/ChartIndex.pptx new file mode 100644 index 00000000..06793557 Binary files /dev/null and b/Examples/Data/Charts/ChartIndex.pptx differ diff --git a/Examples/Data/Charts/ChartTrendLines_out.pptx b/Examples/Data/Charts/ChartTrendLines_out.pptx new file mode 100644 index 00000000..e4d9972d Binary files /dev/null and b/Examples/Data/Charts/ChartTrendLines_out.pptx differ diff --git a/Examples/Data/Charts/Chart_out.pptx b/Examples/Data/Charts/Chart_out.pptx new file mode 100644 index 00000000..bf752f91 Binary files /dev/null and b/Examples/Data/Charts/Chart_out.pptx differ diff --git a/Examples/Data/Charts/DisplayChartLabels_out.pptx b/Examples/Data/Charts/DisplayChartLabels_out.pptx new file mode 100644 index 00000000..2f7fc0b6 Binary files /dev/null and b/Examples/Data/Charts/DisplayChartLabels_out.pptx differ diff --git a/Examples/Data/Charts/DisplayPercentageAsLabels_out.pptx b/Examples/Data/Charts/DisplayPercentageAsLabels_out.pptx new file mode 100644 index 00000000..513445f8 Binary files /dev/null and b/Examples/Data/Charts/DisplayPercentageAsLabels_out.pptx differ diff --git a/Examples/Data/Charts/DoughnutHoleSize_out.pptx b/Examples/Data/Charts/DoughnutHoleSize_out.pptx new file mode 100644 index 00000000..c6a10da3 Binary files /dev/null and b/Examples/Data/Charts/DoughnutHoleSize_out.pptx differ diff --git a/Examples/Data/Charts/ErrorBarsCustomValues_out.pptx b/Examples/Data/Charts/ErrorBarsCustomValues_out.pptx new file mode 100644 index 00000000..e570d3e1 Binary files /dev/null and b/Examples/Data/Charts/ErrorBarsCustomValues_out.pptx differ diff --git a/Examples/Data/Charts/ErrorBars_out.pptx b/Examples/Data/Charts/ErrorBars_out.pptx new file mode 100644 index 00000000..22d97f6f Binary files /dev/null and b/Examples/Data/Charts/ErrorBars_out.pptx differ diff --git a/Examples/Data/Charts/ExistingChart.pptx b/Examples/Data/Charts/ExistingChart.pptx new file mode 100644 index 00000000..70e315fc Binary files /dev/null and b/Examples/Data/Charts/ExistingChart.pptx differ diff --git a/Examples/Data/Charts/ExternalWB.pptx b/Examples/Data/Charts/ExternalWB.pptx new file mode 100644 index 00000000..e1cb2d51 Binary files /dev/null and b/Examples/Data/Charts/ExternalWB.pptx differ diff --git a/Examples/Data/Charts/FormattedChart_out.pptx b/Examples/Data/Charts/FormattedChart_out.pptx new file mode 100644 index 00000000..8b96a1d8 Binary files /dev/null and b/Examples/Data/Charts/FormattedChart_out.pptx differ diff --git a/Examples/Data/Charts/Funnel.pptx b/Examples/Data/Charts/Funnel.pptx new file mode 100644 index 00000000..150312ac Binary files /dev/null and b/Examples/Data/Charts/Funnel.pptx differ diff --git a/Examples/Data/Charts/GapWidth_out.pptx b/Examples/Data/Charts/GapWidth_out.pptx new file mode 100644 index 00000000..25c74136 Binary files /dev/null and b/Examples/Data/Charts/GapWidth_out.pptx differ diff --git a/Examples/Data/Charts/InvertIfNegativeForIndividualSeries.pptx b/Examples/Data/Charts/InvertIfNegativeForIndividualSeries.pptx new file mode 100644 index 00000000..290093b9 Binary files /dev/null and b/Examples/Data/Charts/InvertIfNegativeForIndividualSeries.pptx differ diff --git a/Examples/Data/Charts/LeaderLinesColor.pptx b/Examples/Data/Charts/LeaderLinesColor.pptx new file mode 100644 index 00000000..e287f9a3 Binary files /dev/null and b/Examples/Data/Charts/LeaderLinesColor.pptx differ diff --git a/Examples/Data/Charts/Legend_out.pptx b/Examples/Data/Charts/Legend_out.pptx new file mode 100644 index 00000000..2a4c8420 Binary files /dev/null and b/Examples/Data/Charts/Legend_out.pptx differ diff --git a/Examples/Data/Charts/MarkOptions_out.pptx b/Examples/Data/Charts/MarkOptions_out.pptx new file mode 100644 index 00000000..607727d7 Binary files /dev/null and b/Examples/Data/Charts/MarkOptions_out.pptx differ diff --git a/Examples/Data/Charts/OrganizationChart.pptx b/Examples/Data/Charts/OrganizationChart.pptx new file mode 100644 index 00000000..5d0579e5 Binary files /dev/null and b/Examples/Data/Charts/OrganizationChart.pptx differ diff --git a/Examples/Data/Charts/PieChart_out.pptx b/Examples/Data/Charts/PieChart_out.pptx new file mode 100644 index 00000000..cabea1e4 Binary files /dev/null and b/Examples/Data/Charts/PieChart_out.pptx differ diff --git a/Examples/Data/Charts/PrecisionOfDatalabels_out.pptx b/Examples/Data/Charts/PrecisionOfDatalabels_out.pptx new file mode 100644 index 00000000..f783bbd5 Binary files /dev/null and b/Examples/Data/Charts/PrecisionOfDatalabels_out.pptx differ diff --git a/Examples/Data/Charts/Presentation.pptx b/Examples/Data/Charts/Presentation.pptx new file mode 100644 index 00000000..bcf828ca Binary files /dev/null and b/Examples/Data/Charts/Presentation.pptx differ diff --git a/Examples/Data/Charts/Presentation_BubbleSizeRepresentation.pptx b/Examples/Data/Charts/Presentation_BubbleSizeRepresentation.pptx new file mode 100644 index 00000000..7b694eb9 Binary files /dev/null and b/Examples/Data/Charts/Presentation_BubbleSizeRepresentation.pptx differ diff --git a/Examples/Data/Charts/Presentation_with_externalWbPath.pptx b/Examples/Data/Charts/Presentation_with_externalWbPath.pptx new file mode 100644 index 00000000..e01d80c3 Binary files /dev/null and b/Examples/Data/Charts/Presentation_with_externalWbPath.pptx differ diff --git a/Examples/Data/Charts/Presentation_with_externalWorkbook.pptx b/Examples/Data/Charts/Presentation_with_externalWorkbook.pptx new file mode 100644 index 00000000..5a33e52c Binary files /dev/null and b/Examples/Data/Charts/Presentation_with_externalWorkbook.pptx differ diff --git a/Examples/Data/Charts/PresetNumberFormat_out.pptx b/Examples/Data/Charts/PresetNumberFormat_out.pptx new file mode 100644 index 00000000..d356fc4f Binary files /dev/null and b/Examples/Data/Charts/PresetNumberFormat_out.pptx differ diff --git a/Examples/Data/Charts/Result.pptx b/Examples/Data/Charts/Result.pptx new file mode 100644 index 00000000..e5fbf596 Binary files /dev/null and b/Examples/Data/Charts/Result.pptx differ diff --git a/Examples/Data/Charts/Rotation3D_out.pptx b/Examples/Data/Charts/Rotation3D_out.pptx new file mode 100644 index 00000000..562cf3c3 Binary files /dev/null and b/Examples/Data/Charts/Rotation3D_out.pptx differ diff --git a/Examples/Data/Charts/SecondPlotOptionsforCharts_out.pptx b/Examples/Data/Charts/SecondPlotOptionsforCharts_out.pptx new file mode 100644 index 00000000..58e6f8f0 Binary files /dev/null and b/Examples/Data/Charts/SecondPlotOptionsforCharts_out.pptx differ diff --git a/Examples/Data/Charts/SetCategoryAxisLabelDistance_out.pptx b/Examples/Data/Charts/SetCategoryAxisLabelDistance_out.pptx new file mode 100644 index 00000000..ee3a5484 Binary files /dev/null and b/Examples/Data/Charts/SetCategoryAxisLabelDistance_out.pptx differ diff --git a/Examples/Data/Charts/SetChartSeriesOverlap_out.pptx b/Examples/Data/Charts/SetChartSeriesOverlap_out.pptx new file mode 100644 index 00000000..5773b5ef Binary files /dev/null and b/Examples/Data/Charts/SetChartSeriesOverlap_out.pptx differ diff --git a/Examples/Data/Charts/SetDataLabelsPercentageSign_out.pptx b/Examples/Data/Charts/SetDataLabelsPercentageSign_out.pptx new file mode 100644 index 00000000..bf413e53 Binary files /dev/null and b/Examples/Data/Charts/SetDataLabelsPercentageSign_out.pptx differ diff --git a/Examples/Data/Charts/SetDataRange_out.pptx b/Examples/Data/Charts/SetDataRange_out.pptx new file mode 100644 index 00000000..5cec261c Binary files /dev/null and b/Examples/Data/Charts/SetDataRange_out.pptx differ diff --git a/Examples/Data/Charts/SetInvertFillColorChart_out.pptx b/Examples/Data/Charts/SetInvertFillColorChart_out.pptx new file mode 100644 index 00000000..1f3959c8 Binary files /dev/null and b/Examples/Data/Charts/SetInvertFillColorChart_out.pptx differ diff --git a/Examples/Data/Charts/TestAxis.pptx b/Examples/Data/Charts/TestAxis.pptx new file mode 100644 index 00000000..f465e69e Binary files /dev/null and b/Examples/Data/Charts/TestAxis.pptx differ diff --git a/Examples/Data/Charts/TestChart.pptx b/Examples/Data/Charts/TestChart.pptx new file mode 100644 index 00000000..3fc6a127 Binary files /dev/null and b/Examples/Data/Charts/TestChart.pptx differ diff --git a/Examples/Data/Charts/Tulips.jpg b/Examples/Data/Charts/Tulips.jpg new file mode 100644 index 00000000..d8651488 Binary files /dev/null and b/Examples/Data/Charts/Tulips.jpg differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddPictureFrame/addsimplepictureframes/aspose-logo.jpg b/Examples/Data/Charts/aspose-logo.jpg similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddPictureFrame/addsimplepictureframes/aspose-logo.jpg rename to Examples/Data/Charts/aspose-logo.jpg diff --git a/Examples/Data/Charts/book1.xlsx b/Examples/Data/Charts/book1.xlsx new file mode 100644 index 00000000..9bc391fb Binary files /dev/null and b/Examples/Data/Charts/book1.xlsx differ diff --git a/Examples/Data/Charts/externalWorkbook.xlsx b/Examples/Data/Charts/externalWorkbook.xlsx new file mode 100644 index 00000000..695929ee Binary files /dev/null and b/Examples/Data/Charts/externalWorkbook.xlsx differ diff --git a/Examples/Data/Charts/externalWorkbook1.xlsx b/Examples/Data/Charts/externalWorkbook1.xlsx new file mode 100644 index 00000000..8b7f9d55 Binary files /dev/null and b/Examples/Data/Charts/externalWorkbook1.xlsx differ diff --git a/Examples/Data/Charts/image.png b/Examples/Data/Charts/image.png new file mode 100644 index 00000000..01f8582d Binary files /dev/null and b/Examples/Data/Charts/image.png differ diff --git a/Examples/Data/Charts/out.pptx b/Examples/Data/Charts/out.pptx new file mode 100644 index 00000000..a57d47f8 Binary files /dev/null and b/Examples/Data/Charts/out.pptx differ diff --git a/Examples/Data/Charts/output.pptx b/Examples/Data/Charts/output.pptx new file mode 100644 index 00000000..5f3c102c Binary files /dev/null and b/Examples/Data/Charts/output.pptx differ diff --git a/Examples/Data/Charts/presentation_out.pptx b/Examples/Data/Charts/presentation_out.pptx new file mode 100644 index 00000000..97f068b8 Binary files /dev/null and b/Examples/Data/Charts/presentation_out.pptx differ diff --git a/Examples/Data/Charts/response2.pptx b/Examples/Data/Charts/response2.pptx new file mode 100644 index 00000000..4e21af99 Binary files /dev/null and b/Examples/Data/Charts/response2.pptx differ diff --git a/Examples/Data/Charts/resultchart.pptx b/Examples/Data/Charts/resultchart.pptx new file mode 100644 index 00000000..f30905e7 Binary files /dev/null and b/Examples/Data/Charts/resultchart.pptx differ diff --git a/Examples/Data/Charts/test.pptx b/Examples/Data/Charts/test.pptx new file mode 100644 index 00000000..5548b2a0 Binary files /dev/null and b/Examples/Data/Charts/test.pptx differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/accessopendocument/Source.odp b/Examples/Data/Presentations/Conversion/AccessOpenDoc.odp similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/accessopendocument/Source.odp rename to Examples/Data/Presentations/Conversion/AccessOpenDoc.odp diff --git a/Examples/Data/Presentations/Conversion/ConvertToGif.pptx b/Examples/Data/Presentations/Conversion/ConvertToGif.pptx new file mode 100644 index 00000000..6b60b034 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/ConvertToGif.pptx differ diff --git a/Examples/Data/Presentations/Conversion/ConvertToPDF.pptx b/Examples/Data/Presentations/Conversion/ConvertToPDF.pptx new file mode 100644 index 00000000..c408d180 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/ConvertToPDF.pptx differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/presentationwithnotestotiff/Aspose.pptx b/Examples/Data/Presentations/Conversion/ConvertWithNote.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/presentationwithnotestotiff/Aspose.pptx rename to Examples/Data/Presentations/Conversion/ConvertWithNote.pptx diff --git a/Examples/Data/Presentations/Conversion/Convert_HTML.pptx b/Examples/Data/Presentations/Conversion/Convert_HTML.pptx new file mode 100644 index 00000000..958b0b86 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/Convert_HTML.pptx differ diff --git a/Examples/Data/Presentations/Conversion/Convert_Svg_Custom.pptx b/Examples/Data/Presentations/Conversion/Convert_Svg_Custom.pptx new file mode 100644 index 00000000..f1c75cab Binary files /dev/null and b/Examples/Data/Presentations/Conversion/Convert_Svg_Custom.pptx differ diff --git a/Examples/Data/Presentations/Conversion/Convert_Tiff_Custom.pptx b/Examples/Data/Presentations/Conversion/Convert_Tiff_Custom.pptx new file mode 100644 index 00000000..a5e05efa Binary files /dev/null and b/Examples/Data/Presentations/Conversion/Convert_Tiff_Custom.pptx differ diff --git a/Examples/Data/Presentations/Conversion/Convert_Tiff_Default.pptx b/Examples/Data/Presentations/Conversion/Convert_Tiff_Default.pptx new file mode 100644 index 00000000..3cd93480 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/Convert_Tiff_Default.pptx differ diff --git a/Examples/Data/Presentations/Conversion/Convert_XPS.pptx b/Examples/Data/Presentations/Conversion/Convert_XPS.pptx new file mode 100644 index 00000000..faa50570 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/Convert_XPS.pptx differ diff --git a/Examples/Data/Presentations/Conversion/Convert_XPS_Options.pptx b/Examples/Data/Presentations/Conversion/Convert_XPS_Options.pptx new file mode 100644 index 00000000..33e49a85 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/Convert_XPS_Options.pptx differ diff --git a/Examples/Data/Presentations/Conversion/DemoFile.pptx b/Examples/Data/Presentations/Conversion/DemoFile.pptx new file mode 100644 index 00000000..a195ef06 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/DemoFile.pptx differ diff --git a/Examples/Data/Presentations/Conversion/Example.fodp b/Examples/Data/Presentations/Conversion/Example.fodp new file mode 100644 index 00000000..655782cd --- /dev/null +++ b/Examples/Data/Presentations/Conversion/Example.fodp @@ -0,0 +1,1190 @@ + + + + 22020-03-24T13:48:20.0620000002020-03-23T15:12:122020-03-24T07:48:23PT1MLibreOffice/6.3.4.2$Windows_X86_64 LibreOffice_project/60da17e045e08f1793c57c00ba83cdfce946d0aa20.02000falsefalse01On-screen Show (4:3)falsefalse1 + + + 0 + 0 + 14099 + 9999 + + + view1 + false + false + true + true + true + true + false + false + true + 1500 + false + Hw== + Hw== + + false + true + false + 0 + 0 + false + true + true + 4 + 0 + -7899 + -422 + 28952 + 31483 + 2000 + 2000 + 200 + 200 + 200 + 1 + 200 + 1 + false + 1500 + true + false + + + + + true + $(inst)/share/palette%3B$(user)/config/standard.sob + 0 + $(inst)/share/palette%3B$(user)/config/standard.soc + $(inst)/share/palette%3B$(user)/config/standard.sod + 1250 + true + true + false + true + false + + + en + US + + + + + + ru + RU + + + + + + $(inst)/share/palette%3B$(user)/config/standard.sog + true + $(inst)/share/palette%3B$(user)/config/standard.soh + false + false + true + true + false + true + false + false + true + false + false + false + false + false + $(inst)/share/palette%3B$(user)/config/standard.soe + false + 4 + true + 0 + low-resolution + + false + + true + false + 6 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <номер> + + + + + + + 24.3.20 + + + + + + + + + + <номер> + + + + + + + + + + + + + + + + + + + + + + + + + <номер> + + + + + + + + + + + Table.fodp + + + + + + + + + + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + + + a + + + b + + + c + + + d + + + e + + + + VkNMTVRGAQAxAAAAAAAAAAEAGwAAAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAJA3AADc + DwAA4AAAAIkAAQAhAAAAAQAbAAAADQAa5f//MOn//wEAAAABAAAAAQAAAAEAAAAAlgABAAIA + AAAJAIsAAQACAAAAAwCFAAEABQAAALOzswABhAABAAUAAAAAAAAAAG8AAgAuAAAAAQAFACQb + AADuFgAAJyYAAO4WAAAnJgAAvR4AACQbAAC9HgAAJBsAAO4WAAAAAIwAAQAAAAAAAAIBACAA + AAAWAFhURVhUX1BBSU5UU0hBUEVfQkVHSU4AAAAAAAAAAIoAAQBBAAAAAwA7AAAADwBMaWJl + cmF0aW9uIFNhbnMAAAAAAAB7AgAA//8AAAIACAAAAAAAAAAZBAAAAAAAAAABAP8DAAAAAACI + AAEAAgAAAAEAhwABAAUAAAD/////AIYAAQAEAAAAAAAAAHEAAgAeAAAAIhwAAK0ZAAABAAAA + MQAAAAEAAQAAAF8BAAABADEAAAIBABMAAAAJAFhURVhUX0VPQwAAAAAAAAAAAAIBABMAAAAJ + AFhURVhUX0VPTAAAAAAAAAAAAAIBABMAAAAJAFhURVhUX0VPUAAAAAAAAAAAAAIBAB4AAAAU + AFhURVhUX1BBSU5UU0hBUEVfRU5EAAAAAAAAAACLAAEAAgAAAAMAhQABAAUAAACzs7MAAYQA + AQAFAAAAAAAAAABvAAIALgAAAAEABQAnJgAA7hYAACoxAADuFgAAKjEAAL0eAAAnJgAAvR4A + ACcmAADuFgAAAACMAAEAAAAAAAACAQAgAAAAFgBYVEVYVF9QQUlOVFNIQVBFX0JFR0lOAAAA + AAAAAACKAAEAQQAAAAMAOwAAAA8ATGliZXJhdGlvbiBTYW5zAAAAAAAAewIAAP//AAACAAgA + AAAAAAAAGQQAAAAAAAAAAQD/AwAAAAAAiAABAAIAAAABAIcAAQAFAAAA/////wCGAAEABAAA + AAAAAABxAAIAHgAAACUnAACtGQAAAQAAADIAAAABAAEAAABfAQAAAQAyAAACAQATAAAACQBY + VEVYVF9FT0MAAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0wAAAAAAAAAAAACAQATAAAACQBY + VEVYVF9FT1AAAAAAAAAAAAACAQAeAAAAFABYVEVYVF9QQUlOVFNIQVBFX0VORAAAAAAAAAAA + iwABAAIAAAADAIUAAQAFAAAAs7OzAAGEAAEABQAAAAAAAAAAbwACAC4AAAABAAUAKjEAAO4W + AAAtPAAA7hYAAC08AAC9HgAAKjEAAL0eAAAqMQAA7hYAAAAAjAABAAAAAAAAAgEAIAAAABYA + WFRFWFRfUEFJTlRTSEFQRV9CRUdJTgAAAAAAAAAAigABAEEAAAADADsAAAAPAExpYmVyYXRp + b24gU2FucwAAAAAAAHsCAAD//wAAAgAIAAAAAAAAABkEAAAAAAAAAAEA/wMAAAAAAIgAAQAC + AAAAAQCHAAEABQAAAP////8AhgABAAQAAAAAAAAAcQACAB4AAAAoMgAArRkAAAEAAAAzAAAA + AQABAAAAXwEAAAEAMwAAAgEAEwAAAAkAWFRFWFRfRU9DAAAAAAAAAAAAAgEAEwAAAAkAWFRF + WFRfRU9MAAAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9QAAAAAAAAAAAAAgEAHgAAABQAWFRF + WFRfUEFJTlRTSEFQRV9FTkQAAAAAAAAAAIsAAQACAAAAAwCFAAEABQAAALOzswABhAABAAUA + AAAAAAAAAG8AAgAuAAAAAQAFAC08AADuFgAAMEcAAO4WAAAwRwAAvR4AAC08AAC9HgAALTwA + AO4WAAAAAIwAAQAAAAAAAAIBACAAAAAWAFhURVhUX1BBSU5UU0hBUEVfQkVHSU4AAAAAAAAA + AIoAAQBBAAAAAwA7AAAADwBMaWJlcmF0aW9uIFNhbnMAAAAAAAB7AgAA//8AAAIACAAAAAAA + AAAZBAAAAAAAAAABAP8DAAAAAACIAAEAAgAAAAEAhwABAAUAAAD/////AIYAAQAEAAAAAAAA + AHEAAgAeAAAAKz0AAK0ZAAABAAAANAAAAAEAAQAAAF8BAAABADQAAAIBABMAAAAJAFhURVhU + X0VPQwAAAAAAAAAAAAIBABMAAAAJAFhURVhUX0VPTAAAAAAAAAAAAAIBABMAAAAJAFhURVhU + X0VPUAAAAAAAAAAAAAIBAB4AAAAUAFhURVhUX1BBSU5UU0hBUEVfRU5EAAAAAAAAAACLAAEA + AgAAAAMAhQABAAUAAACzs7MAAYQAAQAFAAAAAAAAAABvAAIALgAAAAEABQAwRwAA7hYAADdS + AADuFgAAN1IAAL0eAAAwRwAAvR4AADBHAADuFgAAAACMAAEAAAAAAAACAQAgAAAAFgBYVEVY + VF9QQUlOVFNIQVBFX0JFR0lOAAAAAAAAAACKAAEAQQAAAAMAOwAAAA8ATGliZXJhdGlvbiBT + YW5zAAAAAAAAewIAAP//AAACAAgAAAAAAAAAGQQAAAAAAAAAAQD/AwAAAAAAiAABAAIAAAAB + AIcAAQAFAAAA/////wCGAAEABAAAAAAAAABxAAIAHgAAAC5IAACtGQAAAQAAADUAAAABAAEA + AABfAQAAAQA1AAACAQATAAAACQBYVEVYVF9FT0MAAAAAAAAAAAACAQATAAAACQBYVEVYVF9F + T0wAAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT1AAAAAAAAAAAAACAQAeAAAAFABYVEVYVF9Q + QUlOVFNIQVBFX0VORAAAAAAAAAAAiwABAAIAAAADAIUAAQAFAAAAzMzMAAGEAAEABQAAAAAA + AAAAbwACAC4AAAABAAUAJBsAAL0eAAAnJgAAvR4AACcmAACNJgAAJBsAAI0mAAAkGwAAvR4A + AAAAjAABAAAAAAAAAgEAIAAAABYAWFRFWFRfUEFJTlRTSEFQRV9CRUdJTgAAAAAAAAAAigAB + AEEAAAADADsAAAAPAExpYmVyYXRpb24gU2FucwAAAAAAAHsCAAD//wAAAgAFAAAAAAAAABkE + AAAAAAAAAAEA/wMAAAAAAIgAAQACAAAAAQCHAAEABQAAAP////8AhgABAAQAAAAAAAAAcQAC + AB4AAAAiHAAAfCEAAAEAAABhAAAAAQABAAAAXwEAAAEAYQAAAgEAEwAAAAkAWFRFWFRfRU9D + AAAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9MAAAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9Q + AAAAAAAAAAAAAgEAHgAAABQAWFRFWFRfUEFJTlRTSEFQRV9FTkQAAAAAAAAAAIsAAQACAAAA + AwCFAAEABQAAAMzMzAABhAABAAUAAAAAAAAAAG8AAgAuAAAAAQAFACcmAAC9HgAAKjEAAL0e + AAAqMQAAjSYAACcmAACNJgAAJyYAAL0eAAAAAIwAAQAAAAAAAAIBACAAAAAWAFhURVhUX1BB + SU5UU0hBUEVfQkVHSU4AAAAAAAAAAIoAAQBBAAAAAwA7AAAADwBMaWJlcmF0aW9uIFNhbnMA + AAAAAAB7AgAA//8AAAIABQAAAAAAAAAZBAAAAAAAAAABAP8DAAAAAACIAAEAAgAAAAEAhwAB + AAUAAAD/////AIYAAQAEAAAAAAAAAHEAAgAeAAAAJScAAHwhAAABAAAAYgAAAAEAAQAAAF8B + AAABAGIAAAIBABMAAAAJAFhURVhUX0VPQwAAAAAAAAAAAAIBABMAAAAJAFhURVhUX0VPTAAA + AAAAAAAAAAIBABMAAAAJAFhURVhUX0VPUAAAAAAAAAAAAAIBAB4AAAAUAFhURVhUX1BBSU5U + U0hBUEVfRU5EAAAAAAAAAACLAAEAAgAAAAMAhQABAAUAAADMzMwAAYQAAQAFAAAAAAAAAABv + AAIALgAAAAEABQAqMQAAvR4AAC08AAC9HgAALTwAAI0mAAAqMQAAjSYAACoxAAC9HgAAAACM + AAEAAAAAAAACAQAgAAAAFgBYVEVYVF9QQUlOVFNIQVBFX0JFR0lOAAAAAAAAAACKAAEAQQAA + AAMAOwAAAA8ATGliZXJhdGlvbiBTYW5zAAAAAAAAewIAAP//AAACAAUAAAAAAAAAGQQAAAAA + AAAAAQD/AwAAAAAAiAABAAIAAAABAIcAAQAFAAAA/////wCGAAEABAAAAAAAAABxAAIAHgAA + ACgyAAB8IQAAAQAAAGMAAAABAAEAAAA+AQAAAQBjAAACAQATAAAACQBYVEVYVF9FT0MAAAAA + AAAAAAACAQATAAAACQBYVEVYVF9FT0wAAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT1AAAAAA + AAAAAAACAQAeAAAAFABYVEVYVF9QQUlOVFNIQVBFX0VORAAAAAAAAAAAiwABAAIAAAADAIUA + AQAFAAAAzMzMAAGEAAEABQAAAAAAAAAAbwACAC4AAAABAAUALTwAAL0eAAAwRwAAvR4AADBH + AACNJgAALTwAAI0mAAAtPAAAvR4AAAAAjAABAAAAAAAAAgEAIAAAABYAWFRFWFRfUEFJTlRT + SEFQRV9CRUdJTgAAAAAAAAAAigABAEEAAAADADsAAAAPAExpYmVyYXRpb24gU2FucwAAAAAA + AHsCAAD//wAAAgAFAAAAAAAAABkEAAAAAAAAAAEA/wMAAAAAAIgAAQACAAAAAQCHAAEABQAA + AP////8AhgABAAQAAAAAAAAAcQACAB4AAAArPQAAfCEAAAEAAABkAAAAAQABAAAAXwEAAAEA + ZAAAAgEAEwAAAAkAWFRFWFRfRU9DAAAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9MAAAAAAAA + AAAAAgEAEwAAAAkAWFRFWFRfRU9QAAAAAAAAAAAAAgEAHgAAABQAWFRFWFRfUEFJTlRTSEFQ + RV9FTkQAAAAAAAAAAIsAAQACAAAAAwCFAAEABQAAAMzMzAABhAABAAUAAAAAAAAAAG8AAgAu + AAAAAQAFADBHAAC9HgAAN1IAAL0eAAA3UgAAjSYAADBHAACNJgAAMEcAAL0eAAAAAIwAAQAA + AAAAAAIBACAAAAAWAFhURVhUX1BBSU5UU0hBUEVfQkVHSU4AAAAAAAAAAIoAAQBBAAAAAwA7 + AAAADwBMaWJlcmF0aW9uIFNhbnMAAAAAAAB7AgAA//8AAAIABQAAAAAAAAAZBAAAAAAAAAAB + AP8DAAAAAACIAAEAAgAAAAEAhwABAAUAAAD/////AIYAAQAEAAAAAAAAAHEAAgAeAAAALkgA + AHwhAAABAAAAZQAAAAEAAQAAAF8BAAABAGUAAAIBABMAAAAJAFhURVhUX0VPQwAAAAAAAAAA + AAIBABMAAAAJAFhURVhUX0VPTAAAAAAAAAAAAAIBABMAAAAJAFhURVhUX0VPUAAAAAAAAAAA + AAIBAB4AAAAUAFhURVhUX1BBSU5UU0hBUEVfRU5EAAAAAAAAAACLAAEAAgAAAAMAhAABAAUA + AAD///8AAQACAQBuAAAAFQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAATwAAAAEASQAAAAEA + EwAAAAIAFRsAAO4WAABGUgAA7hYAAAABAAIAAAAAAAEAAgAAAAAAAAAAAAAAAAA9CtejcP09 + QAAAAQA9CtejcP09QAAAAACEAAEABQAAAP///wABhQABAAUAAAAAAAAAAG0AAwAzAAAAAgAV + GwAA7hYAAEZSAADuFgAABAAaAAAAAQAeAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAIBAB0A + AAATAFhQQVRIU1RST0tFX1NFUV9FTkQAAAAAAAAAAIwAAQAAAAAAiwABAAIAAAADAIQAAQAF + AAAA////AAEAAgEAbgAAABUAWFBBVEhTVFJPS0VfU0VRX0JFR0lOAAAAAE8AAAABAEkAAAAB + ABMAAAACACQbAADfFgAAJBsAAJwmAAAAAQACAAAAAAABAAIAAAAAAAAAAAAAAAAAPQrXo3D9 + PUAAAAEAPQrXo3D9PUAAAAAAhAABAAUAAAD///8AAYUAAQAFAAAAAAAAAABtAAMAMwAAAAIA + JBsAAN8WAAAkGwAAnCYAAAQAGgAAAAEAHgAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAACAQAd + AAAAEwBYUEFUSFNUUk9LRV9TRVFfRU5EAAAAAAAAAACMAAEAAAAAAIsAAQACAAAAAwCEAAEA + BQAAAP///wABAAIBAG4AAAAVAFhQQVRIU1RST0tFX1NFUV9CRUdJTgAAAABPAAAAAQBJAAAA + AQATAAAAAgAnJgAA3xYAACcmAACcJgAAAAEAAgAAAAAAAQACAAAAAAAAAAAAAAAAAD0K16Nw + /T1AAAABAD0K16Nw/T1AAAAAAIQAAQAFAAAA////AAGFAAEABQAAAAAAAAAAbQADADMAAAAC + ACcmAADfFgAAJyYAAJwmAAAEABoAAAABAB4AAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAgEA + HQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAAAAAAAAAAjAABAAAAAACLAAEAAgAAAAMAhAAB + AAUAAAD///8AAQACAQBuAAAAFQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAATwAAAAEASQAA + AAEAEwAAAAIAKjEAAN8WAAAqMQAAnCYAAAABAAIAAAAAAAEAAgAAAAAAAAAAAAAAAAA9Ctej + cP09QAAAAQA9CtejcP09QAAAAACEAAEABQAAAP///wABhQABAAUAAAAAAAAAAG0AAwAzAAAA + AgAqMQAA3xYAACoxAACcJgAABAAaAAAAAQAeAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAIB + AB0AAAATAFhQQVRIU1RST0tFX1NFUV9FTkQAAAAAAAAAAIwAAQAAAAAAiwABAAIAAAADAIQA + AQAFAAAA////AAEAAgEAbgAAABUAWFBBVEhTVFJPS0VfU0VRX0JFR0lOAAAAAE8AAAABAEkA + AAABABMAAAACAC08AADfFgAALTwAAJwmAAAAAQACAAAAAAABAAIAAAAAAAAAAAAAAAAAPQrX + o3D9PUAAAAEAPQrXo3D9PUAAAAAAhAABAAUAAAD///8AAYUAAQAFAAAAAAAAAABtAAMAMwAA + AAIALTwAAN8WAAAtPAAAnCYAAAQAGgAAAAEAHgAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAC + AQAdAAAAEwBYUEFUSFNUUk9LRV9TRVFfRU5EAAAAAAAAAACMAAEAAAAAAIsAAQACAAAAAwCE + AAEABQAAAP///wABAAIBAG4AAAAVAFhQQVRIU1RST0tFX1NFUV9CRUdJTgAAAABPAAAAAQBJ + AAAAAQATAAAAAgAwRwAA3xYAADBHAACcJgAAAAEAAgAAAAAAAQACAAAAAAAAAAAAAAAAAD0K + 16Nw/T1AAAABAD0K16Nw/T1AAAAAAIQAAQAFAAAA////AAGFAAEABQAAAAAAAAAAbQADADMA + AAACADBHAADfFgAAMEcAAJwmAAAEABoAAAABAB4AAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAA + AgEAHQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAAAAAAAAAAjAABAAAAAACLAAEAAgAAAAMA + hAABAAUAAAD///8AAQACAQBuAAAAFQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAATwAAAAEA + SQAAAAEAEwAAAAIAN1IAAN8WAAA3UgAAnCYAAAABAAIAAAAAAAEAAgAAAAAAAAAAAAAAAAA9 + CtejcP09QAAAAQA9CtejcP09QAAAAACEAAEABQAAAP///wABhQABAAUAAAAAAAAAAG0AAwAz + AAAAAgA3UgAA3xYAADdSAACcJgAABAAaAAAAAQAeAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAA + AAIBAB0AAAATAFhQQVRIU1RST0tFX1NFUV9FTkQAAAAAAAAAAIwAAQAAAAAAiwABAAIAAAAD + AIQAAQAFAAAA////AAEAAgEAbgAAABUAWFBBVEhTVFJPS0VfU0VRX0JFR0lOAAAAAE8AAAAB + AEkAAAABABMAAAACABUbAAC9HgAARlIAAL0eAAAAAQACAAAAAAABAAIAAAAAAAAAAAAAAAAA + j8L1KFxfV0AAAAEAj8L1KFxfV0AAAAAAhAABAAUAAAD///8AAYUAAQAFAAAAAAAAAABtAAMA + MwAAAAIAFRsAAL0eAABGUgAAvR4AAAQAGgAAAAEAXQAAAAAAAAAAAAAAAAAAAAAAAAAEAAAA + AAACAQAdAAAAEwBYUEFUSFNUUk9LRV9TRVFfRU5EAAAAAAAAAACMAAEAAAAAAIsAAQACAAAA + AwCEAAEABQAAAP///wABAAIBAG4AAAAVAFhQQVRIU1RST0tFX1NFUV9CRUdJTgAAAABPAAAA + AQBJAAAAAQATAAAAAgAVGwAAjSYAAEZSAACNJgAAAAEAAgAAAAAAAQACAAAAAAAAAAAAAAAA + AD0K16Nw/T1AAAABAD0K16Nw/T1AAAAAAIQAAQAFAAAA////AAGFAAEABQAAAAAAAAAAbQAD + ADMAAAACABUbAACNJgAARlIAAI0mAAAEABoAAAABAB4AAAAAAAAAAAAAAAAAAAAAAAAABAAA + AAAAAgEAHQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAAAAAAAAAAjAABAAAAAAA= + + + + + + + + + + + <номер> + + + + + + + + \ No newline at end of file diff --git a/Examples/Data/Presentations/Conversion/HandoutExample.pptx b/Examples/Data/Presentations/Conversion/HandoutExample.pptx new file mode 100644 index 00000000..29a2a072 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/HandoutExample.pptx differ diff --git a/Examples/Data/Presentations/Conversion/HelloWorld.pptx b/Examples/Data/Presentations/Conversion/HelloWorld.pptx new file mode 100644 index 00000000..407c36ee Binary files /dev/null and b/Examples/Data/Presentations/Conversion/HelloWorld.pptx differ diff --git a/Examples/Data/Presentations/Conversion/HiddingSlides.pptx b/Examples/Data/Presentations/Conversion/HiddingSlides.pptx new file mode 100644 index 00000000..0984d279 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/HiddingSlides.pptx differ diff --git a/Examples/Data/Presentations/Conversion/Individual-Slide.pptx b/Examples/Data/Presentations/Conversion/Individual-Slide.pptx new file mode 100644 index 00000000..d9d6e4f5 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/Individual-Slide.pptx differ diff --git a/Examples/Data/Presentations/Conversion/InkOptions.pptx b/Examples/Data/Presentations/Conversion/InkOptions.pptx new file mode 100644 index 00000000..73884ab8 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/InkOptions.pptx differ diff --git a/Examples/Data/Presentations/Conversion/Media File.pptx b/Examples/Data/Presentations/Conversion/Media File.pptx new file mode 100644 index 00000000..1b2d2a64 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/Media File.pptx differ diff --git a/Examples/Data/Presentations/Conversion/NotesFile.pptx b/Examples/Data/Presentations/Conversion/NotesFile.pptx new file mode 100644 index 00000000..c2153788 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/NotesFile.pptx differ diff --git a/Examples/Data/Presentations/Conversion/PPTtoPPTX.ppt b/Examples/Data/Presentations/Conversion/PPTtoPPTX.ppt new file mode 100644 index 00000000..0906c884 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/PPTtoPPTX.ppt differ diff --git a/Examples/Data/Presentations/Conversion/PresOleExample.pptx b/Examples/Data/Presentations/Conversion/PresOleExample.pptx new file mode 100644 index 00000000..e8614b3c Binary files /dev/null and b/Examples/Data/Presentations/Conversion/PresOleExample.pptx differ diff --git a/Examples/Data/Presentations/Conversion/PresentationDemo.pptx b/Examples/Data/Presentations/Conversion/PresentationDemo.pptx new file mode 100644 index 00000000..cf4f73e8 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/PresentationDemo.pptx differ diff --git a/Examples/Data/Presentations/Conversion/SelectedSlides.pptx b/Examples/Data/Presentations/Conversion/SelectedSlides.pptx new file mode 100644 index 00000000..1b49a2bb Binary files /dev/null and b/Examples/Data/Presentations/Conversion/SelectedSlides.pptx differ diff --git a/Examples/Data/Presentations/Conversion/SimpleAnimations.pptx b/Examples/Data/Presentations/Conversion/SimpleAnimations.pptx new file mode 100644 index 00000000..0df6778b Binary files /dev/null and b/Examples/Data/Presentations/Conversion/SimpleAnimations.pptx differ diff --git a/Examples/Data/Presentations/Conversion/SimpleTableExample.pdf b/Examples/Data/Presentations/Conversion/SimpleTableExample.pdf new file mode 100644 index 00000000..ecc46c55 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/SimpleTableExample.pdf differ diff --git a/Examples/Data/Presentations/Conversion/SvgShapesConversion.pptx b/Examples/Data/Presentations/Conversion/SvgShapesConversion.pptx new file mode 100644 index 00000000..72ee919f Binary files /dev/null and b/Examples/Data/Presentations/Conversion/SvgShapesConversion.pptx differ diff --git a/Examples/Data/Presentations/Conversion/TestExportShapeToSvg.pptx b/Examples/Data/Presentations/Conversion/TestExportShapeToSvg.pptx new file mode 100644 index 00000000..b3647ea4 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/TestExportShapeToSvg.pptx differ diff --git a/Examples/Data/Presentations/Conversion/TestHtml.html b/Examples/Data/Presentations/Conversion/TestHtml.html new file mode 100644 index 00000000..23b8f9cc --- /dev/null +++ b/Examples/Data/Presentations/Conversion/TestHtml.html @@ -0,0 +1,31 @@ + + + + + + + + + + +
+

+ Avis de la TEST TEST TEST TEST pour 2025 : 75 MDH (-12 MDH) +

+ +

+ ➤ TEST 1 : 5 MDH +

+

+

+ ➤ Autres TEST : 56 MDH +

+

  1. Le matin, une brume légère enveloppe la vallée.
  2. Un oiseau lance son premier chant au lever du soleil.
  3. Les volets des maisons grincent doucement en s’ouvrant.
  4. Une tasse de café fume sur une table en bois.
  5. Les journaux du jour sont livrés avec un léger bruit feutré.
  6. Le chat du voisin traverse la rue en trottinant.
  7. Un cycliste file à toute vitesse sur le chemin pavé.
  8. Les feuilles mortes tourbillonnent au gré du vent.
  9. Un chien aboie au loin, brisant le silence matinal.
  10. Une voiture passe lentement, ses phares encore allumés.
  11. Le parfum du pain chaud s’échappe d’une boulangerie.
  12. Une dame arrose ses plantes sur son balcon.
  13. Une horloge de clocher sonne neuf heures.
  14. Les nuages s’effilochent sous un ciel pâle.
  15. Un enfant rit en courant après un ballon rouge.
  16. Un marchand installe son étal sur la place du marché.
  17. Le bruit d’une cloche de vélo résonne dans la ruelle.
  18. Un peintre pose son chevalet face à un paysage urbain.
  19. Une brise légère fait danser les rideaux d’une fenêtre entrouverte.
  20. Le jour avance, accompagné de mille petits bruits familier
  21. Le jour avance, accompagné de mille petits bruits familier
  22. Le jour avance, accompagné de mille petits bruits familier
  23. Le jour avance, accompagné de mille petits bruits familier
  24. Le jour avance, accompagné de mille petits bruits familier
  25. Le jour avance, accompagné de mille petits bruits familier

+

+ ➤ TESTTS : 1 785 MDH +

+

+
+ + + \ No newline at end of file diff --git a/Examples/Data/Presentations/Conversion/XamlEtalon.pptx b/Examples/Data/Presentations/Conversion/XamlEtalon.pptx new file mode 100644 index 00000000..d519d479 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/XamlEtalon.pptx differ diff --git a/Examples/Data/Presentations/Conversion/content.svg b/Examples/Data/Presentations/Conversion/content.svg new file mode 100644 index 00000000..f99dbd9b --- /dev/null +++ b/Examples/Data/Presentations/Conversion/content.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + +31.3% + + + + + + + + + +10.4% + + + + + + + + + +52.1% + + + + + + + + + +6.3% + + + + + + + + + + \ No newline at end of file diff --git a/Examples/Data/Presentations/Conversion/demo.pptx b/Examples/Data/Presentations/Conversion/demo.pptx new file mode 100644 index 00000000..da6daa41 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/demo.pptx differ diff --git a/Examples/Data/Presentations/Conversion/demo_2.pptx b/Examples/Data/Presentations/Conversion/demo_2.pptx new file mode 100644 index 00000000..fddb4382 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/demo_2.pptx differ diff --git a/Examples/Data/Presentations/Conversion/presentation.pptx b/Examples/Data/Presentations/Conversion/presentation.pptx new file mode 100644 index 00000000..8e4c7e63 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/presentation.pptx differ diff --git a/Examples/Data/Presentations/Conversion/tagged-pdf-demo.pptx b/Examples/Data/Presentations/Conversion/tagged-pdf-demo.pptx new file mode 100644 index 00000000..591e9330 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/tagged-pdf-demo.pptx differ diff --git a/Examples/Data/Presentations/Conversion/welcome-to-powerpoint.pdf b/Examples/Data/Presentations/Conversion/welcome-to-powerpoint.pdf new file mode 100644 index 00000000..c928f396 Binary files /dev/null and b/Examples/Data/Presentations/Conversion/welcome-to-powerpoint.pdf differ diff --git a/Examples/Data/Presentations/LowCode/ForEachPortion.pptx b/Examples/Data/Presentations/LowCode/ForEachPortion.pptx new file mode 100644 index 00000000..588e4723 Binary files /dev/null and b/Examples/Data/Presentations/LowCode/ForEachPortion.pptx differ diff --git a/Examples/Data/Presentations/LowCode/MultipleMaster.pptx b/Examples/Data/Presentations/LowCode/MultipleMaster.pptx new file mode 100644 index 00000000..4514a9bf Binary files /dev/null and b/Examples/Data/Presentations/LowCode/MultipleMaster.pptx differ diff --git a/Examples/Data/Presentations/Opening/HelloWorld.pptx b/Examples/Data/Presentations/Opening/HelloWorld.pptx new file mode 100644 index 00000000..407c36ee Binary files /dev/null and b/Examples/Data/Presentations/Opening/HelloWorld.pptx differ diff --git a/Examples/Data/Presentations/Opening/OlePptx.pptx b/Examples/Data/Presentations/Opening/OlePptx.pptx new file mode 100644 index 00000000..30927ed8 Binary files /dev/null and b/Examples/Data/Presentations/Opening/OlePptx.pptx differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/OpenpPresentation/openpasswordpresentation/Aspose.pptx b/Examples/Data/Presentations/Opening/OpenPasswordPresentation.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/OpenpPresentation/openpasswordpresentation/Aspose.pptx rename to Examples/Data/Presentations/Opening/OpenPasswordPresentation.pptx diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/accessbuiltinproperties/Aspose.pptx b/Examples/Data/Presentations/Opening/OpenPresentation.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/accessbuiltinproperties/Aspose.pptx rename to Examples/Data/Presentations/Opening/OpenPresentation.pptx diff --git a/Examples/Data/Presentations/Opening/Shapes.pptx b/Examples/Data/Presentations/Opening/Shapes.pptx new file mode 100644 index 00000000..f6e4978a Binary files /dev/null and b/Examples/Data/Presentations/Opening/Shapes.pptx differ diff --git a/Examples/Data/Presentations/Opening/presentation.ppt b/Examples/Data/Presentations/Opening/presentation.ppt new file mode 100644 index 00000000..d12a079e Binary files /dev/null and b/Examples/Data/Presentations/Opening/presentation.ppt differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/accessmodifycustomproperties/Aspose.pptx b/Examples/Data/Presentations/Properties/AccessBuiltin Properties.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/accessmodifycustomproperties/Aspose.pptx rename to Examples/Data/Presentations/Properties/AccessBuiltin Properties.pptx diff --git a/Examples/Data/Presentations/Properties/AccessModifyingProperties.pptx b/Examples/Data/Presentations/Properties/AccessModifyingProperties.pptx new file mode 100644 index 00000000..0da30d0e Binary files /dev/null and b/Examples/Data/Presentations/Properties/AccessModifyingProperties.pptx differ diff --git a/Examples/Data/Presentations/Properties/AccessOpenDoc.odp b/Examples/Data/Presentations/Properties/AccessOpenDoc.odp new file mode 100644 index 00000000..e68d10c6 Binary files /dev/null and b/Examples/Data/Presentations/Properties/AccessOpenDoc.odp differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/OpenpPresentation/accessproperties/demoPassDocument.pptx b/Examples/Data/Presentations/Properties/AccessProperties.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/OpenpPresentation/accessproperties/demoPassDocument.pptx rename to Examples/Data/Presentations/Properties/AccessProperties.pptx diff --git a/Examples/Data/Presentations/Properties/ExtendDocumentProperies.pptx b/Examples/Data/Presentations/Properties/ExtendDocumentProperies.pptx new file mode 100644 index 00000000..1d40b8f2 Binary files /dev/null and b/Examples/Data/Presentations/Properties/ExtendDocumentProperies.pptx differ diff --git a/Examples/Data/Presentations/Properties/ModifyBuiltinProperties.pptx b/Examples/Data/Presentations/Properties/ModifyBuiltinProperties.pptx new file mode 100644 index 00000000..3db8ee4f Binary files /dev/null and b/Examples/Data/Presentations/Properties/ModifyBuiltinProperties.pptx differ diff --git a/Examples/Data/Presentations/Properties/ModifyBuiltinProperties1.pptx b/Examples/Data/Presentations/Properties/ModifyBuiltinProperties1.pptx new file mode 100644 index 00000000..00ef0d8e Binary files /dev/null and b/Examples/Data/Presentations/Properties/ModifyBuiltinProperties1.pptx differ diff --git a/Examples/Data/Presentations/Properties/doc1.pptx b/Examples/Data/Presentations/Properties/doc1.pptx new file mode 100644 index 00000000..deea09e1 Binary files /dev/null and b/Examples/Data/Presentations/Properties/doc1.pptx differ diff --git a/Examples/Data/Presentations/Properties/doc2.odp b/Examples/Data/Presentations/Properties/doc2.odp new file mode 100644 index 00000000..deea09e1 Binary files /dev/null and b/Examples/Data/Presentations/Properties/doc2.odp differ diff --git a/Examples/Data/Presentations/Properties/doc3.ppt b/Examples/Data/Presentations/Properties/doc3.ppt new file mode 100644 index 00000000..deea09e1 Binary files /dev/null and b/Examples/Data/Presentations/Properties/doc3.ppt differ diff --git a/Examples/Data/Presentations/Properties/modify_pass2.pptx b/Examples/Data/Presentations/Properties/modify_pass2.pptx new file mode 100644 index 00000000..87303715 Binary files /dev/null and b/Examples/Data/Presentations/Properties/modify_pass2.pptx differ diff --git a/Examples/Data/Presentations/Properties/open_pass1.ppt b/Examples/Data/Presentations/Properties/open_pass1.ppt new file mode 100644 index 00000000..1687b465 Binary files /dev/null and b/Examples/Data/Presentations/Properties/open_pass1.ppt differ diff --git a/Examples/Data/Presentations/Properties/pres.ppt b/Examples/Data/Presentations/Properties/pres.ppt new file mode 100644 index 00000000..96292c96 Binary files /dev/null and b/Examples/Data/Presentations/Properties/pres.ppt differ diff --git a/Examples/Data/Presentations/Properties/pres.pptx b/Examples/Data/Presentations/Properties/pres.pptx new file mode 100644 index 00000000..ff7fbee8 Binary files /dev/null and b/Examples/Data/Presentations/Properties/pres.pptx differ diff --git a/Examples/Data/Presentations/Properties/template.pptx b/Examples/Data/Presentations/Properties/template.pptx new file mode 100644 index 00000000..1705d254 Binary files /dev/null and b/Examples/Data/Presentations/Properties/template.pptx differ diff --git a/Examples/Data/Presentations/Saving/Image.pptx b/Examples/Data/Presentations/Saving/Image.pptx new file mode 100644 index 00000000..44468c1c Binary files /dev/null and b/Examples/Data/Presentations/Saving/Image.pptx differ diff --git a/Examples/Data/Presentations/Saving/ImageQuality.pptx b/Examples/Data/Presentations/Saving/ImageQuality.pptx new file mode 100644 index 00000000..b8ed0790 Binary files /dev/null and b/Examples/Data/Presentations/Saving/ImageQuality.pptx differ diff --git a/Examples/Data/Presentations/Saving/JavaScriptLink.pptx b/Examples/Data/Presentations/Saving/JavaScriptLink.pptx new file mode 100644 index 00000000..ae8945a8 Binary files /dev/null and b/Examples/Data/Presentations/Saving/JavaScriptLink.pptx differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/removewriteprotection/demoWriteProtected.pptx b/Examples/Data/Presentations/Saving/RemoveWriteProtection.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/removewriteprotection/demoWriteProtected.pptx rename to Examples/Data/Presentations/Saving/RemoveWriteProtection.pptx diff --git a/Examples/Data/Presentations/Saving/Shapes.pptx b/Examples/Data/Presentations/Saving/Shapes.pptx new file mode 100644 index 00000000..26918881 Binary files /dev/null and b/Examples/Data/Presentations/Saving/Shapes.pptx differ diff --git a/Examples/Data/Presentations/Saving/image_group.pptx b/Examples/Data/Presentations/Saving/image_group.pptx new file mode 100644 index 00000000..0aef327a Binary files /dev/null and b/Examples/Data/Presentations/Saving/image_group.pptx differ diff --git a/Examples/Data/Presentations/Saving/large_image.jpg b/Examples/Data/Presentations/Saving/large_image.jpg new file mode 100644 index 00000000..35602323 Binary files /dev/null and b/Examples/Data/Presentations/Saving/large_image.jpg differ diff --git a/Examples/Data/Presentations/Saving/presentation.pptx b/Examples/Data/Presentations/Saving/presentation.pptx new file mode 100644 index 00000000..8e4c7e63 Binary files /dev/null and b/Examples/Data/Presentations/Saving/presentation.pptx differ diff --git a/Examples/Data/Presentations/Saving/sample.svg b/Examples/Data/Presentations/Saving/sample.svg new file mode 100644 index 00000000..49a1bac1 --- /dev/null +++ b/Examples/Data/Presentations/Saving/sample.svg @@ -0,0 +1,9 @@ + + +Add an image to a presentation from SVG object. \ No newline at end of file diff --git a/Examples/Data/Rendering-Printing/HelloWorld.pptx b/Examples/Data/Rendering-Printing/HelloWorld.pptx new file mode 100644 index 00000000..407c36ee Binary files /dev/null and b/Examples/Data/Rendering-Printing/HelloWorld.pptx differ diff --git a/Examples/Data/Rendering-Printing/Print.ppt b/Examples/Data/Rendering-Printing/Print.ppt new file mode 100644 index 00000000..41687ee9 Binary files /dev/null and b/Examples/Data/Rendering-Printing/Print.ppt differ diff --git a/Examples/Data/Rendering-Printing/RenderingOptions.pptx b/Examples/Data/Rendering-Printing/RenderingOptions.pptx new file mode 100644 index 00000000..988ceb53 Binary files /dev/null and b/Examples/Data/Rendering-Printing/RenderingOptions.pptx differ diff --git a/Examples/Data/Rendering-Printing/emoji.pdf b/Examples/Data/Rendering-Printing/emoji.pdf new file mode 100644 index 00000000..99d12346 Binary files /dev/null and b/Examples/Data/Rendering-Printing/emoji.pdf differ diff --git a/Examples/Data/Rendering-Printing/input.pptx b/Examples/Data/Rendering-Printing/input.pptx new file mode 100644 index 00000000..c6392a45 Binary files /dev/null and b/Examples/Data/Rendering-Printing/input.pptx differ diff --git a/Examples/Data/Rendering-Printing/presentation.pptx b/Examples/Data/Rendering-Printing/presentation.pptx new file mode 100644 index 00000000..c9d75d2d Binary files /dev/null and b/Examples/Data/Rendering-Printing/presentation.pptx differ diff --git a/Examples/Data/Rendering-Printing/testsignature1.pfx b/Examples/Data/Rendering-Printing/testsignature1.pfx new file mode 100644 index 00000000..b3822fad Binary files /dev/null and b/Examples/Data/Rendering-Printing/testsignature1.pfx differ diff --git a/Examples/Data/Shapes/AccessingOLEObjectFrame.pptx b/Examples/Data/Shapes/AccessingOLEObjectFrame.pptx new file mode 100644 index 00000000..d5da0b90 Binary files /dev/null and b/Examples/Data/Shapes/AccessingOLEObjectFrame.pptx differ diff --git a/Examples/Data/Shapes/AddAudioFrame.wav b/Examples/Data/Shapes/AddAudioFrame.wav new file mode 100644 index 00000000..00533cbe Binary files /dev/null and b/Examples/Data/Shapes/AddAudioFrame.wav differ diff --git a/Examples/Data/Shapes/AltText.pptx b/Examples/Data/Shapes/AltText.pptx new file mode 100644 index 00000000..31228a41 Binary files /dev/null and b/Examples/Data/Shapes/AltText.pptx differ diff --git a/Examples/Data/Shapes/AnimationShapesExample.pptx b/Examples/Data/Shapes/AnimationShapesExample.pptx new file mode 100644 index 00000000..3d4293db Binary files /dev/null and b/Examples/Data/Shapes/AnimationShapesExample.pptx differ diff --git a/Examples/Data/Shapes/BrightnessContrast.pptx b/Examples/Data/Shapes/BrightnessContrast.pptx new file mode 100644 index 00000000..1dd80b21 Binary files /dev/null and b/Examples/Data/Shapes/BrightnessContrast.pptx differ diff --git a/Examples/Data/Shapes/ChangeOLEObjectData.pptx b/Examples/Data/Shapes/ChangeOLEObjectData.pptx new file mode 100644 index 00000000..d5da0b90 Binary files /dev/null and b/Examples/Data/Shapes/ChangeOLEObjectData.pptx differ diff --git a/Examples/Data/Shapes/CheckTextShapes.pptx b/Examples/Data/Shapes/CheckTextShapes.pptx new file mode 100644 index 00000000..4032f387 Binary files /dev/null and b/Examples/Data/Shapes/CheckTextShapes.pptx differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/connectorlineangle/SamplePresLine.pptx b/Examples/Data/Shapes/ConnectorLineAngle.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Shapes/connectorlineangle/SamplePresLine.pptx rename to Examples/Data/Shapes/ConnectorLineAngle.pptx diff --git a/Examples/Data/Shapes/CroppedImage.pptx b/Examples/Data/Shapes/CroppedImage.pptx new file mode 100644 index 00000000..c943f179 Binary files /dev/null and b/Examples/Data/Shapes/CroppedImage.pptx differ diff --git a/Examples/Data/Shapes/Effect.png b/Examples/Data/Shapes/Effect.png new file mode 100644 index 00000000..13d6f174 Binary files /dev/null and b/Examples/Data/Shapes/Effect.png differ diff --git a/Examples/Data/Shapes/FindingShapeInSlide.pptx b/Examples/Data/Shapes/FindingShapeInSlide.pptx new file mode 100644 index 00000000..9e1b2b94 Binary files /dev/null and b/Examples/Data/Shapes/FindingShapeInSlide.pptx differ diff --git a/Examples/Data/Shapes/HelloWorld.pptx b/Examples/Data/Shapes/HelloWorld.pptx new file mode 100644 index 00000000..1b2263c7 Binary files /dev/null and b/Examples/Data/Shapes/HelloWorld.pptx differ diff --git a/Examples/Data/Shapes/Image.png b/Examples/Data/Shapes/Image.png new file mode 100644 index 00000000..3f9ea614 Binary files /dev/null and b/Examples/Data/Shapes/Image.png differ diff --git a/Examples/Data/Shapes/InkEffects.pptx b/Examples/Data/Shapes/InkEffects.pptx new file mode 100644 index 00000000..d5698203 Binary files /dev/null and b/Examples/Data/Shapes/InkEffects.pptx differ diff --git a/Examples/Data/Shapes/PresCameo.pptx b/Examples/Data/Shapes/PresCameo.pptx new file mode 100644 index 00000000..c5578a97 Binary files /dev/null and b/Examples/Data/Shapes/PresCameo.pptx differ diff --git a/Examples/Data/Shapes/Presentation1.pptx b/Examples/Data/Shapes/Presentation1.pptx new file mode 100644 index 00000000..28785129 Binary files /dev/null and b/Examples/Data/Shapes/Presentation1.pptx differ diff --git a/Examples/Data/Shapes/PresetGeometry.pptx b/Examples/Data/Shapes/PresetGeometry.pptx new file mode 100644 index 00000000..4793cff2 Binary files /dev/null and b/Examples/Data/Shapes/PresetGeometry.pptx differ diff --git a/Examples/Data/Shapes/SimpleInk.pptx b/Examples/Data/Shapes/SimpleInk.pptx new file mode 100644 index 00000000..0dce65f5 Binary files /dev/null and b/Examples/Data/Shapes/SimpleInk.pptx differ diff --git a/Examples/Data/Shapes/Source Frame.pptx b/Examples/Data/Shapes/Source Frame.pptx new file mode 100644 index 00000000..69e2f822 Binary files /dev/null and b/Examples/Data/Shapes/Source Frame.pptx differ diff --git a/Examples/Data/Shapes/TestOlePresentation.pptx b/Examples/Data/Shapes/TestOlePresentation.pptx new file mode 100644 index 00000000..263ecfcd Binary files /dev/null and b/Examples/Data/Shapes/TestOlePresentation.pptx differ diff --git a/Examples/Data/Shapes/Tulips.jpg b/Examples/Data/Shapes/Tulips.jpg new file mode 100644 index 00000000..d8651488 Binary files /dev/null and b/Examples/Data/Shapes/Tulips.jpg differ diff --git a/Examples/Data/Shapes/Wildlife.mp4 b/Examples/Data/Shapes/Wildlife.mp4 new file mode 100644 index 00000000..bd5a2a6e Binary files /dev/null and b/Examples/Data/Shapes/Wildlife.mp4 differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/fillshapespicture/aspose-logo.jpg b/Examples/Data/Shapes/aspose-logo.jpg similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Shapes/fillshapespicture/aspose-logo.jpg rename to Examples/Data/Shapes/aspose-logo.jpg diff --git a/Examples/Data/Shapes/book1.xlsx b/Examples/Data/Shapes/book1.xlsx new file mode 100644 index 00000000..9bc391fb Binary files /dev/null and b/Examples/Data/Shapes/book1.xlsx differ diff --git a/Examples/Data/Shapes/sampleaudio.wav b/Examples/Data/Shapes/sampleaudio.wav new file mode 100644 index 00000000..00533cbe Binary files /dev/null and b/Examples/Data/Shapes/sampleaudio.wav differ diff --git a/Examples/Data/Shapes/test.zip b/Examples/Data/Shapes/test.zip new file mode 100644 index 00000000..abf5938c Binary files /dev/null and b/Examples/Data/Shapes/test.zip differ diff --git a/Examples/Data/Slides/Background/SamplePresentation.pptx b/Examples/Data/Slides/Background/SamplePresentation.pptx new file mode 100644 index 00000000..060a3ddd Binary files /dev/null and b/Examples/Data/Slides/Background/SamplePresentation.pptx differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/accessmodifyproperties/Aspose.pptx b/Examples/Data/Slides/Background/SetBackgroundToGradient.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/accessmodifyproperties/Aspose.pptx rename to Examples/Data/Slides/Background/SetBackgroundToGradient.pptx diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/modifybuiltinproperties/Aspose.pptx b/Examples/Data/Slides/Background/SetImageAsBackground.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/modifybuiltinproperties/Aspose.pptx rename to Examples/Data/Slides/Background/SetImageAsBackground.pptx diff --git a/Examples/Data/Slides/Background/Tulips.jpg b/Examples/Data/Slides/Background/Tulips.jpg new file mode 100644 index 00000000..d8651488 Binary files /dev/null and b/Examples/Data/Slides/Background/Tulips.jpg differ diff --git a/Examples/Data/Slides/CRUD/AccessSlides.pptx b/Examples/Data/Slides/CRUD/AccessSlides.pptx new file mode 100644 index 00000000..af4e4aad Binary files /dev/null and b/Examples/Data/Slides/CRUD/AccessSlides.pptx differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/OpenpPresentation/openpresentation/Aspose.pptx b/Examples/Data/Slides/CRUD/ChangePosition.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/OpenpPresentation/openpresentation/Aspose.pptx rename to Examples/Data/Slides/CRUD/ChangePosition.pptx diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/PresentationToTIFF/customsize/Aspose.pptx b/Examples/Data/Slides/CRUD/CloneAtEndOfAnother.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/PresentationToTIFF/customsize/Aspose.pptx rename to Examples/Data/Slides/CRUD/CloneAtEndOfAnother.pptx diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/PresentationToTIFF/defaultsize/Aspose.pptx b/Examples/Data/Slides/CRUD/CloneAtEndOfAnotherSpecificPosition.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/PresentationToTIFF/defaultsize/Aspose.pptx rename to Examples/Data/Slides/CRUD/CloneAtEndOfAnotherSpecificPosition.pptx diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/PresentationToXPS/wiithxpsoptions/Aspose.pptx b/Examples/Data/Slides/CRUD/CloneToAnotherPresentationWithMaster.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/PresentationToXPS/wiithxpsoptions/Aspose.pptx rename to Examples/Data/Slides/CRUD/CloneToAnotherPresentationWithMaster.pptx diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/PresentationToXPS/withoutxpsoptions/Aspose.pptx b/Examples/Data/Slides/CRUD/CloneWithInSamePresentation.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/PresentationToXPS/withoutxpsoptions/Aspose.pptx rename to Examples/Data/Slides/CRUD/CloneWithInSamePresentation.pptx diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/presentationtohtml/Aspose.pptx b/Examples/Data/Slides/CRUD/CloneWithinSamePresentationToEnd.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Presentation/presentationtohtml/Aspose.pptx rename to Examples/Data/Slides/CRUD/CloneWithinSamePresentationToEnd.pptx diff --git a/Examples/Data/Slides/CRUD/CreateSlidesSVGImage.pptx b/Examples/Data/Slides/CRUD/CreateSlidesSVGImage.pptx new file mode 100644 index 00000000..3f94c27e Binary files /dev/null and b/Examples/Data/Slides/CRUD/CreateSlidesSVGImage.pptx differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/CreateSlidesThumbnailImage/generatethumbnailfromslideinnotes/Aspose.pptx b/Examples/Data/Slides/CRUD/RemoveSlideUsingIndex.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Slides/CreateSlidesThumbnailImage/generatethumbnailfromslideinnotes/Aspose.pptx rename to Examples/Data/Slides/CRUD/RemoveSlideUsingIndex.pptx diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/CreateSlidesThumbnailImage/generatethumbnailfromslidewithuserdefineddimensions/demo.pptx b/Examples/Data/Slides/CRUD/RemoveSlideUsingReference.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Slides/CreateSlidesThumbnailImage/generatethumbnailfromslidewithuserdefineddimensions/demo.pptx rename to Examples/Data/Slides/CRUD/RemoveSlideUsingReference.pptx diff --git a/Examples/Data/Slides/Comments/Comments1.pptx b/Examples/Data/Slides/Comments/Comments1.pptx new file mode 100644 index 00000000..a02e605a Binary files /dev/null and b/Examples/Data/Slides/Comments/Comments1.pptx differ diff --git a/Examples/Data/Slides/Hyperlink/ExternalUrlOriginal.pptx b/Examples/Data/Slides/Hyperlink/ExternalUrlOriginal.pptx new file mode 100644 index 00000000..d6fb54a4 Binary files /dev/null and b/Examples/Data/Slides/Hyperlink/ExternalUrlOriginal.pptx differ diff --git a/Examples/Data/Slides/Hyperlink/Hyperlink.pptx b/Examples/Data/Slides/Hyperlink/Hyperlink.pptx new file mode 100644 index 00000000..9eb76fa3 Binary files /dev/null and b/Examples/Data/Slides/Hyperlink/Hyperlink.pptx differ diff --git a/Examples/Data/Slides/Layout/AccessSlides.pptx b/Examples/Data/Slides/Layout/AccessSlides.pptx new file mode 100644 index 00000000..af4e4aad Binary files /dev/null and b/Examples/Data/Slides/Layout/AccessSlides.pptx differ diff --git a/Examples/Data/Slides/Layout/HelloWorld.pptx b/Examples/Data/Slides/Layout/HelloWorld.pptx new file mode 100644 index 00000000..407c36ee Binary files /dev/null and b/Examples/Data/Slides/Layout/HelloWorld.pptx differ diff --git a/Examples/Data/Slides/Layout/placeholder.pptx b/Examples/Data/Slides/Layout/placeholder.pptx new file mode 100644 index 00000000..248ed127 Binary files /dev/null and b/Examples/Data/Slides/Layout/placeholder.pptx differ diff --git a/Examples/Data/Slides/Layout/presentation.ppt b/Examples/Data/Slides/Layout/presentation.ppt new file mode 100644 index 00000000..ba947fa3 Binary files /dev/null and b/Examples/Data/Slides/Layout/presentation.ppt differ diff --git a/Examples/Data/Slides/Layout/presentation.pptx b/Examples/Data/Slides/Layout/presentation.pptx new file mode 100644 index 00000000..d14e5659 Binary files /dev/null and b/Examples/Data/Slides/Layout/presentation.pptx differ diff --git a/Examples/Data/Slides/Media/AnimationAudio.pptx b/Examples/Data/Slides/Media/AnimationAudio.pptx new file mode 100644 index 00000000..164961f5 Binary files /dev/null and b/Examples/Data/Slides/Media/AnimationAudio.pptx differ diff --git a/Examples/Data/Slides/Media/AnimationStopSound.pptx b/Examples/Data/Slides/Media/AnimationStopSound.pptx new file mode 100644 index 00000000..c2f43eda Binary files /dev/null and b/Examples/Data/Slides/Media/AnimationStopSound.pptx differ diff --git a/Examples/Data/Slides/Media/AudioSlide.ppt b/Examples/Data/Slides/Media/AudioSlide.ppt new file mode 100644 index 00000000..0fd217e4 Binary files /dev/null and b/Examples/Data/Slides/Media/AudioSlide.ppt differ diff --git a/Examples/Data/Slides/Media/HyperlinkSound.pptx b/Examples/Data/Slides/Media/HyperlinkSound.pptx new file mode 100644 index 00000000..53605222 Binary files /dev/null and b/Examples/Data/Slides/Media/HyperlinkSound.pptx differ diff --git a/Examples/Data/Slides/Media/TransitionTest.pptx b/Examples/Data/Slides/Media/TransitionTest.pptx new file mode 100644 index 00000000..e00f424b Binary files /dev/null and b/Examples/Data/Slides/Media/TransitionTest.pptx differ diff --git a/Examples/Data/Slides/Media/Video.pptx b/Examples/Data/Slides/Media/Video.pptx new file mode 100644 index 00000000..687dfb7c Binary files /dev/null and b/Examples/Data/Slides/Media/Video.pptx differ diff --git a/Examples/Data/Slides/Media/audio.m4a b/Examples/Data/Slides/Media/audio.m4a new file mode 100644 index 00000000..0b955977 Binary files /dev/null and b/Examples/Data/Slides/Media/audio.m4a differ diff --git a/Examples/Data/Slides/Media/audio.mp3 b/Examples/Data/Slides/Media/audio.mp3 new file mode 100644 index 00000000..8de2fbe1 Binary files /dev/null and b/Examples/Data/Slides/Media/audio.mp3 differ diff --git a/Examples/Data/Slides/Media/bunny.vtt b/Examples/Data/Slides/Media/bunny.vtt new file mode 100644 index 00000000..b8c853cd --- /dev/null +++ b/Examples/Data/Slides/Media/bunny.vtt @@ -0,0 +1,14 @@ +WEBVTT + +00:00:00.000 --> 00:00:06.004 +Big bunny video from youtube. Bunny is coming out ot its cave and yawning, looking here and there. + +00:00:06.004 --> 00:00:09.318 +Started walking in search of food. + +00:00:09.318 --> 00:00:13.009 +Clean sky... bunny came and standing + +00:00:13.009 --> 00:00:16.104 +Looking around and found something...... + diff --git a/Examples/Data/Slides/Media/sample_bunny.mp4 b/Examples/Data/Slides/Media/sample_bunny.mp4 new file mode 100644 index 00000000..c37f31e8 Binary files /dev/null and b/Examples/Data/Slides/Media/sample_bunny.mp4 differ diff --git a/Examples/Data/Slides/Notes/AccessSlides.pptx b/Examples/Data/Slides/Notes/AccessSlides.pptx new file mode 100644 index 00000000..af4e4aad Binary files /dev/null and b/Examples/Data/Slides/Notes/AccessSlides.pptx differ diff --git a/Examples/Data/Slides/Notes/presentation.pptx b/Examples/Data/Slides/Notes/presentation.pptx new file mode 100644 index 00000000..d14e5659 Binary files /dev/null and b/Examples/Data/Slides/Notes/presentation.pptx differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/accessslides/Aspose.pptx b/Examples/Data/Slides/Thumbnail/ThumbnailFromSlide.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Slides/accessslides/Aspose.pptx rename to Examples/Data/Slides/Thumbnail/ThumbnailFromSlide.pptx diff --git a/Examples/Data/Slides/Thumbnail/ThumbnailFromSlideInNotes.pptx b/Examples/Data/Slides/Thumbnail/ThumbnailFromSlideInNotes.pptx new file mode 100644 index 00000000..ec96f02f Binary files /dev/null and b/Examples/Data/Slides/Thumbnail/ThumbnailFromSlideInNotes.pptx differ diff --git a/Examples/Data/Slides/Thumbnail/ThumbnailWithUserDefinedDimensions.pptx b/Examples/Data/Slides/Thumbnail/ThumbnailWithUserDefinedDimensions.pptx new file mode 100644 index 00000000..d63dc027 Binary files /dev/null and b/Examples/Data/Slides/Thumbnail/ThumbnailWithUserDefinedDimensions.pptx differ diff --git a/Examples/Data/Slides/Transitions/AccessSlides.pptx b/Examples/Data/Slides/Transitions/AccessSlides.pptx new file mode 100644 index 00000000..af4e4aad Binary files /dev/null and b/Examples/Data/Slides/Transitions/AccessSlides.pptx differ diff --git a/Examples/Data/Slides/Transitions/AnimationAfterEffect.pptx b/Examples/Data/Slides/Transitions/AnimationAfterEffect.pptx new file mode 100644 index 00000000..496a1fd1 Binary files /dev/null and b/Examples/Data/Slides/Transitions/AnimationAfterEffect.pptx differ diff --git a/Examples/Data/Slides/Transitions/AnimationDurationSlides.pptx b/Examples/Data/Slides/Transitions/AnimationDurationSlides.pptx new file mode 100644 index 00000000..cc7392da Binary files /dev/null and b/Examples/Data/Slides/Transitions/AnimationDurationSlides.pptx differ diff --git a/Examples/Data/Slides/Transitions/AnimationOnSlide.pptx b/Examples/Data/Slides/Transitions/AnimationOnSlide.pptx new file mode 100644 index 00000000..fccf6f40 Binary files /dev/null and b/Examples/Data/Slides/Transitions/AnimationOnSlide.pptx differ diff --git a/Examples/Data/Slides/Transitions/AnimationRewind.pptx b/Examples/Data/Slides/Transitions/AnimationRewind.pptx new file mode 100644 index 00000000..2f9fdf85 Binary files /dev/null and b/Examples/Data/Slides/Transitions/AnimationRewind.pptx differ diff --git a/Examples/Data/Slides/Transitions/BetterSlideTransitions.pptx b/Examples/Data/Slides/Transitions/BetterSlideTransitions.pptx new file mode 100644 index 00000000..94a71576 Binary files /dev/null and b/Examples/Data/Slides/Transitions/BetterSlideTransitions.pptx differ diff --git a/Examples/Data/Slides/Transitions/SimpleSlideTransitions.pptx b/Examples/Data/Slides/Transitions/SimpleSlideTransitions.pptx new file mode 100644 index 00000000..1d2f315a Binary files /dev/null and b/Examples/Data/Slides/Transitions/SimpleSlideTransitions.pptx differ diff --git a/Examples/Data/Slides/Views/GradientStyleExample.pptx b/Examples/Data/Slides/Views/GradientStyleExample.pptx new file mode 100644 index 00000000..4d24d609 Binary files /dev/null and b/Examples/Data/Slides/Views/GradientStyleExample.pptx differ diff --git a/Examples/Data/Slides/Views/presentation_normal_view_state.pptx b/Examples/Data/Slides/Views/presentation_normal_view_state.pptx new file mode 100644 index 00000000..729d8276 Binary files /dev/null and b/Examples/Data/Slides/Views/presentation_normal_view_state.pptx differ diff --git a/Examples/Data/SmartArts/AccessChildNodes.pptx b/Examples/Data/SmartArts/AccessChildNodes.pptx new file mode 100644 index 00000000..a53a2dff Binary files /dev/null and b/Examples/Data/SmartArts/AccessChildNodes.pptx differ diff --git a/Examples/Data/SmartArts/AccessSmartArt.pptx b/Examples/Data/SmartArts/AccessSmartArt.pptx new file mode 100644 index 00000000..a53a2dff Binary files /dev/null and b/Examples/Data/SmartArts/AccessSmartArt.pptx differ diff --git a/Examples/Data/SmartArts/AccessSmartArtShape.pptx b/Examples/Data/SmartArts/AccessSmartArtShape.pptx new file mode 100644 index 00000000..a53a2dff Binary files /dev/null and b/Examples/Data/SmartArts/AccessSmartArtShape.pptx differ diff --git a/Examples/Data/SmartArts/AddNodes.pptx b/Examples/Data/SmartArts/AddNodes.pptx new file mode 100644 index 00000000..a53a2dff Binary files /dev/null and b/Examples/Data/SmartArts/AddNodes.pptx differ diff --git a/Examples/Data/SmartArts/AssistantNode.pptx b/Examples/Data/SmartArts/AssistantNode.pptx new file mode 100644 index 00000000..a53a2dff Binary files /dev/null and b/Examples/Data/SmartArts/AssistantNode.pptx differ diff --git a/Examples/Data/SmartArts/CreatingSmartArtShape.pptx b/Examples/Data/SmartArts/CreatingSmartArtShape.pptx new file mode 100644 index 00000000..a53a2dff Binary files /dev/null and b/Examples/Data/SmartArts/CreatingSmartArtShape.pptx differ diff --git a/Examples/Data/SmartArts/Presentation1.pptx b/Examples/Data/SmartArts/Presentation1.pptx new file mode 100644 index 00000000..28785129 Binary files /dev/null and b/Examples/Data/SmartArts/Presentation1.pptx differ diff --git a/Examples/Data/SmartArts/RemoveNode.pptx b/Examples/Data/SmartArts/RemoveNode.pptx new file mode 100644 index 00000000..a53a2dff Binary files /dev/null and b/Examples/Data/SmartArts/RemoveNode.pptx differ diff --git a/Examples/Data/SmartArts/RemoveNodeSpecificPosition.pptx b/Examples/Data/SmartArts/RemoveNodeSpecificPosition.pptx new file mode 100644 index 00000000..a53a2dff Binary files /dev/null and b/Examples/Data/SmartArts/RemoveNodeSpecificPosition.pptx differ diff --git a/Examples/Data/SmartArts/SmartArtNodeLevel.pptx b/Examples/Data/SmartArts/SmartArtNodeLevel.pptx new file mode 100644 index 00000000..a53a2dff Binary files /dev/null and b/Examples/Data/SmartArts/SmartArtNodeLevel.pptx differ diff --git a/Examples/Data/SmartArts/aspose-logo.jpg b/Examples/Data/SmartArts/aspose-logo.jpg new file mode 100644 index 00000000..34575641 Binary files /dev/null and b/Examples/Data/SmartArts/aspose-logo.jpg differ diff --git a/Examples/Data/Tables/RemovingRowColumn.pptx b/Examples/Data/Tables/RemovingRowColumn.pptx new file mode 100644 index 00000000..a7fdb328 Binary files /dev/null and b/Examples/Data/Tables/RemovingRowColumn.pptx differ diff --git a/Examples/Data/Tables/SomePresentationWithTable.pptx b/Examples/Data/Tables/SomePresentationWithTable.pptx new file mode 100644 index 00000000..5b481581 Binary files /dev/null and b/Examples/Data/Tables/SomePresentationWithTable.pptx differ diff --git a/Examples/Data/Tables/TableTransparency.pptx b/Examples/Data/Tables/TableTransparency.pptx new file mode 100644 index 00000000..a06e60bb Binary files /dev/null and b/Examples/Data/Tables/TableTransparency.pptx differ diff --git a/Examples/Data/Tables/UpdateExistingTable.pptx b/Examples/Data/Tables/UpdateExistingTable.pptx new file mode 100644 index 00000000..6583dd40 Binary files /dev/null and b/Examples/Data/Tables/UpdateExistingTable.pptx differ diff --git a/Examples/Data/Tables/aspose-logo.jpg b/Examples/Data/Tables/aspose-logo.jpg new file mode 100644 index 00000000..34575641 Binary files /dev/null and b/Examples/Data/Tables/aspose-logo.jpg differ diff --git a/Examples/Data/Tables/pres-out.pptx b/Examples/Data/Tables/pres-out.pptx new file mode 100644 index 00000000..7894bc95 Binary files /dev/null and b/Examples/Data/Tables/pres-out.pptx differ diff --git a/Examples/Data/Tables/pres.pptx b/Examples/Data/Tables/pres.pptx new file mode 100644 index 00000000..5b481581 Binary files /dev/null and b/Examples/Data/Tables/pres.pptx differ diff --git a/Examples/Data/Tables/presentation.pptx b/Examples/Data/Tables/presentation.pptx new file mode 100644 index 00000000..d14e5659 Binary files /dev/null and b/Examples/Data/Tables/presentation.pptx differ diff --git a/Examples/Data/Tables/table.pptx b/Examples/Data/Tables/table.pptx new file mode 100644 index 00000000..291b0182 Binary files /dev/null and b/Examples/Data/Tables/table.pptx differ diff --git a/Examples/Data/Tables/table1_out.pptx b/Examples/Data/Tables/table1_out.pptx new file mode 100644 index 00000000..2fb6b7f8 Binary files /dev/null and b/Examples/Data/Tables/table1_out.pptx differ diff --git a/Examples/Data/Text/BulletData.pptx b/Examples/Data/Text/BulletData.pptx new file mode 100644 index 00000000..a5e87a3f Binary files /dev/null and b/Examples/Data/Text/BulletData.pptx differ diff --git a/Examples/Data/Text/CustomFonts.ttf b/Examples/Data/Text/CustomFonts.ttf new file mode 100644 index 00000000..59b6d16b Binary files /dev/null and b/Examples/Data/Text/CustomFonts.ttf differ diff --git a/Examples/Data/Text/DefaultFonts.pptx b/Examples/Data/Text/DefaultFonts.pptx new file mode 100644 index 00000000..f075a2e8 Binary files /dev/null and b/Examples/Data/Text/DefaultFonts.pptx differ diff --git a/Examples/Data/Text/EmbeddedFonts.pptx b/Examples/Data/Text/EmbeddedFonts.pptx new file mode 100644 index 00000000..7bef6df0 Binary files /dev/null and b/Examples/Data/Text/EmbeddedFonts.pptx differ diff --git a/Examples/Data/Text/ExportingHTMLText.pptx b/Examples/Data/Text/ExportingHTMLText.pptx new file mode 100644 index 00000000..a6b279c6 Binary files /dev/null and b/Examples/Data/Text/ExportingHTMLText.pptx differ diff --git a/Examples/Data/Text/FontProperties.pptx b/Examples/Data/Text/FontProperties.pptx new file mode 100644 index 00000000..f075a2e8 Binary files /dev/null and b/Examples/Data/Text/FontProperties.pptx differ diff --git a/Examples/Data/Text/Fonts.pptx b/Examples/Data/Text/Fonts.pptx new file mode 100644 index 00000000..2d9d449d Binary files /dev/null and b/Examples/Data/Text/Fonts.pptx differ diff --git a/Examples/Data/Text/KeepTextFlat.pptx b/Examples/Data/Text/KeepTextFlat.pptx new file mode 100644 index 00000000..5351d53c Binary files /dev/null and b/Examples/Data/Text/KeepTextFlat.pptx differ diff --git a/Examples/Data/Text/MultiColumnText.pptx b/Examples/Data/Text/MultiColumnText.pptx new file mode 100644 index 00000000..739abccf Binary files /dev/null and b/Examples/Data/Text/MultiColumnText.pptx differ diff --git a/Examples/Data/Text/ParagraphsAlignment.pptx b/Examples/Data/Text/ParagraphsAlignment.pptx new file mode 100644 index 00000000..f09f925c Binary files /dev/null and b/Examples/Data/Text/ParagraphsAlignment.pptx differ diff --git a/Examples/Data/Text/PresFontsSubst.pptx b/Examples/Data/Text/PresFontsSubst.pptx new file mode 100644 index 00000000..25df2097 Binary files /dev/null and b/Examples/Data/Text/PresFontsSubst.pptx differ diff --git a/Examples/Data/Text/Presentation.pptx b/Examples/Data/Text/Presentation.pptx new file mode 100644 index 00000000..7eb24652 Binary files /dev/null and b/Examples/Data/Text/Presentation.pptx differ diff --git a/Examples/Data/Text/Presentation1.pptx b/Examples/Data/Text/Presentation1.pptx new file mode 100644 index 00000000..28785129 Binary files /dev/null and b/Examples/Data/Text/Presentation1.pptx differ diff --git a/Examples/Data/Text/Presentation2.pptx b/Examples/Data/Text/Presentation2.pptx new file mode 100644 index 00000000..fcdede27 Binary files /dev/null and b/Examples/Data/Text/Presentation2.pptx differ diff --git a/Examples/Data/Text/PresentationText.pptx b/Examples/Data/Text/PresentationText.pptx new file mode 100644 index 00000000..c2a058df Binary files /dev/null and b/Examples/Data/Text/PresentationText.pptx differ diff --git a/Examples/Data/Text/ReplacingText.pptx b/Examples/Data/Text/ReplacingText.pptx new file mode 100644 index 00000000..f075a2e8 Binary files /dev/null and b/Examples/Data/Text/ReplacingText.pptx differ diff --git a/Examples/Data/Text/SomePresentation.pptx b/Examples/Data/Text/SomePresentation.pptx new file mode 100644 index 00000000..f075a2e8 Binary files /dev/null and b/Examples/Data/Text/SomePresentation.pptx differ diff --git a/Examples/Data/Text/TextLigatures.pptx b/Examples/Data/Text/TextLigatures.pptx new file mode 100644 index 00000000..7317fb96 Binary files /dev/null and b/Examples/Data/Text/TextLigatures.pptx differ diff --git a/Examples/Data/Text/TextOptionsExample.pptx b/Examples/Data/Text/TextOptionsExample.pptx new file mode 100644 index 00000000..0f232f75 Binary files /dev/null and b/Examples/Data/Text/TextOptionsExample.pptx differ diff --git a/Examples/Data/Text/TextReplaceExample.pptx b/Examples/Data/Text/TextReplaceExample.pptx new file mode 100644 index 00000000..cb23a478 Binary files /dev/null and b/Examples/Data/Text/TextReplaceExample.pptx differ diff --git a/Examples/Data/Text/bullets.png b/Examples/Data/Text/bullets.png new file mode 100644 index 00000000..16c2575c Binary files /dev/null and b/Examples/Data/Text/bullets.png differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/importhtmltext/html from pp2010 clipboard.html b/Examples/Data/Text/file.html similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/importhtmltext/html from pp2010 clipboard.html rename to Examples/Data/Text/file.html diff --git a/Examples/Data/Text/input.pptx b/Examples/Data/Text/input.pptx new file mode 100644 index 00000000..c6392a45 Binary files /dev/null and b/Examples/Data/Text/input.pptx differ diff --git a/Examples/Data/Text/presWithEmbeddedFonts.pptx b/Examples/Data/Text/presWithEmbeddedFonts.pptx new file mode 100644 index 00000000..71a472d6 Binary files /dev/null and b/Examples/Data/Text/presWithEmbeddedFonts.pptx differ diff --git a/Examples/Data/Text/transparency.pptx b/Examples/Data/Text/transparency.pptx new file mode 100644 index 00000000..024c5697 Binary files /dev/null and b/Examples/Data/Text/transparency.pptx differ diff --git a/Examples/Data/VBA/VBA.pptm b/Examples/Data/VBA/VBA.pptm new file mode 100644 index 00000000..0d80d8c4 Binary files /dev/null and b/Examples/Data/VBA/VBA.pptm differ diff --git a/Examples/Data/Video/Wildlife.mp4 b/Examples/Data/Video/Wildlife.mp4 new file mode 100644 index 00000000..bd5a2a6e Binary files /dev/null and b/Examples/Data/Video/Wildlife.mp4 differ diff --git a/Examples/README.md b/Examples/README.md index 20265bd4..2b66e693 100644 --- a/Examples/README.md +++ b/Examples/README.md @@ -1,13 +1,13 @@ -##Aspose.Slides for Java Examples +## Aspose.Slides for Java Examples -This package contains Java Example Project for [Aspose.Slides for Java](http://www.aspose.com/java/powerpoint-component.aspx). +This package contains Java Example Project for [Aspose.Slides for Java](https://products.aspose.com/slides/java).

- +

## How to Run the Examples? -All the examples are arranged in src folder and any modern IDE like IntelliJ IDEA, Eclipse, Netbeans etc can import the source folder easily. Visit our [documentation website](http://www.aspose.com/docs/display/slidesjava/How+to+Run+the+Examples) for more details. +All the examples are arranged in src folder and any modern IDE like IntelliJ IDEA, Eclipse, Netbeans etc can import the source folder easily. Visit our [documentation website](https://docs.aspose.com/display/slidesjava/How+to+Run+the+Examples) for more details. diff --git a/Examples/demoPass.pptx b/Examples/demoPass.pptx deleted file mode 100644 index 5d1cf779..00000000 Binary files a/Examples/demoPass.pptx and /dev/null differ diff --git a/Examples/pom.xml b/Examples/pom.xml index 81019705..15415ee6 100644 --- a/Examples/pom.xml +++ b/Examples/pom.xml @@ -9,28 +9,36 @@ 1.7 1.7 + + + AsposeJavaAPI + Aspose Java API + https://releases.aspose.com/java/repo/ + + + com.springsource.repository.bundles.external + SpringSource Enterprise Bundle Repository - External Bundle Releases + https://repository.springsource.com/maven/bundles/external + + + + com.aspose + aspose-cells + 25.10 + jar + com.aspose aspose-slides - 15.5.0 + 25.11 jdk16 - javax.media.jai - com.springsource.javax.media.jai.core - 1.1.3 + com.aspose + aspose-slides + 25.11 + javadoc - - - aspose-maven-repository - http://maven.aspose.com/repository/repo/ - - - com.springsource.repository.bundles.external - SpringSource Enterprise Bundle Repository - External Bundle Releases - http://repository.springsource.com/maven/bundles/external - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Charts/ChartEntities.java b/Examples/src/main/java/com/aspose/slides/examples/Charts/ChartEntities.java deleted file mode 100644 index cd419444..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Charts/ChartEntities.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Charts; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class ChartEntities -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ChartEntities.class); - //Instantiating Presentation1//Instantiating Presentation1 - Presentation pres = new Presentation(); - - //Accessing the first slide - ISlide slide = pres.getSlides().get_Item(0); - - //Adding the sample chart - IChart chart = slide.getShapes().addChart(ChartType.LineWithMarkers, 50, 50, 500, 400); - - //Setting Chart Titile - chart.hasTitle(true); - chart.getChartTitle().addTextFrameForOverriding(""); - IPortion chartTitle = chart.getChartTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0); - chartTitle.setText("Sample Chart"); - chartTitle.getPortionFormat().getFillFormat().setFillType(FillType.Solid); - chartTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.GRAY); - chartTitle.getPortionFormat().setFontHeight (20); - chartTitle.getPortionFormat().setFontBold(NullableBool.True); - chartTitle.getPortionFormat().setFontItalic(NullableBool.True); - - //Setting Major grid lines format for value axis - chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.Solid); - chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.BLUE); - chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setWidth(5); - chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setDashStyle(LineDashStyle.DashDot); - - //Setting Minor grid lines format for value axis - chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.Solid); - chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.RED); - chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().setWidth(3); - - //Setting value axis number format - chart.getAxes().getVerticalAxis().isNumberFormatLinkedToSource(false); - chart.getAxes().getVerticalAxis().setDisplayUnit(DisplayUnitType.Thousands); - chart.getAxes().getVerticalAxis().setNumberFormat("0.0%"); - - //Setting chart maximum, minimum values - chart.getAxes().getVerticalAxis().isAutomaticMajorUnit(false); - chart.getAxes().getVerticalAxis().isAutomaticMaxValue(false); - chart.getAxes().getVerticalAxis().isAutomaticMinorUnit(false); - chart.getAxes().getVerticalAxis().isAutomaticMinValue(false); - - chart.getAxes().getVerticalAxis().setMaxValue(15f); - chart.getAxes().getVerticalAxis().setMinValue(-2f); - chart.getAxes().getVerticalAxis().setMinorUnit(0.5f); - chart.getAxes().getVerticalAxis().setMajorUnit(2.0f); - - //Setting Value Axis Text Properties - IChartPortionFormat txtVal = chart.getAxes().getVerticalAxis().getTextFormat().getPortionFormat(); - txtVal.setFontBold(NullableBool.True); - txtVal.setFontHeight(16); - txtVal.setFontItalic(NullableBool.True); - txtVal.getFillFormat().setFillType(FillType.Solid); - txtVal.getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.DarkGreen)); - txtVal.setLatinFont(new FontData("Times New Roman")); - - //Setting value axis title - chart.getAxes().getVerticalAxis().hasTitle(true); - chart.getAxes().getVerticalAxis().getTitle().addTextFrameForOverriding(""); - IPortion valtitle = chart.getAxes().getVerticalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0); - valtitle.setText("Primary Axis"); - valtitle.getPortionFormat().getFillFormat().setFillType(FillType.Solid); - valtitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.GRAY); - valtitle.getPortionFormat().setFontHeight(20); - valtitle.getPortionFormat().setFontBold(NullableBool.True); - valtitle.getPortionFormat().setFontItalic(NullableBool.True); - - //Setting Major grid lines format for Category axis - chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.Solid); - chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.GREEN); - chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().setWidth(5); - - //Setting Minor grid lines format for Category axis - chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.Solid); - chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.YELLOW); - chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().setWidth(3); - - //Setting Category Axis Text Properties - IChartPortionFormat txtCat = chart.getAxes().getHorizontalAxis().getTextFormat().getPortionFormat(); - txtCat.setFontBold(NullableBool.True); - txtCat.setFontHeight(16); - txtCat.setFontItalic(NullableBool.True); - txtCat.getFillFormat().setFillType(FillType.Solid) ; - txtCat.getFillFormat().getSolidFillColor().setColor(Color.BLUE); - txtCat.setLatinFont(new FontData("Arial")); - - //Setting Category Title - chart.getAxes().getHorizontalAxis().hasTitle(true); - chart.getAxes().getHorizontalAxis().getTitle().addTextFrameForOverriding(""); - - IPortion catTitle = chart.getAxes().getHorizontalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0); - catTitle.setText("Sample Category"); - catTitle.getPortionFormat().getFillFormat().setFillType(FillType.Solid); - catTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.GRAY); - catTitle.getPortionFormat().setFontHeight(20); - catTitle.getPortionFormat().setFontBold(NullableBool.True); - catTitle.getPortionFormat().setFontItalic(NullableBool.True); - - //Setting category axis label position - chart.getAxes().getHorizontalAxis().setTickLabelPosition(TickLabelPositionType.Low); - - //Setting category axis label rotation angle - chart.getAxes().getHorizontalAxis().setTickLabelRotationAngle(45); - - //Setting Legends Text Properties - IChartPortionFormat txtleg = chart.getLegend().getTextFormat().getPortionFormat(); - txtleg.setFontBold(NullableBool.True); - txtleg.setFontHeight(16); - txtleg.setFontItalic(NullableBool.True); - txtleg.getFillFormat().setFillType(FillType.Solid); - txtleg.getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.DarkRed)); - - //Set show chart legends without overlapping chart - - chart.getLegend().setOverlay(true); - //chart.ChartData.Series[0].PlotOnSecondAxis=true; - - chart.getChartData().getSeries().get_Item(0).setPlotOnSecondAxis(true); - //Setting secondary value axis - chart.getAxes().getSecondaryVerticalAxis().isVisible(true); - chart.getAxes().getSecondaryVerticalAxis().getFormat().getLine().setStyle(LineStyle.ThickBetweenThin); - chart.getAxes().getSecondaryVerticalAxis().getFormat().getLine().setWidth(20); - - //Setting secondary value axis Number format - chart.getAxes().getSecondaryVerticalAxis().isNumberFormatLinkedToSource(false); - chart.getAxes().getSecondaryVerticalAxis().setDisplayUnit(DisplayUnitType.Hundreds); - chart.getAxes().getSecondaryVerticalAxis().setNumberFormat ("0.0%"); - - //Setting chart maximum, minimum values - chart.getAxes().getSecondaryVerticalAxis().isAutomaticMajorUnit(false); - chart.getAxes().getSecondaryVerticalAxis().isAutomaticMaxValue(false); - chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinorUnit(false); - chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinValue(false); - - chart.getAxes().getSecondaryVerticalAxis().setMaxValue(20f); - chart.getAxes().getSecondaryVerticalAxis().setMinValue(-5f); - chart.getAxes().getSecondaryVerticalAxis().setMinorUnit(0.5f); - chart.getAxes().getSecondaryVerticalAxis().setMajorUnit(2.0f); - - - //Setting chart back wall color - chart.getBackWall().setThickness(1); - chart.getBackWall().getFormat().getFill().setFillType(FillType.Solid); - chart.getBackWall().getFormat().getFill().getSolidFillColor().setColor(Color.ORANGE); - - chart.getFloor().getFormat().getFill().setFillType(FillType.Solid); - chart.getFloor().getFormat().getFill().getSolidFillColor().setColor(Color.RED); - //Setting Plot area color - chart.getPlotArea().getFormat().getFill().setFillType(FillType.Solid); - chart.getPlotArea().getFormat().getFill().getSolidFillColor().setColor(new Color(PresetColor.LightCyan)); - - //Save Presentation - pres.save(dataDir+ "FormattedChart.pptx", SaveFormat.Pptx); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Charts/ChartFromScratch/NormalCharts.java b/Examples/src/main/java/com/aspose/slides/examples/Charts/ChartFromScratch/NormalCharts.java deleted file mode 100644 index e53a7689..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Charts/ChartFromScratch/NormalCharts.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Charts.ChartFromScratch; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class NormalCharts -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(NormalCharts.class); - - //Instantiate Presentation class that represents PPTX file//Instantiate Presentation class that represents PPTX file - Presentation pres = new Presentation(); - - //Access first slide - ISlide sld = pres.getSlides().get_Item(0); - - // Add chart with default data - IChart chart = sld.getShapes().addChart(ChartType.ClusteredColumn, 0, 0, 500, 500); - - //Setting chart Title - //chart.ChartTitle.TextFrameForOverriding.Text = "Sample Title"; - chart.getChartTitle().addTextFrameForOverriding("Sample Title"); - chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(NullableBool.True); - chart.getChartTitle().setHeight (20); - chart.hasTitle(true); - - //Set first series to Show Values - chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue( true); - - //Setting the index of chart data sheet - int defaultWorksheetIndex = 0; - - //Getting the chart data worksheet - IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); - - //Delete default generated series and categories - chart.getChartData().getSeries().clear(); - chart.getChartData().getCategories().clear(); - int s = chart.getChartData().getSeries().size(); - s = chart.getChartData().getCategories().size(); - - //Adding new series - chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 1, "Series 1"), chart.getType()); - chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 2, "Series 2"), chart.getType()); - - //Adding new categories - chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "Caetegoty 1")); - chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 2, 0, "Caetegoty 2")); - chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 3, 0, "Caetegoty 3")); - - //Take first chart series - IChartSeries series = chart.getChartData().getSeries().get_Item(0); - - //Now populating series data - - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)); - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)); - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)); - - //Setting fill color for series - series.getFormat().getFill().setFillType(FillType.Solid); - series.getFormat().getFill().getSolidFillColor().setColor (Color.RED); - - - //Take second chart series - series = chart.getChartData().getSeries().get_Item(1); - - //Now populating series data - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 2, 30)); - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 2, 10)); - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 2, 60)); - - //Setting fill color for series - series.getFormat().getFill().setFillType (FillType.Solid); - series.getFormat().getFill().getSolidFillColor().setColor(Color.GREEN); - - //create custom labels for each of categories for new series - //first label will be show Category name - IDataLabel lbl = series.getDataPoints().get_Item(0).getLabel(); - lbl.getDataLabelFormat().setShowCategoryName(true); - - lbl = series.getDataPoints().get_Item(1).getLabel(); - lbl.getDataLabelFormat().setShowSeriesName(true); - - //Show value for third label - lbl = series.getDataPoints().get_Item(2).getLabel(); - lbl.getDataLabelFormat().setShowValue(true); - lbl.getDataLabelFormat().setShowSeriesName(true); - lbl.getDataLabelFormat().setSeparator ("/"); - - //Save Presentation1 with chart - pres.save(dataDir + "AsposeChart.pptx", SaveFormat.Pptx); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Charts/ChartFromScratch/ScatteredChart.java b/Examples/src/main/java/com/aspose/slides/examples/Charts/ChartFromScratch/ScatteredChart.java deleted file mode 100644 index 6f271d38..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Charts/ChartFromScratch/ScatteredChart.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Charts.ChartFromScratch; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class ScatteredChart -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ScatteredChart.class); - Presentation pres = new Presentation(); - - ISlide slide = pres.getSlides().get_Item(0); - - //Creating the default chart - IChart chart = slide.getShapes().addChart(ChartType.ScatterWithSmoothLines, 0, 0, 400, 400); - - //Getting the default chart data worksheet index - int defaultWorksheetIndex = 0; - - //Getting the chart data worksheet - IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); - - //Delete demo series - chart.getChartData().getSeries().clear(); - - //Add new series - chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 1, "Series 1"), chart.getType()); - chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 3, "Series 2"), chart.getType()); - - //Take first chart series - IChartSeries series = chart.getChartData().getSeries().get_Item(0); - - //Add new point (1:3) there. - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 1), fact.getCell(defaultWorksheetIndex, 2, 2, 3)); - - //Add new point (2:10) - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 2), fact.getCell(defaultWorksheetIndex, 3, 2, 10)); - - //Edit the type of series - series.setType (ChartType.ScatterWithStraightLinesAndMarkers); - - //Changing the chart series marker - series.getMarker().setSize(10); - series.getMarker().setSymbol(MarkerStyleType.Star); - - //Take second chart series - series = chart.getChartData().getSeries().get_Item(1); - - //Add new point (5:2) there. - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 5), fact.getCell(defaultWorksheetIndex, 2, 4, 2)); - - //Add new point (3:1) - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 3), fact.getCell(defaultWorksheetIndex, 3, 4, 1)); - - //Add new point (2:2) - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 4, 3, 2), fact.getCell(defaultWorksheetIndex, 4, 4, 2)); - - //Add new point (5:1) - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 5, 3, 5), fact.getCell(defaultWorksheetIndex, 5, 4, 1)); - - //Changing the chart series marker - series.getMarker().setSize(10); - series.getMarker().setSymbol(MarkerStyleType.Circle); - - pres.save(dataDir+ "AsposeScatterChart.pptx", SaveFormat.Pptx); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Charts/ChartTrendLines.java b/Examples/src/main/java/com/aspose/slides/examples/Charts/ChartTrendLines.java deleted file mode 100644 index 9706a1d4..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Charts/ChartTrendLines.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Charts; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class ChartTrendLines -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ChartTrendLines.class); - - //Creating empty Presentation1//Creating empty Presentation1 - Presentation pres = new Presentation(); - - //Creating a clustered column chart - IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 20, 20, 500, 400); - - //Adding ponential trend line for chart series 1 - ITrendline tredLinep = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(TrendlineType.Exponential); - tredLinep.setDisplayEquation(false); - tredLinep.setDisplayRSquaredValue(false); - - //Adding Linear trend line for chart series 1 - ITrendline tredLineLin = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(TrendlineType.Linear); - tredLineLin.setTrendlineType(TrendlineType.Linear); - tredLineLin.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); - tredLineLin.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.RED); - - - //Adding Logarithmic trend line for chart series 2 - ITrendline tredLineLog = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(TrendlineType.Logarithmic); - tredLineLog.setTrendlineType(TrendlineType.Logarithmic); - tredLineLog.addTextFrameForOverriding("New log trend line"); - - //Adding MovingAverage trend line for chart series 2 - ITrendline tredLineMovAvg = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(TrendlineType.MovingAverage); - tredLineMovAvg.setTrendlineType(TrendlineType.MovingAverage); - tredLineMovAvg.setPeriod((byte)3); - tredLineMovAvg.setTrendlineName("New TrendLine Name"); - - //Adding Polynomial trend line for chart series 3 - ITrendline tredLinePol = chart.getChartData().getSeries().get_Item(2).getTrendLines().add(TrendlineType.Polynomial); - tredLinePol.setTrendlineType(TrendlineType.Polynomial); - tredLinePol.setForward(1); - tredLinePol.setOrder ((byte)3); - - //Adding Power trend line for chart series 3 - ITrendline tredLinePower = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(TrendlineType.Power); - tredLinePower.setTrendlineType(TrendlineType.Power); - tredLinePower.setBackward(1); - - //Saving Presentation1 - pres.save(dataDir+ "ChartTrendLines.pptx", SaveFormat.Pptx); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Charts/ExistingChart.java b/Examples/src/main/java/com/aspose/slides/examples/Charts/ExistingChart.java deleted file mode 100644 index 99792db7..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Charts/ExistingChart.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Charts; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class ExistingChart -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ExistingChart.class); - - //Instantiate Presentation class that represents PPTX file//Instantiate Presentation class that represents PPTX file - Presentation pres = new Presentation(dataDir+ "AsposeChart.pptx"); - - //Access first slide - ISlide sld = pres.getSlides().get_Item(0); - - // Add chart with default data - IChart chart = (IChart)sld.getShapes().get_Item(0); - - //Setting the index of chart data sheet - int defaultWorksheetIndex = 0; - - //Getting the chart data worksheet - IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); - - //Changing chart Category Name - fact.getCell(defaultWorksheetIndex, 1, 0, "Modified Category 1"); - fact.getCell(defaultWorksheetIndex, 2, 0, "Modified Category 2"); - - - //Take first chart series - IChartSeries series = chart.getChartData().getSeries().get_Item(0); - - //Now updating series data - fact.getCell(defaultWorksheetIndex, 0, 1, "New_Series1");//modifying series name - series.getDataPoints().get_Item(0).getValue().setData (90); - series.getDataPoints().get_Item(1).getValue().setData ( 123); - series.getDataPoints().get_Item(2).getValue().setData ( 44); - - //Take Second chart series - series = chart.getChartData().getSeries().get_Item(1); - - //Now updating series data - fact.getCell(defaultWorksheetIndex, 0, 2, "New_Series2");//modifying series name - series.getDataPoints().get_Item(0).getValue().setData (23); - series.getDataPoints().get_Item(1).getValue().setData ( 67); - series.getDataPoints().get_Item(2).getValue().setData ( 99); - - - //Now, Adding a new series - chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 3, "Series 3"), chart.getType()); - - //Take 3rd chart series - series = chart.getChartData().getSeries().get_Item(2); - - //Now populating series data - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 3, 20)); - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 50)); - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 30)); - - chart.setType(ChartType.ClusteredCylinder); - - // Save Presentation1 with chart - pres.save(dataDir+ "AsposeChartModified.pptx", SaveFormat.Pptx); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Charts/NumberFormat.java b/Examples/src/main/java/com/aspose/slides/examples/Charts/NumberFormat.java deleted file mode 100644 index 15011cb9..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Charts/NumberFormat.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Charts; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class NumberFormat -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(NumberFormat.class); - - //Instantiate the Presentation1//Instantiate the Presentation1 - Presentation pres = new Presentation(); - - //Access the first Presentation1 slide - ISlide slide = pres.getSlides().get_Item(0); - - //Adding a default clustered column chart - IChart chart = slide.getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 500, 400); - - //Accessing the chart series collection - IChartSeriesCollection series = chart.getChartData().getSeries(); - - //Setting the preset number format - //Traverse through every chart series - for (IChartSeries ser : series) - { - //Traverse through every data cell in series - for (IChartDataPoint cell : ser.getDataPoints()) - { - //Setting the number format - cell.getValue().getAsCell().setPresetNumberFormat((byte)10); //0.00% - } - } - - //Saving Presentation1 - pres.save(dataDir+ "PresetNumberFormat.pptx", SaveFormat.Pptx); - - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/AccessOpenDocument.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/AccessOpenDocument.java deleted file mode 100644 index 7abb7df5..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/AccessOpenDocument.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation; - -import com.aspose.slides.examples.Utils; - -public class AccessOpenDocument -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AccessOpenDocument.class); - - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/ConvertToPDF.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/ConvertToPDF.java deleted file mode 100644 index fe69020b..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/ConvertToPDF.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class ConvertToPDF -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ConvertToPDF.class); - - //Instantiate a Presentation object that represents a Presentation1 file - Presentation pres = new Presentation(dataDir+ "Aspose.pptx"); - - - //Save the Presentation1 to PDF with default options - pres.save(dataDir+ "demoDefault.pdf", SaveFormat.Pdf); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/ManageProperties/AccessBuiltinProperties.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/ManageProperties/AccessBuiltinProperties.java deleted file mode 100644 index a2b57ffc..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/ManageProperties/AccessBuiltinProperties.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.ManageProperties; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class AccessBuiltinProperties -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AccessBuiltinProperties.class); - - //Instantiate the Presentation class that represents the Presentation1 - Presentation pres = new Presentation(dataDir+ "Aspose.pptx"); - - //Create a reference to IDocumentProperties object associated with Presentation - IDocumentProperties dp = pres.getDocumentProperties(); - - //Display the builtin properties - System.out.println("Category : " + dp.getCategory()); - System.out.println("Current Status : " + dp.getContentStatus()); - System.out.println("Creation Date : " + dp.getCreatedTime()); - System.out.println("Author : " + dp.getAuthor()); - System.out.println("Description : " + dp.getComments()); - System.out.println("KeyWords : " + dp.getKeywords()); - System.out.println("Last Modified By : " + dp.getLastSavedBy()); - System.out.println("Supervisor : " + dp.getManager()); - System.out.println("Modified Date : " + dp.getLastSavedTime()); - System.out.println("Presentation Format : " + dp.getPresentationFormat()); - System.out.println("Last Print Date : " + dp.getLastPrinted()); - System.out.println("Is Shared between producers : " + dp.getSharedDoc()); - System.out.println("Subject : " + dp.getSubject()); - System.out.println("Title : " + dp.getTitle()); - - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/ManageProperties/AccessModifyProperties.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/ManageProperties/AccessModifyProperties.java deleted file mode 100644 index 00f1ac70..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/ManageProperties/AccessModifyProperties.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.ManageProperties; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class AccessModifyProperties -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AccessModifyProperties.class); - - Presentation pres = new Presentation(dataDir+ "Aspose.pptx"); - - //Create a reference to IDocumentProperties object associated with Presentation - IDocumentProperties dp = pres.getDocumentProperties(); - - //Set the builtin properties - dp.setAuthor ( "Aspose.Slides for Java"); - dp.setTitle ("Modifying Presentation Properties"); - dp.setSubject ( "Aspose Subject"); - dp.setComments ( "Aspose Description"); - dp.setManager ( "Aspose Manager"); - - //Save your Presentation1 to a file - pres.save(dataDir+ "DocProps.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/ManageProperties/ModifyBuiltinProperties.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/ManageProperties/ModifyBuiltinProperties.java deleted file mode 100644 index 367b6a1f..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/ManageProperties/ModifyBuiltinProperties.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.ManageProperties; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class ModifyBuiltinProperties -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ModifyBuiltinProperties.class); - - Presentation pres = new Presentation(dataDir+ "Aspose.pptx"); - - //Create a reference to DocumentProperties object associated with Prsentation - IDocumentProperties dp = pres.getDocumentProperties(); - - - //Access and modify custom properties - for (int i = 0; i < dp.getCount(); i++) - { - //Display names and values of custom properties - System.out.println("Custom Property Name : " + dp.getPropertyName(i)); - System.out.println("Custom Property Value : " + dp.get_Item(dp.getPropertyName(i))); - - //Modify values of custom properties - dp.set_Item( dp.getPropertyName(i) , "New Value " + (i + 1)); - } - - //Save your Presentation1 to a file - pres.save(dataDir+ "CustomDemoModified.pptx",SaveFormat.Pptx); - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/OpenpPresentation/AccessProperties.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/OpenpPresentation/AccessProperties.java deleted file mode 100644 index cb0b56d3..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/OpenpPresentation/AccessProperties.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.OpenpPresentation; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class AccessProperties -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AccessProperties.class); - - //Accessing the Document Properties of a Password Protected Presentation without Password - //creating instance of load options to set the Presentation1 access password - com.aspose.slides.LoadOptions loadOptions = new com.aspose.slides.LoadOptions(); - - //Setting the access password to null - loadOptions.setPassword (null); - - //Setting the access to document properties - loadOptions.setOnlyLoadDocumentProperties (true); - - //Opening the Presentation1 file by passing the file path and load options to the constructor of Presentation class - Presentation pres = new Presentation( dataDir+ "demoPassDocument.pptx", loadOptions); - - //Getting Document Properties - IDocumentProperties docProps = pres.getDocumentProperties(); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/OpenpPresentation/OpenPasswordPresentation.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/OpenpPresentation/OpenPasswordPresentation.java deleted file mode 100644 index 1bb14e0f..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/OpenpPresentation/OpenPasswordPresentation.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.OpenpPresentation; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class OpenPasswordPresentation -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(OpenPasswordPresentation.class); - - //Loading Pass protected Presentation1 - - //creating instance of load options to set the Presentation1 access password - com.aspose.slides.LoadOptions loadOptions = new com.aspose.slides.LoadOptions(); - - //Setting the access password - loadOptions.setPassword ("pass"); - - //Opening the Presentation1 file by passing the file path and load options to the constructor of Presentation class - Presentation pres = new Presentation(dataDir+ "Aspose.pptx", loadOptions); - - //Printing the total number of Slides1 present in the Presentation1 - System.out.println(pres.getSlides().size()); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/OpenpPresentation/OpenPresentation.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/OpenpPresentation/OpenPresentation.java deleted file mode 100644 index c2c3dc1e..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/OpenpPresentation/OpenPresentation.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.OpenpPresentation; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class OpenPresentation -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(OpenPresentation.class); - - //Opening the Presentation1 file by passing the file path to the constructor of Presentation class - Presentation pres = new Presentation(dataDir+ "Aspose.pptx"); - - //Printing the total number of Slides1 present in the Presentation1 - System.out.println(pres.getSlides().size()); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PPTToPPTX.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/PPTToPPTX.java deleted file mode 100644 index 845878a2..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PPTToPPTX.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class PPTToPPTX -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(PPTToPPTX.class); - - //Instantiate a Presentation object that represents a PPTX file - Presentation pres = new Presentation(dataDir+ "Presentation1.ppt"); - - //Saving the PPTX Presentation1 to PPTX format - pres.save(dataDir+ "Aspose.pptx",SaveFormat.Pptx); - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToHTML.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToHTML.java deleted file mode 100644 index 30fe713d..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToHTML.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation; - -import com.aspose.slides.HtmlFormatter; -import com.aspose.slides.HtmlOptions; -import com.aspose.slides.Presentation; -import com.aspose.slides.SaveFormat; -import com.aspose.slides.examples.Utils; - -public class PresentationToHTML -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(PresentationToHTML.class); - - //Instantiate a Presentation object that represents a Presentation1 file - Presentation pres = new Presentation(dataDir+ "Aspose.pptx"); - - HtmlOptions htmlOpt = new HtmlOptions(); - htmlOpt.setHtmlFormatter(HtmlFormatter.createDocumentFormatter("", false)); - - //Saving the Presentation1 to HTML - pres.save(dataDir+ "demo.html", SaveFormat.Html, htmlOpt); - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToTIFF/CustomSize.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToTIFF/CustomSize.java deleted file mode 100644 index 2f26b094..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToTIFF/CustomSize.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.PresentationToTIFF; - -import com.aspose.slides.Presentation; -import com.aspose.slides.SaveFormat; -import com.aspose.slides.TiffCompressionTypes; -import com.aspose.slides.TiffOptions; -import com.aspose.slides.examples.Utils; - -public class CustomSize -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(CustomSize.class); - - //Instantiate a Presentation object that represents a Presentation file - Presentation pres = new Presentation(dataDir+ "Aspose.pptx"); - - //Instantiate the TiffOptions class - TiffOptions opts = new TiffOptions(); - - //Setting compression type - opts.setCompressionType ( TiffCompressionTypes.Default); - - //Compression Types - - //Default - Specifies the default compression scheme (LZW). - //None - Specifies no compression. - //CCITT3 - //CCITT4 - //LZW - //RLE - - //Depth – depends on the compression type and cannot be set manually. - //Resolution unit – is always equal to “2” (dots per inch) - - //Setting image DPI - opts.setDpiX ( 200); - opts.setDpiY (100); - - //Set Image Size - opts.setImageSize(new java.awt.Dimension(1728, 1078)); - - //Save the Presentation1 to TIFF with specified image size - pres.save(dataDir+ "demo.tiff", SaveFormat.Tiff,opts); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToTIFF/DefaultSize.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToTIFF/DefaultSize.java deleted file mode 100644 index 816eb551..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToTIFF/DefaultSize.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.PresentationToTIFF; - -import com.aspose.slides.Presentation; -import com.aspose.slides.SaveFormat; -import com.aspose.slides.examples.Utils; - -public class DefaultSize -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(DefaultSize.class); - - //Instantiate a Presentation object that represents a Presentation1 file - Presentation pres = new Presentation(dataDir+ "Aspose.pptx"); - - - //Saving the Presentation1 to TIFF document - pres.save(dataDir+ "demo.tiff", SaveFormat.Tiff); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToXPS/WithoutXPSOptions.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToXPS/WithoutXPSOptions.java deleted file mode 100644 index 8b4025c5..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToXPS/WithoutXPSOptions.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.PresentationToXPS; - -import com.aspose.slides.Presentation; -import com.aspose.slides.SaveFormat; -import com.aspose.slides.examples.Utils; - -public class WithoutXPSOptions -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(WithoutXPSOptions.class); - - //Instantiate a Presentation object that represents a Presentation1 file - Presentation pres = new Presentation(dataDir+ "Aspose.pptx"); - - //Saving the Presentation1 to XPS document - pres.save(dataDir+ "demo.xps", SaveFormat.Xps); - - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToXPS/XPSOptions.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToXPS/XPSOptions.java deleted file mode 100644 index c8a6c292..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationToXPS/XPSOptions.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.PresentationToXPS; - -import com.aspose.slides.Presentation; -import com.aspose.slides.SaveFormat; -import com.aspose.slides.XpsOptions; -import com.aspose.slides.examples.Utils; - -public class XPSOptions -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(XPSOptions.class); - - //Instantiate a Presentation object that represents a Presentation1 file - Presentation pres = new Presentation(dataDir+ "Aspose.pptx"); - - //Instantiate the TiffOptions class - XpsOptions opts = new XpsOptions(); - - //Save MetaFiles as PNG - opts.setSaveMetafilesAsPng(true); - - //Save the Presentation1 to XPS document - pres.save(dataDir+ "demo.xps", SaveFormat.Xps,opts); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationWithNotesToTiff.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationWithNotesToTiff.java deleted file mode 100644 index 54f1c7b0..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/PresentationWithNotesToTiff.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation; - -import com.aspose.slides.Presentation; -import com.aspose.slides.SaveFormat; -import com.aspose.slides.examples.Utils; - -public class PresentationWithNotesToTiff -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(PresentationToHTML.class); - - //Instantiate a Presentation object that represents a Presentation1 file - Presentation pres = new Presentation(dataDir+ "Aspose.pptx"); - - //Saving the Presentation1 to TIFF notes - pres.save(dataDir+ "TestNotes.tiff", SaveFormat.TiffNotes); - - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/RemoveWriteProtection.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/RemoveWriteProtection.java deleted file mode 100644 index 68cd15e5..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/RemoveWriteProtection.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.SavePresentation; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class RemoveWriteProtection -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(RemoveWriteProtection.class); - - //Opening the Presentation1 file - Presentation pres = new Presentation(dataDir+ "demoWriteProtected.pptx"); - - - //Checking if Presentation1 is write protected - if(pres.getProtectionManager().isWriteProtected()) - //Removing Write protection - pres.getProtectionManager().removeWriteProtection(); - - //Saving Presentation1 - pres.save(dataDir+ "newDemo.pptx", com.aspose.slides.SaveFormat.Pptx); - - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/SaveAsReadOnly.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/SaveAsReadOnly.java deleted file mode 100644 index cd30d38b..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/SaveAsReadOnly.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.SavePresentation; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class SaveAsReadOnly -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(SaveAsReadOnly.class); - - //Instantiate a Presentation object that represents a PPT file - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add an autoshape of type line - sld.getShapes().addAutoShape(ShapeType.Line, 50, 150, 300, 0); - - //Setting Write protection Password - pres.getProtectionManager().setWriteProtection("test"); - - //Save your Presentation1 to a file - pres.save(dataDir+ "demoWriteProtected.pptx", com.aspose.slides.SaveFormat.Pptx); - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/SavePresentationProperties.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/SavePresentationProperties.java deleted file mode 100644 index 9078b3ed..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/SavePresentationProperties.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.SavePresentation; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class SavePresentationProperties -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(SavePresentationProperties.class); - - //Instantiate a Presentation object that represents a PPT file - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add an autoshape of type line - sld.getShapes().addAutoShape(ShapeType.Line, 50, 150, 300, 0); - - //Setting access to document properties in password protected mode - pres.getProtectionManager().setEncryptDocumentProperties ( false); - - //Setting Password - pres.getProtectionManager().encrypt("pass"); - - //Save your Presentation1 to a file - pres.save(dataDir+ "Aspose.pptx", com.aspose.slides.SaveFormat.Pptx); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/SaveToFile.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/SaveToFile.java deleted file mode 100644 index cb35e92e..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/SaveToFile.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.SavePresentation; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class SaveToFile -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(SaveToFile.class); - - //Saving a Presentation to File - //Instantiate a Presentation object that represents a PPT file - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add an autoshape of type line - sld.getShapes().addAutoShape(ShapeType.Line, 50, 150, 300, 0); - - //Save your Presentation1 to a file - pres.save(dataDir+ "Aspose.pptx", com.aspose.slides.SaveFormat.Pptx); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/SaveWithPasswordProtection.java b/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/SaveWithPasswordProtection.java deleted file mode 100644 index c85e89ec..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Presentation/SavePresentation/SaveWithPasswordProtection.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Presentation.SavePresentation; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class SaveWithPasswordProtection -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(SaveWithPasswordProtection.class); - - //Instantiate a Presentation object that represents a PPT file - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add an autoshape of type line - sld.getShapes().addAutoShape(ShapeType.Line, 50, 150, 300, 0); - - //Setting Password - pres.getProtectionManager().encrypt("pass"); - - //Save your Presentation1 to a file - pres.save("demoPass.pptx", com.aspose.slides.SaveFormat.Pptx); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/RunExamples.java b/Examples/src/main/java/com/aspose/slides/examples/RunExamples.java new file mode 100644 index 00000000..85ac1c86 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/RunExamples.java @@ -0,0 +1,742 @@ +package com.aspose.slides.examples; + +import java.io.File; + + +public class RunExamples +{ + public static void main(String[] args) throws Exception + { + System.out.println("Open RunExamples.cs. \nIn Main() method uncomment the example that you want to run."); + System.out.println("====================================================="); + + // Uncomment the one you want to try out + + //// ===================================================== + //// ActiveX + //// ===================================================== + + //ManageActiveXControl.main(null); + //LinkingVideoActiveXControl.main(null); + + // ===================================================== + // Charts + // ===================================================== + + //MultiCategoryChart.main(null); + //ChartEntities.main(null); + //ChartTrendLines.main(null); + //ExistingChart.main(null); + //ChangeColorOfCategories.main(null); + //FontSizeLegend.main(null); + //NormalCharts.main(null); + //GetChartImage.main(null); + //FontPropertiesForInvidualLegend.main(null); + //InvertIfNegativeForIndividualSeries.main(null); + //SettingFontProperties.main(null); + //SupportForChangingSeriesColor.main(null); + //SupportForChartAreaRoundedBorders.main(null); + //NumberFormat.main(null); + //SupportForStockChart.main(null); + //OrganizationChart.main(null); + //ScatteredChart.main(null); + //PieChart.main(null); + //ChangeChartCategoryAxis.main(null); + //TreeMapChart.main(null); + //ChartMarkerOptionsOnDataPoint.main(null); + //SettingDateFormatForCategoryAxis.main(null); + //SettingPositionAxis.main(null); + //SettingRotationAngle.main(null); + //ShowingDisplayUnitLabel.main(null); + //SupportForBubbleChartScaling.main(null); + //SupportForPrecisionOfData.main(null); + //SupportForSwitchingRowsAndColumns.main(null); + //SunburstChart.main(null); + //FunnelChart.main(null); + //DisplayChartLabels.main(null); + //AddErrorBars.main(null); + //AddCustomError.main(null); + //AnimatingSeries.main(null); + //AnimatingSeriesElements.main(null); + //AnimatingCategoriesElements.main(null); + //SetChartSeriesOverlap.main(null); + //SetAutomaticSeriesFillColor.main(null); + //ValidateChartLayoutAdded.main(null); + //SetChartDataFromWorkBook.main(null); + //SetCategoryAxisLabelDistance.main(null); + //SetlegendCustomOptions.main(null); + //SetDataLabelsPercentageSign.main(null); + //DoughnutChartHole.main(null); + //ManagePropertiesCharts.main(null); + //SetGapWidth.main(null); + //AutomaticChartSeriescolor.main(null); + //DisplayPercentageAsLabels.main(null); + //SecondPlotOptionsforCharts.main(null); + //SetMarkerOptions.main(null); + //SetDataRange.main(null); + //GetWidthHeightFromChartPlotArea.main(null); + //UsingWorkBookChartcellAsDatalabel.main(null); + //SwitchChartRowColumns.main(null); + //EditChartDatainExternalWorkbook.main(null); + //SetExternalWorkbook.main(null); + //CreateExternalWorkbook.main(null); + //EditChartDatainExternalWorkbook.main(null); + //SetExternalWorkbook.main(null); + //CreateExternalWorkbook.main(null); + //SupportOfBubbleSizeRepresentation.main(null); + //AddingCustomLines.main(null); + //HideInformationFromChart.main(null); + //SetExternalWorkbookWithUpdateChartData.main(null); + //FontPropertiesForChart.main(null); + //DefaultMarkersInChart.main(null); + //ClearSpecificChartSeriesDataPointsData.main(null); + //SetLayoutMode.main(null); + //AddColorToDataPoints.main(null); + //RadarChartCreation.main(null); + //ChartDataCell_Formulas.main(null); + //SpreadsheetFormulasOptions.main(null); + //Chart_RecoverWorkbook.main(null); + //Chart_GetRange.main(null); + //MapChart.main(null); + //CalculateFormulas.main(null); + //WorksheetsExample.main(null); + //TimeUnitTypeEnum.main(null); + //LeaderLineColor.main(null); + //ChartDataPointIndex.main(null); + //ExtractExcelDataExample.main(null); + //ImportingChartsFromExcelExample.main(null); + //TitleLegendChartExample.main(null); + + //// ===================================================== + //// Presentations + //// ===================================================== + + //// ===================================================== + //// Presentations - Conversion + //// ===================================================== + + //ConvertingPresentationToHtmlWithEmbedAllFontsHtmlController.main(null); + //ConvertToPDF.main(null); + //ConvertToPdfCompliance.main(null); + //ConvertToPDFWithHiddenSlides.main(null); + //CustomOptionsPDFConversion.main(null); + //ConvertPresentationToPasswordProtectedPDF.main(null); + //ConvertSpecificSlideToPDF.main(null); + //ConvertSlidesToPdfNotes.main(null); + //PresentationToTIFFWithDefaultSize.main(null); + //PresentationToTIFFWithCustomImagePixelFormat.main(null); + //ConvertWithNoteToTiff.main(null); + //ConvertWholePresentationToHTML.main(null); + //ConvertPresentationToResponsiveHTML.main(null); + //ConvertIndividualSlide.main(null); + //ConvertWithCustomSize.main(null); + //ConvertNotesSlideView.main(null); + //ConvertWithoutXpsOptions.main(null); + //ConvertWithXpsOptions.main(null); + //ConversionToTIFFNotes.main(null); + //GeneratingSVGWithCustomShapeIDS.main(null); + //ConvertNotesSlideViewToPDF.main(null); + //CreateNewPresentation.main(null); + //PPTtoPPTX.main(null); + //ExportMediaFilestohtml.main(null); + //SetInvertFillColorChart.main(null); + //ExportShapeToSVG.main(null); + //CovertToPDFWithProgressUpdate.main(null); + //ODPToPPTX.main(null); + //FodpFormatConvertion.main(null); + //Pdf1A_PdfUa_Conformance.main(null); + //ExportMathParagraphToMathML.main(null); + //SvgFormattingController.main(null); + //PdfImportExample.main(null); + //ConvertToXaml.main(null); + //ConvertToGif.main(null); + //ConvertToHtml5.main(null); + //SvgConvertionOptions.main(null); + //ConvertToAnimation.main(null); + //ConvertToMarkdown.main(null); + //ConvertHTMLEmbeddingImages.main(null); + //ConvertToBlackWiteTiff.main(null); + //ConvertToHandout.main(null); + //ExportInkExample.main(null); + //PdfImportTableExample.main(null); + //ExportMathParagraphToLatex.main(null); + //ConvertToHtml5NotesComments.main(null); + //ConvertToPdfUnsupportedFontStyles.main(null); + //ConvertToXml.main(null); + //ExportOleExample.main(null); + //ConvertToEmf.main(null); + //ConvertSvgToEmf.main(null); + //ConvertToHtml5Handout.main(null); + //ConvertToMarkdownOptions.main(null); + //ImportHtmlSlideExample.main(null); + //ConvertImagesToMarkdown.main(null); + + // ===================================================== + //// ===================================================== + //// Presentations - Opening + //// ===================================================== + //// ===================================================== + + //OpenPresentation.main(null); + //LoadFormatEnumeration.main(null); + //OpenPasswordPresentation.main(null); + //VerifyingPresentationWithoutloading.main(null); + //GetFileFormat.main(null); + //GetRectangularCoordinatesofParagraph.main(null); + //GetPositionCoordinatesofPortion.main(null); + //SetAccessPermissionsToPDF.main(null); + //DeleteEmbeddedBinaryObjects.main(null); + + //// ===================================================== + //// Presentations - Properties + //// ===================================================== + + //AccessBuiltinProperties.main(null); + //AccessModifyingProperties.main(null); + //AddCustomDocumentProperties.main(null); + //AccessOpenDoc.main(null); + //AccessProperties.main(null); + //ModifyBuiltinProperties.main(null); + //UpdatePresentationProperties.main(null); + //UpdatePresentationPropertiesUsingNewTemplate.main(null); + //UpdatePresentationPropertiesUsingPropertiesOfAnotherPresentationAsATemplate.main(null); + //SupportForInterrupt.main(null); + //AccessLayoutFormats.main(null); + //ReadOnlyRecommended.main(null); + //CheckPresentationProtection.main(null); + //CheckPasswordExample.main(null); + //RootDirectoryClsId.main(null); + //PresentationSlideShowSetup.main(null); + //SlideShowMediaControls.main(null); + //GridProperties.main(null); + //GuidesProperties.main(null); + //ExtendedPresentationProperties.main(null); + + //// ===================================================== + //// Presentations - Saving + //// ===================================================== + + //RemoveWriteProtection.main(null); + //SaveAsReadOnly.main(null); + //SaveProperties.main(null); + //SaveToFile.main(null); + //SaveToStream.main(null); + //SaveWithPassword.main(null); + //SaveAsPredefinedViewType.main(null); + //AddImageFromSVGObject.main(null); + //ConvertSvgImageObjectIntoGroupOfShapes.main(null); + //AddBlobImageToPresentation.main(null); + //SaveInZip64Mode.main(null); + //RefreshThumbnailPresentation.main(null); + //JavaScriptLinkExample.main(null); + //ImageQualityExample.main(null); + + //// ===================================================== + //// Presentations - LowCode + //// ===================================================== + + //RemoveUnusedLayoutMaster.main(null); + //ForEachPortion.main(null); + + //// ===================================================== + //// Shapes + //// ===================================================== + + //AccessOLEObjectFrame.main(null); + //AddArrowShapedLine.main(null); + //AddArrowShapedLineToSlide.main(null); + //AddAudioFrame.main(null); + //AddOLEObjectFrame.main(null); + //AddPlainLineToSlide.main(null); + //AddVideoFrame.main(null); + //AnimationsOnShapes.main(null); + //ChangeOLEObjectData.main(null); + //ConnectorLineAngle.main(null); + //EmbeddedVideoFrame.main(null); + //FillShapesGradient.main(null); + //FillShapesPattern.main(null); + //FillShapesPicture.main(null); + //FindShapeInSlide.main(null); + //FillShapeswithSolidColor.main(null); + //FormatJoinStyles.main(null); + //FormatLines.main(null); + //FormattedEllipse.main(null); + //Apply3DRotationEffecrOnShapes.main(null); + //FormattedRectangle.main(null); + //PictureFrameFormatting.main(null); + //RotatingShapes.main(null); + //SimpleEllipse.main(null); + //SimpleRectangle.main(null); + //AddRelativeScaleHeightPictureFrame.main(null); + //CreateShapeThumbnail.main(null); + //CreateBoundsShapeThumbnail.main(null); + //CreateScalingFactorThumbnail.main(null); + //CreateSmartArtChildNoteThumbnail.main(null); + //CreateGroupShape.main(null); + //AccessingAltTextinGroupshapes.main(null); + //CloneShapes.main(null); + //SetAlternativeText.main(null); + //RemoveShape.main(null); + //Hidingshapes.main(null); + //ChangeShapeOrder.main(null); + //ConnectShapesUsingConnectors.main(null); + //ConnectShapeUsingConnectionSite.main(null); + //ApplyBevelEffects.main(null); + //AddVideoFrameFromWebSource.main(null); + //AddStretchOffsetForImageFill.main(null); + //GetShapeBevelEffectiveData.main(null); + //GetLightRigEffectiveData.main(null); + //GetCameraEffectiveData.main(null); + //SetFileTypeForAnEmbeddingObject.main(null); + //ExtractEmbeddedFileDataFromOLEObject.main(null); + //MathematicalShape.main(null); + //MathShape_GetChildren.main(null); + //MathPhantomExample.main(null); + //ShapesAlignment.main(null); + //SketchedShapes.main(null); + //GeometryShapeAddSegment.main(null); + //GeometryShapeRemoveSegment.main(null); + //GeometryShapeCreatesCustomGeometry.main(null); + //GeometryShapeCompositeObjects.main(null); + //CreateZoomFrame.main(null); + //CreateSummaryZoom.main(null); + //CreateSectionZoom.main(null); + //AnimationTargetShapes.main(null); + //DuotoneEffectsPVI.main(null); + //IsTextShape.main(null); + //SetVideoTrimFromEnd.main(null); + //InkManagementExample.main(null); + //DeletePictureCroppedAreasExample.main(null); + //ShapeIsDecorativePropertyExample.main(null); + //TilePictureFillFormatExample.main(null); + //AnimationFloatUpDown.main(null); + //CompressImageExample.main(null); + //AdjustValueTypeExample.main(null); + //PictureFrameIsCameoExample.main(null); + //InkEffectsExample.main(null); + //BrightnessContrastEffectExample.main(null); + + //// ===================================================== + //// Slides + //// ===================================================== + + //// ===================================================== + //// Slides - CRUD + //// ===================================================== + + //AccessSlides.main(null); + //AccessSlidebyIndex.main(null); + //AccessSlidebyID.main(null); + //CreateSlidesSVGImage.main(null); + //ChangePosition.main(null); + //CloneAtEndOfAnother.main(null); + //CloneAtEndOfAnotherSpecificPosition.main(null); + //CloneToAnotherPresentationWithMaster.main(null); + //CloneWithInSamePresentation.main(null); + //CloneWithinSamePresentationToEnd.main(null); + //CloneAnotherPresentationAtSpecifiedPosition.main(null); + //RemoveSlideUsingIndex.main(null); + //RemoveSlideUsingReference.main(null); + //AddSlides.main(null); + //AddNotesSlideWithNotesStyle.main(null); + //CloneSlideIntoSpecifiedSection.main(null); + + //// ===================================================== + //// Slides - Notes + //// ===================================================== + + //RemoveNotesAtSpecificSlide.main(null); + //RemoveNotesFromAllSlides.main(null); + //HeaderAndFooterInNotesSlide.main(null); + //RenderingNotesWhileConvertingToHTML.main(null); + + //// ===================================================== + //// Slides - Background + //// ===================================================== + + //SetBackgroundToGradient.main(null); + //SetImageAsBackground.main(null); + //SetSlideBackgroundMaster.main(null); + //SetSlideBackgroundNormal.main(null); + //GetBackgroundEffectiveValues.main(null); + + //// ===================================================== + //// Slides - Transitions + //// ===================================================== + + //BetterSlideTransitions.main(null); + //SimpleSlideTransitions.main(null); + //ManageSimpleSlideTransitions.main(null); + //ManagingBetterSlideTransitions.main(null); + //SetTransitionEffects.main(null); + //SupportOfMorphTransition.main(null); + //AnimationRepeatOnSlide.main(null); + //AnimationRewind.main(null); + //AfterAnimationTypeExample.main(null); + //AnimationFadedZoomSubtype.main(null); + //AnimationDurationSlide.main(null); + + //// ===================================================== + //// Slides - Thumbnail + //// ===================================================== + + //ThumbnailFromSlide.main(null); + //ThumbnailFromSlideInNotes.main(null); + //ThumbnailWithUserDefinedDimensions.main(null); + + //// ===================================================== + //// Slides - Comments + //// ===================================================== + + //AddSlideComments.main(null); + //AccessSlideComments.main(null); + //AddParentComments.main(null); + //ModernComments.main(null); + + //// ===================================================== + //// Slides - Layout + //// ===================================================== + + //AddLayoutSlides.main(null); + //SetSizeAndType.main(null); + //SetPDFPageSize.main(null); + //SetSlideSizeScale.main(null); + //SetChildFooter.main(null); + //HeaderFooterManager.main(null); + //CheckSlidesComparison.main(null); + //RemoveUnusedLayoutMaster.main(null); + //GetBasePlacehorderExample.main(null); + //LayoutPlaceholderManagerExample.main(null); + + //// ===================================================== + //// Slides - HyperLink + //// ===================================================== + + //RemoveHyperlinks.main(null); + //MacroHyperlink.main(null); + //ExternalUrlOriginal.main(null); + + //// ===================================================== + //// Slides - Media + //// ===================================================== + + //ExtractVideo.main(null); + //ExtractAudio.main(null); + //ExtractAudioFromTimeline.main(null); + //ExtractAudioFromHyperLink.main(null); + //StopPreviousSoundExample.main(null); + //FadeInOutDurationAudioExample.main(null); + //VolumeAudioExample.main(null); + //TrimmingTimeAudioExample.main(null); + //VideoCaptionsExample.main(null); + //AudioCaptionsExample.main(null); + + //// ===================================================== + //// Rendering - Printing a Slide + //// ===================================================== + + //SetZoom.main(null); + //SetSlideNumber.main(null); + //DefaultPrinterPrinting.main(null); + //SpecificPrinterPrinting.main(null); + //RenderComments.main(null); + //RenderingEmoji.main(null); + //SupportOfDigitalSignature.main(null); + //Rendering3D.main(null); + //RenderOptions.main(null); + + //// ===================================================== + //// Smart Arts + //// ===================================================== + + //AccessChildNodes.main(null); + //AccessChildNodeSpecificPosition.main(null); + //AccessSmartArt.main(null); + //AccessSmartArtShape.main(null); + //AddNodes.main(null); + //AddNodesSpecificPosition.main(null); + //AssistantNode.main(null); + //CreateSmartArtShape.main(null); + //RemoveNode.main(null); + //RemoveNodeSpecificPosition.main(null); + //SmartArtNodeLevel.main(null); + //AccessSmartArtParticularLayout.main(null); + //ChangSmartArtShapeStyle.main(null); + //ChangeSmartArtShapeColorStyle.main(null); + //FillFormatSmartArtShapeNode.main(null); + //ChangeTextOnSmartArtNode.main(null); + //ChangeSmartArtLayout.main(null); + //CheckSmartArtHiddenProperty.main(null); + //ChangeSmartArtState.main(null); + //OrganizeChartLayoutType.main(null); + + //// ===================================================== + //// Tables + //// ===================================================== + + //RemovingRowColumn.main(null); + //TableFromScratch.main(null); + //TableWithCellBorders.main(null); + //UpdateExistingTable.main(null); + //AddImageinsideTableCell.main(null); + //CloningInTable.main(null); + //VerticallyAlignText.main(null); + //StandardTables.main(null); + //MergeCells.main(null); + //MergeCell.main(null); + //CellSplit.main(null); + //TextFormattingInsideTableColumn.main(null); + //TextFormattingInsideTableRow.main(null); + //SetTextFormattingInsideTable.main(null); + //IdentifyingTheMergedCellsinTable.main(null); + //AddImageinsideTableCells.main(null); + //LockAspectRatio.main(null); + //GetEffectiveValuesOfTable.main(null); + //CreateATableFromScratchInASlide.main(null); + //SetFirstRowAsHeader.main(null); + //TableTransparency.main(null); + + //// ===================================================== + //// Text + //// ===================================================== + + //DefaultFonts.main(null); + //ExportingHTMLText.main(null); + //EmbedFontsInHtml.main(null); + //FontFamilyExample.main(null); + //EndParaGraphProperties.main(null); + //FontProperties.main(null); + //ImportingHTMLText.main(null); + //MultipleParagraphs.main(null); + //ParagraphBullets.main(null); + //ParagraphIndent.main(null); + //ParagraphsAlignment.main(null); + //ReplacingText.main(null); + //ShadowEffects.main(null); + //TextBoxHyperlink.main(null); + //TextBoxOnSlideProgram.main(null); + //ApplyInnerShadow.main(null); + //LoadExternalFont.main(null); + //ManageParagraphFontProperties.main(null); + //SetTextFontProperties.main(null); + //ReplaceFontsExplicitly.main(null); + //RuleBasedFontsReplacement.main(null); + //SetAutofitOftextframe.main(null); + //SetAnchorOfTextFrame.main(null); + //RotatingText.main(null); + //LineSpacing.main(null); + //ApplyOuterShadow.main(null); + //CustomRotationAngleTextframe.main(null); + //UseCustomFonts.main(null); + //ManageParagraphPictureBulletsInPPT.main(null); + //ManageEmbeddedFonts.main(null); + //GetFontsFolders.main(null); + //AddEmbeddedFonts.main(null); + //AddingSuperscriptAndSubscriptTextInTextFrame.main(null); + //MutilevelBullets.main(null); + //AddColumnsinTextFrame.main(null); + //SettingPresentationLanguageAndShapeText.main(null); + //AnimationEffectinParagraph.main(null); + //GetEffectiveValues.main(null); + //SetLocalFontHeightValues.main(null); + //GetTextFrameFormatEffectiveData.main(null); + //GetTextStyleEffectiveData.main(null); + //SetCustomBulletsNumber.main(null); + //SetFontFallBack.main(null); + //FallBackRulesCollection.main(null); + //RenderingWithFallBackFont.main(null); + //AddCustomPromptText.main(null); + //SaveWithDefaaultRegularFont.main(null); + //PortionGetRect.main(null); + //BulletFillFormatEffective.main(null); + //WordArt.main(null); + //KeepTextFlat.main(null); + //GetFontsSubstitution.main(null); + //GetFontsSlideSubstitution.main(null); + //EmbeddedFontCompression.main(null); + //FindAndReplaceText.main(null); + //SpecifyDefaultTextLanguage.main(null); + //AnimateTextTypeExample.main(null); + //NumberlinesInParagraph.main(null); + //FindAndReplaceTextResult.main(null); + //FontBinaryDataExample..main(null); + //FontEmbeddingLevelExample.main(null); + //GetPresentationRowTextExample.main(null); + //DisableFontLigaturesExample.main(null); + //SplitTextByColumnsExample.main(null); + //ManageScriptFontsExample.main(null); + //GetPlaceholderTextExample.main(null); + //HighlightTextUsingRegx.main(null); + //FindTextOptions.main(null); + + //// ===================================================== + //// VBA Macros + //// ===================================================== + + //AddVBAMacros.main(null); + //RemoveVBAMacros.main(null); + //ExtractingVBAMacros.main(null); + + //// ===================================================== + //// Presentation Views + //// ===================================================== + + //ManagePresenetationNormalViewState.main(null); + //GradientStyleRendering.main(null); + + // Stop before exiting + System.out.println("\n\nProgram Finished. Press any key to exit...."); + //Console.readKey(); + } + + public static String getDataDir_ActiveX() + { + return getDataDir_Data() + "ActiveX" + File.separator; + } + + public static String getOutPath() + { + if (OutPath == null) + { + File f = new File(getDataDir_Data() + "Out"); + if (!f.exists()) + f.mkdir(); + OutPath = f.getAbsolutePath() + File.separator; + } + return OutPath; + } + + private static String OutPath = null; + + public static String getDataDir_Charts() + { + return getDataDir_Data() + "Charts" + File.separator; + } + + public static String getDataDir_VBA() + { + return getDataDir_Data() + "VBA" + File.separator; + } + + public static String getDataDir_Presentations() + { + return getDataDir_Data() + "Presentations" + File.separator; + } + + public static String getDataDir_Conversion() + { + return getDataDir_Data() + "Presentations" + File.separator + "Conversion" + File.separator; + } + + public static String getDataDir_PresentationProperties() + { + return getDataDir_Data() + "Presentations" + File.separator + "Properties" + File.separator; + } + + public static String getDataDir_PresentationSaving() + { + return getDataDir_Data() + "Presentations" + File.separator + "Saving" + File.separator; + } + + public static String getDataDir_PresentationOpening() + { + return getDataDir_Data() + "Presentations" + File.separator + "Opening" + File.separator; + } + + public static String getDataDir_Slides_Presentations_LowCode() + { + return getDataDir_Data() + "Presentations"+ File.separator + " LowCode" + File.separator; + } + + public static String getDataDir_Rendering() + { + return getDataDir_Data() + "Rendering-Printing" + File.separator; + } + + public static String getDataDir_Shapes() + { + return getDataDir_Data() + "Shapes" + File.separator; + } + + public static String getDataDir_Slides_Presentations() + { + return getDataDir_Data() + "Slides" + File.separator; + } + + public static String getDataDir_Slides_Presentations_CRUD() + { + return getDataDir_Data() + "Slides" + File.separator + "CRUD" + File.separator; + } + + public static String getDataDir_Slides_Presentations_Notes() + { + return getDataDir_Data() + "Slides" + File.separator + "Notes" + File.separator; + } + + public static String getDataDir_Slides_Presentations_Background() + { + return getDataDir_Data() + "Slides" + File.separator + "Background" + File.separator; + } + + public static String getDataDir_Slides_Presentations_Transitions() + { + return getDataDir_Data() + "Slides" + File.separator + "Transitions" + File.separator; + } + + public static String getDataDir_Slides_Presentations_Thumbnail() + { + return getDataDir_Data() + "Slides" + File.separator + "Thumbnail" + File.separator; + } + + public static String getDataDir_Slides_Presentations_Comments() + { + return getDataDir_Data() + "Slides" + File.separator + "Comments" + File.separator; + } + + public static String getDataDir_Slides_Presentations_Layout() + { + return getDataDir_Data() + "Slides" + File.separator + "Layout" + File.separator; + } + + public static String getDataDir_Slides_Presentations_Hyperlink() + { + return getDataDir_Data() + "Slides" + File.separator + "Hyperlink" + File.separator; + } + + public static String getDataDir_Slides_Presentations_Media() + { + return getDataDir_Data() + "Slides" + File.separator + "Media" + File.separator; + } + + + public static String getDataDir_SmartArts() + { + return getDataDir_Data() + "SmartArts" + File.separator; + } + + public static String getDataDir_Tables() + { + return getDataDir_Data() + "Tables" + File.separator; + } + + public static String getDataDir_Text() + { + return getDataDir_Data() + "Text" + File.separator; + } + + public static String getDataDir_Video() + { + return getDataDir_Data() + "Video" + File.separator; + } + + public static String getDataDir_Slides_Views() + { + return getDataDir_Data() + "Slides" + File.separator + "Views" + File.separator; + } + + private static String getDataDir_Data() + { + return new File(".").getAbsolutePath() + File.separator + "Data" + File.separator; + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/AddEllipse/FormattedEllipse.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/AddEllipse/FormattedEllipse.java deleted file mode 100644 index 5f29a0a2..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/AddEllipse/FormattedEllipse.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes.AddEllipse; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class FormattedEllipse -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(FormattedEllipse.class); - - //Instantiate Prseetation class that represents the PPTX - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add autoshape of ellipse type - IShape shp = sld.getShapes().addAutoShape(ShapeType.Ellipse, 50, 150, 150, 50); - - //Apply some formatting to ellipse shape - shp.getFillFormat().setFillType(FillType.Solid); - shp.getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.Chocolate)); - - //Apply some formatting to the line of Ellipse - shp.getLineFormat().getFillFormat().setFillType(FillType.Solid); - shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); - shp.getLineFormat().setWidth(5); - - //Write the PPTX file to disk - pres.save(dataDir+ "EllipseShp1.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/AddEllipse/SimpleEllipse.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/AddEllipse/SimpleEllipse.java deleted file mode 100644 index efb6a0d8..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/AddEllipse/SimpleEllipse.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes.AddEllipse; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class SimpleEllipse -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(SimpleEllipse.class); - - //Instantiate Prseetation class that represents the PPTX - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add autoshape of ellipse type - sld.getShapes().addAutoShape(ShapeType.Ellipse, 50, 150, 150, 50); - - //Write the PPTX file to disk - pres.save(dataDir+ "EllipseShp1.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/AddLineShape/AddArrowShapedLine.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/AddLineShape/AddArrowShapedLine.java deleted file mode 100644 index c784aa9a..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/AddLineShape/AddArrowShapedLine.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes.AddLineShape; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class AddArrowShapedLine -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AddArrowShapedLine.class); - - //Instantiate PresentationEx class that represents the PPTX file - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add an autoshape of type line - IAutoShape shp = sld.getShapes().addAutoShape(ShapeType.Line, 50, 150, 300, 0); - - //Apply some formatting on the line - shp.getLineFormat().setStyle (LineStyle.ThickBetweenThin); - shp.getLineFormat().setWidth ( 10); - - shp.getLineFormat().setDashStyle (LineDashStyle.DashDot); - - shp.getLineFormat().setBeginArrowheadLength(LineArrowheadLength.Short); - shp.getLineFormat().setBeginArrowheadStyle (LineArrowheadStyle.Oval); - - shp.getLineFormat().setEndArrowheadLength (LineArrowheadLength.Long); - shp.getLineFormat().setEndArrowheadStyle (LineArrowheadStyle.Triangle); - - shp.getLineFormat().getFillFormat().setFillType(FillType.Solid); - shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(new Color(com.aspose.slides.PresetColor.Maroon)); - - //Write the PPTX to Disk - pres.save(dataDir+ "LineShape2.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/AddPictureFrame/AddSimplePictureFrames.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/AddPictureFrame/AddSimplePictureFrames.java deleted file mode 100644 index 8d83eac8..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/AddPictureFrame/AddSimplePictureFrames.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes.AddPictureFrame; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; - -public class AddSimplePictureFrames -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AddSimplePictureFrames.class); - - //Instantiate Prseetation class that represents the PPTX - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Instantiate the Image class - IPPImage imgx =null; - - try{ - imgx = pres.getImages().addImage(new FileInputStream(new File(dataDir+ "aspose-logo.jpg"))); - } - catch(IOException e){} - - //Add Picture Frame with height and width equivalent of Picture - sld.getShapes().addPictureFrame(ShapeType.Rectangle, 50, 150, imgx.getWidth(), imgx.getHeight(), imgx); - - //Write the PPTX file to disk - pres.save(dataDir+ "RectPicFrame.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/ApplyAnimationsOnShapes.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/ApplyAnimationsOnShapes.java deleted file mode 100644 index e7fdbcd8..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/ApplyAnimationsOnShapes.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes; - -import com.aspose.slides.examples.Utils; - -public class ApplyAnimationsOnShapes -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ApplyAnimationsOnShapes.class); - - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/ConnectorLineAngle.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/ConnectorLineAngle.java deleted file mode 100644 index 83f4600f..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/ConnectorLineAngle.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class ConnectorLineAngle -{ - public static void main(String[] args) throws Exception { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ConnectorLineAngle.class); - - Presentation pres = new Presentation(dataDir + "LineExample.pptx"); - Slide slide = (Slide) pres.getSlides().get_Item(0); - Shape shape; - for (int i = 0; i < slide.getShapes().size(); i++) { - double dir = 0.0; - shape = (Shape) slide.getShapes().get_Item(i); - if (shape instanceof AutoShape) { - AutoShape ashp = (AutoShape) shape; - if (ashp.getShapeType() == (byte) ShapeType.Line) { - // dir = getDirection(ashp.getWidth(), ashp.getHeight(), ashp.getFrame().getFlipH(), ashp.getFrame().getFlipV()); - } - } else if (shape instanceof Connector) { - Connector ashp = (Connector) shape; - //dir = getDirection(ashp.getWidth(), ashp.getHeight(), ashp.getFrame().getFlipH(), ashp.getFrame().getFlipV()); - } - - System.out.println(dir); - System.out.println("Program executed successfully"); - - } - } - - - public static double getDirection(float w, float h, boolean flipH, boolean flipV) - { - float endLineX = w * (flipH ? -1 : 1); - float endLineY = h * (flipV ? -1 : 1); - float endYAxisX = 0; - float endYAxisY = h; - double angle = (java.lang.Math.atan2(endYAxisY, endYAxisX) - java.lang.Math.atan2(endLineY, endLineX)); - if (angle < 0) angle += 2 * Math.PI; - return angle * 180.0 / Math.PI; - } - } - - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/EmbeddedVideoFrame.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/EmbeddedVideoFrame.java deleted file mode 100644 index 64e49096..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/EmbeddedVideoFrame.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.io.File; -import java.io.FileInputStream; - -public class EmbeddedVideoFrame -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(EmbeddedVideoFrame.class); - - //Instantiate Presentation class that represents the PPTX - Presentation pres = new Presentation(); - -//Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - try{ - //Embedd video inside Presentation1 - IVideo vid = pres.getVideos().addVideo(new FileInputStream(new File(dataDir+ "Wildlife.mp4"))); - - //Add Video Frame - IVideoFrame vf = sld.getShapes().addVideoFrame(50, 150, 300, 350, vid); - - //Set video to Video Frame - vf.setEmbeddedVideo(vid); - - //Set Play Mode and Volume of the Video - vf.setPlayMode (VideoPlayModePreset.Auto); - vf.setVolume(AudioVolumeMode.Loud); - - //Write the PPTX file to disk - pres.save(dataDir+ "VideoFrame.pptx", SaveFormat.Pptx); - } - catch(Exception e){} - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/FillShapesGradient.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/FillShapesGradient.java deleted file mode 100644 index 1c9f2e2b..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/FillShapesGradient.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class FillShapesGradient -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(FillShapesGradient.class); - - //Instantiate Prseetation class that represents the PPTX//Instantiate Prseetation class that represents the PPTX - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add autoshape of ellipse type - IShape shp = sld.getShapes().addAutoShape(ShapeType.Ellipse, 50, 150, 75, 150); - - //Apply some gradient formatting to ellipse shape - shp.getFillFormat().setFillType(FillType.Gradient); - shp.getFillFormat().getGradientFormat().setGradientShape(GradientShape.Linear); - - //Set the Gradient Direction - shp.getFillFormat().getGradientFormat().setGradientDirection(GradientDirection.FromCorner2); - - //Add two Gradient Stops - shp.getFillFormat().getGradientFormat().getGradientStops().add((float)1.0, Color.blue); - shp.getFillFormat().getGradientFormat().getGradientStops().add((float) 0, Color.CYAN); - - //Write the PPTX file to disk - pres.save(dataDir+ "EllipseShpGrad.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/FillShapesPattern.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/FillShapesPattern.java deleted file mode 100644 index 9315564f..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/FillShapesPattern.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class FillShapesPattern -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(FillShapesPattern.class); - - //Instantiate Prseetation class that represents the PPTX - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add autoshape of rectangle type - IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 75, 150); - - //Set the fill type to Pattern - shp.getFillFormat().setFillType(FillType.Pattern); - - //Set the pattern style - shp.getFillFormat().getPatternFormat().setPatternStyle(PatternStyle.Trellis); - - //Set the pattern back and fore colors - shp.getFillFormat().getPatternFormat().getBackColor().setColor(Color.LIGHT_GRAY); - shp.getFillFormat().getPatternFormat().getForeColor().setColor(Color.YELLOW); - - //Write the PPTX file to disk - pres.save(dataDir+ "RectShpPatt.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/FillShapesPicture.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/FillShapesPicture.java deleted file mode 100644 index 389064bd..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/FillShapesPicture.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; - -public class FillShapesPicture -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(FillShapesPicture.class); - - //Instantiate PrseetationEx class that represents the PPTX - Presentation pres = new Presentation(); - -//Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add autoshape of rectangle type - IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 75, 150); - - //Set the fill type to Picture - shp.getFillFormat().setFillType (FillType.Picture); - - //Set the picture fill mode - shp.getFillFormat().getPictureFillFormat().setPictureFillMode(PictureFillMode.Tile); - - //Set the picture - IPPImage imgx=null; - try{ - imgx = pres.getImages().addImage(new FileInputStream(new File( "aspose-logo.jpg"))); - } - catch(IOException e){} - - shp.getFillFormat().getPictureFillFormat().getPicture().setImage(imgx); - - //Write the PPTX file to disk - pres.save(dataDir+ "RectShpPic.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/FormatLines/FormatJoinStyles.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/FormatLines/FormatJoinStyles.java deleted file mode 100644 index efab5ddf..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/FormatLines/FormatJoinStyles.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes.FormatLines; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class FormatJoinStyles -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(FormatJoinStyles.class); - - //Instantiate Presentation class that represents the PPTX - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add three autoshapes of rectangle type - IShape shp1 = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 100, 150, 75); - - IShape shp2 = sld.getShapes().addAutoShape(ShapeType.Rectangle, 300, 100, 150, 75); - - IShape shp3 = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 250, 150, 75); - - //Set the fill color of the rectangle shape - shp1.getFillFormat().setFillType(FillType.Solid); - shp1.getFillFormat().getSolidFillColor().setColor (Color.BLACK); - shp2.getFillFormat().setFillType(FillType.Solid); - shp2.getFillFormat().getSolidFillColor().setColor (Color.BLACK); - shp3.getFillFormat().setFillType(FillType.Solid); - shp3.getFillFormat().getSolidFillColor().setColor (Color.BLACK); - - //Set the line width - shp1.getLineFormat().setWidth(15); - shp2.getLineFormat().setWidth(15); - shp3.getLineFormat().setWidth (15); - - //Set the color of the line of rectangle - shp1.getLineFormat().getFillFormat().setFillType(FillType.Solid); - shp1.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); - shp2.getLineFormat().getFillFormat().setFillType(FillType.Solid); - shp2.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); - shp3.getLineFormat().getFillFormat().setFillType(FillType.Solid); - shp3.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); - - //Set the Join Style - shp1.getLineFormat().setJoinStyle(LineJoinStyle.Miter); - shp2.getLineFormat().setJoinStyle(LineJoinStyle.Bevel); - shp3.getLineFormat().setJoinStyle(LineJoinStyle.Round); - - //Add Text1 to each rectangle - ((IAutoShape)shp1).getTextFrame().setText ("This is Miter Join Style"); - ((IAutoShape)shp2).getTextFrame().setText( "This is Bevel Join Style"); - ((IAutoShape)shp3).getTextFrame().setText ("This is Round Join Style"); - - //Write the PPTX file to disk - pres.save(dataDir+ "RectShpLnJoin.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/FormatLines/FormatLines.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/FormatLines/FormatLines.java deleted file mode 100644 index 00ac3e2c..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/FormatLines/FormatLines.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes.FormatLines; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class FormatLines -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(FormatLines.class); - - //Instantiate Presentation class that represents the PPTX - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add autoshape of rectangle type - IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 150, 75); - - //Set the fill color of the rectangle shape - shp.getFillFormat().setFillType(FillType.Solid); - shp.getFillFormat().getSolidFillColor().setColor (Color.WHITE); - - //Apply some formatting on the line of the rectangle - shp.getLineFormat().setStyle(LineStyle.ThickThin); - shp.getLineFormat().setWidth(7); - shp.getLineFormat().setDashStyle(LineDashStyle.Dash); - - //set the color of the line of rectangle - shp.getLineFormat().getFillFormat().setFillType(FillType.Solid); - shp.getLineFormat().getFillFormat().getSolidFillColor().setColor ( Color.BLUE); - - //Write the PPTX file to disk - pres.save(dataDir+ "RectShpLn.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/OLEObjectFrames/AddOLEObjectFrame.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/OLEObjectFrames/AddOLEObjectFrame.java deleted file mode 100644 index 880716c5..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/OLEObjectFrames/AddOLEObjectFrame.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes.OLEObjectFrames; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.io.File; -import java.io.FileInputStream; - -public class AddOLEObjectFrame -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AddOLEObjectFrame.class); - - //Instantiate Prseetation class that represents the PPTX - Presentation pres = new Presentation(); - - //Access the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Load an Excel file to Array of Bytes - File file=new File(dataDir+ "sample.xlsx"); - int length=(int)file.length(); - FileInputStream fstro = new FileInputStream(file); - byte[] buf = new byte[length]; - fstro.read(buf, 0, length); - - //Add an Ole Object Frame shape - IOleObjectFrame oof = sld.getShapes().addOleObjectFrame((float)0,(float) 0, (float)pres.getSlideSize().getSize().getWidth(),(float) pres.getSlideSize().getSize().getHeight (), "Excel.Sheet.8", buf); - - //Write the PPTX to disk - pres.save(dataDir+ "OleEmbed.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/RectangleShape/FormattedRectangle.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/RectangleShape/FormattedRectangle.java deleted file mode 100644 index 98857cc8..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/RectangleShape/FormattedRectangle.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes.RectangleShape; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class FormattedRectangle -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(FormattedRectangle.class); - - //Instantiate Presentation class that represents the PPTX - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add autoshape of ellipse type - IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 150, 50); - - //Apply some formatting to ellipse shape - shp.getFillFormat().setFillType(FillType.Solid); - shp.getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.Chocolate)); - - //Apply some formatting to the line of Ellipse - shp.getLineFormat().getFillFormat().setFillType(FillType.Solid); - shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); - shp.getLineFormat().setWidth(5); - - //Write the PPTX file to disk - pres.save(dataDir+ "RecShp2.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/RectangleShape/SimpleRectangle.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/RectangleShape/SimpleRectangle.java deleted file mode 100644 index 0c82c9fd..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/RectangleShape/SimpleRectangle.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes.RectangleShape; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class SimpleRectangle -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(SimpleRectangle.class); - - //Instantiate Prseetation class that represents the PPTX - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add autoshape of ellipse type - IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 150, 50); - - //Write the PPTX file to disk - pres.save(dataDir+ "RecShp1.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Shapes/RotateShapes.java b/Examples/src/main/java/com/aspose/slides/examples/Shapes/RotateShapes.java deleted file mode 100644 index a251ea11..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Shapes/RotateShapes.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Shapes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class RotateShapes -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(RotateShapes.class); - - //Instantiate Presentation class that represents the PPTX - Presentation pres = new Presentation(); - - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add autoshape of rectangle type - IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 75, 150); - - //Rotate the shape to 90 degree - shp.setRotation(90); - - //Write the PPTX file to disk - pres.save(dataDir+ "RectShpRot.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Slides/AccessSlides.java b/Examples/src/main/java/com/aspose/slides/examples/Slides/AccessSlides.java deleted file mode 100644 index 6941f228..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Slides/AccessSlides.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Slides; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class AccessSlides -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AccessSlides.class); - - //Instantiate a Presentation object that represents a Presentation1 file - Presentation pres = new Presentation(dataDir+ "demo.pptx"); - - //Accessing a slide using its slide index - ISlide slide = pres.getSlides().get_Item(0); - - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Slides/AddSlides.java b/Examples/src/main/java/com/aspose/slides/examples/Slides/AddSlides.java deleted file mode 100644 index d590bc36..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Slides/AddSlides.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Slides; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class AddSlides -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AddSlides.class); - - //Instantiate Presentation class that represents the Presentation1 file - Presentation pres = new Presentation(); - - //Instantiate SlideCollection class - ISlideCollection slds = pres.getSlides(); - - for (int i = 0; i < pres.getLayoutSlides().size(); i++) - { - //Add an empty slide to the Slides collection - slds.addEmptySlide(pres.getLayoutSlides().get_Item(i)); - - } - //Get the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add an autoshape of type line - sld.getShapes().addAutoShape(ShapeType.Line, 50, 150, 300, 0); - - //Save the PPTX file to the Disk - pres.save(dataDir+ "EmptySlide.pptx", SaveFormat.Pptx); - - - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Slides/CloneSlides/AnotherPresentationWithMaster.java b/Examples/src/main/java/com/aspose/slides/examples/Slides/CloneSlides/AnotherPresentationWithMaster.java deleted file mode 100644 index 8ad9c304..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Slides/CloneSlides/AnotherPresentationWithMaster.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Slides.CloneSlides; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class AnotherPresentationWithMaster -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AnotherPresentationWithMaster.class); - - //Instantiate Presentation class to load the source Presentation1 file - - Presentation srcPres = new Presentation(dataDir+ "demo.pptx"); - -//Instantiate Presentation class for destination Presentation1 (where slide is to be cloned) - - Presentation destPres = new Presentation(); - -//Instantiate ISlide from the collection of Slides1 in source Presentation1 along with -//master slide - ISlide SourceSlide= srcPres.getSlides().get_Item(0); - - - //Clone the desired master slide from the source Presentation1 to the collection of masters in the - //destination Presentation1 - IMasterSlideCollection masters=destPres.getMasters(); - IMasterSlide SourceMaster = SourceSlide.getLayoutSlide().getMasterSlide(); - - //Clone the desired master slide from the source Presentation1 to the collection of masters in the - //destination Presentation1 - IMasterSlide iSlide = masters.addClone(SourceMaster); - - //Clone the desired slide from the source Presentation1 with the desired master to the end of the - //collection of Slides1 in the destination Presentation1 - ISlideCollection slds = destPres.getSlides(); - slds.addClone(SourceSlide,iSlide); - - //Clone the desired master slide from the source Presentation1 to the collection of masters in the//destination Presentation1 - //Save the destination Presentation1 to disk - destPres.save(dataDir+ "helloworld_dest3.pptx",SaveFormat.Pptx); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Slides/CreateSlidesSVGImage.java b/Examples/src/main/java/com/aspose/slides/examples/Slides/CreateSlidesSVGImage.java deleted file mode 100644 index e522d9ae..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Slides/CreateSlidesSVGImage.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Slides; - -import com.aspose.slides.ISlide; -import com.aspose.slides.Presentation; -import com.aspose.slides.examples.Utils; - -import java.io.FileOutputStream; -import java.io.IOException; - -public class CreateSlidesSVGImage -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(CreateSlidesSVGImage.class); - //Instantiate a Presentation object that represents a PPTX file - Presentation pres = new Presentation(dataDir+ "demo.pptx"); - - //Getting last slide index - int lastSlidePosition=pres.getSlides().size(); - ISlide slide =null; - //Iterating through every Presentation1 slide and generating SVG image - for (int i = 0; i < lastSlidePosition; i++) - { - //Accessing Slides - slide = pres.getSlides().get_Item(i); - - //Getting and saving the slide SVG image - try{ - slide.writeAsSvg(new FileOutputStream(dataDir+ "SvgImage" + i+ ".svg")); - } - catch(IOException e){} - - } - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Slides/CreateSlidesThumbnailImage/GenerateThumbnailFromSlideInNotes.java b/Examples/src/main/java/com/aspose/slides/examples/Slides/CreateSlidesThumbnailImage/GenerateThumbnailFromSlideInNotes.java deleted file mode 100644 index 75559e67..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Slides/CreateSlidesThumbnailImage/GenerateThumbnailFromSlideInNotes.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Slides.CreateSlidesThumbnailImage; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; - -public class GenerateThumbnailFromSlideInNotes -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(GenerateThumbnailFromSlideInNotes.class); - //Instantiate a Presentation class that represents the Presentation1 file - Presentation pres = new Presentation(dataDir+ "Aspose.pptx"); - - //Access the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //User defined dimension - int desiredX = 1200; - int desiredY = 800; - - - //Getting scaled value of X and Y - float ScaleX = (float)(1.0 / pres.getSlideSize().getSize().getWidth()) * desiredX; - float ScaleY = (float)(1.0 / pres.getSlideSize().getSize().getHeight()) * desiredY; - - - //Create a full scale image - BufferedImage image = sld.getNotesSlide().getThumbnail(ScaleX, ScaleY); - - //Save the image to disk in JPEG format - try - { - ImageIO.write(image, "jpeg", new File(dataDir+ "ContentBG_tnail.jpg")); - } - catch(IOException e){} - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Slides/CreateSlidesThumbnailImage/GenerateThumbnailFromSlideWithUserDefinedDimensions.java b/Examples/src/main/java/com/aspose/slides/examples/Slides/CreateSlidesThumbnailImage/GenerateThumbnailFromSlideWithUserDefinedDimensions.java deleted file mode 100644 index 22dbe672..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Slides/CreateSlidesThumbnailImage/GenerateThumbnailFromSlideWithUserDefinedDimensions.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Slides.CreateSlidesThumbnailImage; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; - -public class GenerateThumbnailFromSlideWithUserDefinedDimensions -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(GenerateThumbnailFromSlideWithUserDefinedDimensions.class); - - //Instantiate a Presentation class that represents the Presentation1 file - Presentation pres = new Presentation(dataDir+ "Aspose.pptx"); - -//Access the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //User defined dimension - int desiredX = 1200; - int desiredY = 800; - - //Getting scaled value of X and Y - float ScaleX = (float)(1.0 / pres.getSlideSize().getSize().getWidth()) * desiredX; - float ScaleY = (float)(1.0 / pres.getSlideSize().getSize().getHeight()) * desiredY; - - //Create a full scale image - BufferedImage image = sld.getThumbnail(ScaleX, ScaleY); - - //Save the image to disk in JPEG format - try - { - ImageIO.write(image, "jpeg", new File(dataDir + "ContentBG_tnail.jpg")); - } - catch(IOException e){} - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Slides/RemoveSlides/UsingSlideIndex.java b/Examples/src/main/java/com/aspose/slides/examples/Slides/RemoveSlides/UsingSlideIndex.java deleted file mode 100644 index d3a547f8..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Slides/RemoveSlides/UsingSlideIndex.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Slides.RemoveSlides; - -import com.aspose.slides.Presentation; -import com.aspose.slides.SaveFormat; -import com.aspose.slides.examples.Utils; - -public class UsingSlideIndex -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(UsingSlideIndex.class); - - //Instantiate a Presentation object that represents a Presentation1 file - Presentation pres = new Presentation(dataDir+ "demo.pptx"); - - //Removing a slide using its slide index - pres.getSlides().removeAt(0); - - - //Writing the Presentation1 file - pres.save(dataDir+ "modified.pptx", SaveFormat.Pptx); - - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Slides/RemoveSlides/UsingSlideReference.java b/Examples/src/main/java/com/aspose/slides/examples/Slides/RemoveSlides/UsingSlideReference.java deleted file mode 100644 index 2bf09599..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Slides/RemoveSlides/UsingSlideReference.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Slides.RemoveSlides; - -import com.aspose.slides.ISlide; -import com.aspose.slides.Presentation; -import com.aspose.slides.SaveFormat; -import com.aspose.slides.examples.Utils; - -public class UsingSlideReference -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(UsingSlideReference.class); - - - //Instantiate a Presentation object that represents a Presentation1 file - Presentation pres = new Presentation(dataDir+ "demo.pptx"); - - //Accessing a slide using its index in the Slides1 collection - ISlide slide = pres.getSlides().get_Item(0); - - - //Removing a slide using its reference - pres.getSlides().remove(slide); - - - //Writing the Presentation1 file - pres.save(dataDir+ "modified.pptx",SaveFormat.Pptx); - - - System.out.println("Program executed successfully"); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/AccessChildNodes.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/AccessChildNodes.java deleted file mode 100644 index 9fe43eaf..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/AccessChildNodes.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.AccessSmartArtNodes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class AccessChildNodes -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AccessChildNodes.class); - - //Instantiate Presentation Class - Presentation pres = new Presentation(dataDir+"SimpleSmartArt.pptx"); - - //Get first slide - ISlide slide = pres.getSlides().get_Item(0); - - //Traverse through every shape inside first slide - for(IShape shape : slide.getShapes()) - { - //Check if shape is of SmartArt type - if (shape instanceof ISmartArt) - { - //Typecast shape to SmartArtEx - ISmartArt smart = (ISmartArt)shape; - - //Traverse through all nodes inside SmartArt - for (int i = 0; i < smart.getAllNodes().size(); i++) - { - //Accessing SmartArt node at index i - SmartArtNode node0 = (SmartArtNode)smart.getAllNodes().get_Item(i); - - //Traversing through the child nodes in SmartArt node at index i - for (int j = 0; j < node0.getChildNodes().size(); j++) - { - //Accessing the child node in SmartArt node - SmartArtNode node = (SmartArtNode)node0.getChildNodes().get_Item(j); - - //Printing the SmartArt child node parameters - System.out.print("j = "+j+", Text = "+node.getTextFrame().getText()+", Level = "+node.getLevel()+", Position = "+node.getPosition()); - } - } - } - } - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/AccessSmartArt.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/AccessSmartArt.java deleted file mode 100644 index 0fbc4171..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/AccessSmartArt.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.AccessSmartArtNodes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class AccessSmartArt -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AccessSmartArt.class); - - //Instantiate Presentation Class - Presentation pres = new Presentation(dataDir+ "SimpleSmartArt.pptx"); - - //Get first slide - ISlide slide = pres.getSlides().get_Item(0); - - //Traverse through every shape inside first slide - for(IShape shape : slide.getShapes()) - { - //Check if shape is of SmartArt type - if (shape instanceof ISmartArt) - { - //Typecast shape to SmartArtEx - ISmartArt smart = (ISmartArt)shape; - - //Traverse through all nodes inside SmartArt - for (int i = 0; i < smart.getAllNodes().size(); i++) - { - //Accessing SmartArt node at index i - SmartArtNode node = (SmartArtNode)smart.getAllNodes().get_Item(i); - - //Printing the SmartArt node parameters - System.out.print(node.getTextFrame().getText()+" " + node.getLevel()+" " + node.getPosition()); - - } - } - } - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/ChildNodeSpecificPosition.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/ChildNodeSpecificPosition.java deleted file mode 100644 index 4e107871..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/ChildNodeSpecificPosition.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.AccessSmartArtNodes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class ChildNodeSpecificPosition -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ChildNodeSpecificPosition.class); - - //Instantiate the Presentation1 - Presentation pres = new Presentation(); - - //Accessing the first slide - ISlide slide = pres.getSlides().get_Item(0); - - //Adding the SmartArt shape in first slide - ISmartArt smart = slide.getShapes().addSmartArt(0, 0, 400, 400, SmartArtLayoutType.StackedList); - - //Accessing the SmartArt node at index 0 - ISmartArtNode node = smart.getAllNodes().get_Item(0); - - //Accessing the child node at position 1 in parent node - int position = 1; - SmartArtNode chNode = (SmartArtNode)((SmartArtNodeCollection)node.getChildNodes()).getNodeByPosition(position); - - //Printing the SmartArt child node parameters - System.out.print("Text = "+chNode.getTextFrame().getText()+", Level = "+chNode.getLevel()+", Position = "+chNode.getPosition()); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddAccessSmartArt/AccessSmartArtShape.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddAccessSmartArt/AccessSmartArtShape.java deleted file mode 100644 index 5ef9cbee..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddAccessSmartArt/AccessSmartArtShape.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.AddAccessSmartArt; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class AccessSmartArtShape -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AccessSmartArtShape.class); - - //Instantiate Presentation Class - Presentation pres = new Presentation(dataDir+ "SimpleSmartArt.pptx"); - - //Get first slide - ISlide slide = pres.getSlides().get_Item(0); - - //Traverse through every shape inside first slide - for(IShape shape : pres.getSlides().get_Item(0).getShapes()) - { - //Check if shape is of SmartArt type - if (shape instanceof ISmartArt) - { - //Typecast shape to SmartArtEx - ISmartArt smart = (ISmartArt)shape; - } - } - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddAccessSmartArt/CreateSmartArtShape.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddAccessSmartArt/CreateSmartArtShape.java deleted file mode 100644 index 705b50d8..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddAccessSmartArt/CreateSmartArtShape.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.AddAccessSmartArt; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class CreateSmartArtShape -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(CreateSmartArtShape.class); - - //Instantiate Presentation Class - Presentation pres = new Presentation(); - - //Get first slide - ISlide slide = pres.getSlides().get_Item(0); - - //Add Smart Art Shape - ISmartArt smart = slide.getShapes().addSmartArt(0, 0, 400, 400, SmartArtLayoutType.BasicBlockList); - - //Saving Presentation1 - pres.save(dataDir+ "SimpleSmartArt.pptx", SaveFormat.Pptx); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddRemoveNodes/AddNodes.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddRemoveNodes/AddNodes.java deleted file mode 100644 index cfed35ff..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddRemoveNodes/AddNodes.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.AddRemoveNodes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class AddNodes -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AddNodes.class); - - //Load the desired the Presentation1 - Presentation pres = new Presentation(dataDir+ "SimpleSmartArt.pptx"); - - //Traverse through every shape inside first slide - for(IShape shape : pres.getSlides().get_Item(0).getShapes()) - { - - //Check if shape is of SmartArt type - if (shape instanceof SmartArt) - { - - //Typecast shape to SmartArt - SmartArt smart = (SmartArt)shape; - - //Adding a new SmartArt Node - SmartArtNode TemNode = (SmartArtNode)smart.getAllNodes().addNode(); - - //Adding Text1 - TemNode.getTextFrame().setText("Test"); - - //Adding new child node in parent node. It will be added in the end of collection - SmartArtNode newNode = (SmartArtNode)TemNode.getChildNodes().addNode(); - - //Adding Text1 - newNode.getTextFrame().setText("New Node Added"); - - } - } - - //Saving Presentation - pres.save(dataDir+ "AddSmartArtNode.pptx", SaveFormat.Pptx); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddRemoveNodes/NodeAtSpecificPosition.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddRemoveNodes/NodeAtSpecificPosition.java deleted file mode 100644 index 2f955113..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddRemoveNodes/NodeAtSpecificPosition.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.AddRemoveNodes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class NodeAtSpecificPosition -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(NodeAtSpecificPosition.class); - - //Creating a Presentation1 instance - Presentation pres = new Presentation(); - - //Access the Presentation1 slide - ISlide slide = pres.getSlides().get_Item(0); - - //Add Smart Art IShape - ISmartArt smart = slide.getShapes().addSmartArt(0, 0, 400, 400, SmartArtLayoutType.StackedList); - - //Accessing the SmartArt node at index 0 - ISmartArtNode node = smart.getAllNodes().get_Item(0); - - //Adding new child node at position 2 in parent node - SmartArtNode chNode = (SmartArtNode)((SmartArtNodeCollection)node.getChildNodes()).addNodeByPosition(2); - - //Add Text - chNode.getTextFrame().setText("Sample Text Added"); - - //Save Presentation - pres.save(dataDir+ "AddSmartArtNodeByPosition.pptx", SaveFormat.Pptx); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddRemoveNodes/RemoveNode.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddRemoveNodes/RemoveNode.java deleted file mode 100644 index 3144ff0c..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddRemoveNodes/RemoveNode.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.AddRemoveNodes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class RemoveNode -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(RemoveNode.class);; - //Load the desired the Presentation1 - Presentation pres = new Presentation(dataDir+ "AddSmartArtNode.pptx"); - - //Traverse through every shape inside first slide - for(IShape shape : pres.getSlides().get_Item(0).getShapes()) - { - - //Check if shape is of SmartArt type - if (shape instanceof ISmartArt) - { - //Typecast shape to SmartArtEx - ISmartArt smart = (ISmartArt)shape; - - if (smart.getAllNodes().size() > 0) - { - //Accessing SmartArt node at index 0 - ISmartArtNode node = smart.getAllNodes().get_Item(0); - - //Removing the selected node - smart.getAllNodes().removeNode(node); - - } - } - } - - //Save Presentation - pres.save(dataDir+ "RemoveSmartArtNode.pptx", SaveFormat.Pptx); - - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddRemoveNodes/RemoveNodeSpecificPosition.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddRemoveNodes/RemoveNodeSpecificPosition.java deleted file mode 100644 index f48ac43a..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/AddRemoveNodes/RemoveNodeSpecificPosition.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.AddRemoveNodes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class RemoveNodeSpecificPosition -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(RemoveNodeSpecificPosition.class); - //Load the desired the Presentation1 - Presentation pres = new Presentation(dataDir+ "AddSmartArtNode.pptx"); - - //Traverse through every shape inside first slide - for(IShape shape : pres.getSlides().get_Item(0).getShapes()) - { - - //Check if shape is of SmartArt type - if (shape instanceof SmartArt) - { - //Typecast shape to SmartArt - SmartArt smart = (SmartArt)shape; - - if (smart.getAllNodes().size() > 0) - { - //Accessing SmartArt node at index 0 - ISmartArtNode node = smart.getAllNodes().get_Item(0); - - if (node.getChildNodes().size() >= 2) - { - //Removing the child node at position 1 - ((SmartArtNodeCollection)node.getChildNodes()).removeNodeByPosition(1); - } - - } - } - - } - - //Save Presentation - pres.save(dataDir+ "RemoveSmartArtNodeByPosition.pptx", SaveFormat.Pptx); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/CheckAssistantNodes/AssistantNode.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/CheckAssistantNodes/AssistantNode.java deleted file mode 100644 index 0854d890..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/CheckAssistantNodes/AssistantNode.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.CheckAssistantNodes; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class AssistantNode -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AssistantNode.class); - - //Creating a Presentation1 instance - Presentation pres = new Presentation(dataDir+ "AddSmartArtNode.pptx"); - - //Traverse through every shape inside first slide - for(IShape shape : pres.getSlides().get_Item(0).getShapes()) - { - //Check if shape is of SmartArt type - if (shape instanceof ISmartArt) - { - //Typecast shape to SmartArtEx - ISmartArt smart = (SmartArt)shape; - - //Traversing through all nodes of SmartArt shape - for(int i = 0; i < smart.getAllNodes().size(); i++) - { - ISmartArtNode node = smart.getAllNodes().get_Item(i); - - String tc = node.getTextFrame().getText(); - - //Check if node is Assitant node - if (node.isAssistant()) - { - //Setting Assitant node to false and making it normal node - node.setAssistant(false); - } - } - } - } - //Save Presentation - pres.save(dataDir+ "ChangeAssitantNode.pptx", SaveFormat.Pptx); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/CheckAssistantNodes/SmartArtNodeLevel.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/CheckAssistantNodes/SmartArtNodeLevel.java deleted file mode 100644 index 40274fa0..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/CheckAssistantNodes/SmartArtNodeLevel.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.CheckAssistantNodes; - -import com.aspose.slides.examples.Utils; - -public class SmartArtNodeLevel -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(SmartArtNodeLevel.class); - - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/AccessSmartArt.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/AccessSmartArt.java deleted file mode 100644 index 109d9b89..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/AccessSmartArt.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.ManageSmartArtStyle; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class AccessSmartArt -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(AccessSmartArt.class); - - //Instantiate Presentation Class - Presentation pres = new Presentation(dataDir+ "SimpleSmartArt.pptx"); - - //Get first slide - ISlide slide = pres.getSlides().get_Item(0); - - //Traverse through every shape inside first slide - for(IShape shape : slide.getShapes()) - { - //Check if shape is of SmartArt type - if (shape instanceof ISmartArt) - { - //Typecast shape to SmartArtEx - ISmartArt smart = (ISmartArt)shape; - - //Checking SmartArt Layout - if (smart.getLayout() == SmartArtLayoutType.BasicBlockList) - { - System.out.print("Program is executed successfully...."); - } - - } - } - - //Saving Presentation1 - pres.save(dataDir+ "SimpleSmartArt.pptx", SaveFormat.Pptx); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/ChangeSmartArt.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/ChangeSmartArt.java deleted file mode 100644 index b4884bed..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/ChangeSmartArt.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.ManageSmartArtStyle; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class ChangeSmartArt -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ChangeSmartArt.class); - - //Instantiate Presentation Class - Presentation pres = new Presentation(dataDir+ "SimpleSmartArt.pptx"); - - //Get first slide - ISlide slide = pres.getSlides().get_Item(0); - - //Traverse through every shape inside first slide - for(IShape shape : slide.getShapes()) - { - //Check if shape is of SmartArt type - if (shape instanceof ISmartArt) - { - //Typecast shape to SmartArtEx - ISmartArt smart = (ISmartArt)shape; - - //Checking SmartArt style - if (smart.getQuickStyle() == SmartArtQuickStyleType.SimpleFill) - { - //Changing SmartArt Style - smart.setQuickStyle(SmartArtQuickStyleType.Cartoon); - } - } - } - //Saving Presentation1 - pres.save(dataDir+ "ChangeSmartArtStyle.pptx", SaveFormat.Pptx); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/SmartArtColorStyle.java b/Examples/src/main/java/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/SmartArtColorStyle.java deleted file mode 100644 index 69fd0b8e..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/SmartArtColorStyle.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.SmartArt.ManageSmartArtStyle; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class SmartArtColorStyle -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(SmartArtColorStyle.class); - - //Instantiate Presentation Class - Presentation pres = new Presentation(dataDir+ "SimpleSmartArt.pptx"); - - //Get first slide - ISlide slide = pres.getSlides().get_Item(0); - - //Traverse through every shape inside first slide - for(IShape shape : slide.getShapes()) - { - //Check if shape is of SmartArt type - if (shape instanceof ISmartArt) - { - //Typecast shape to SmartArtEx - ISmartArt smart = (ISmartArt)shape; - - //Checking SmartArt color type - if (smart.getColorStyle() == SmartArtColorType.ColoredFillAccent1) - { - //Changing SmartArt color type - smart.setColorStyle(SmartArtColorType.ColorfulAccentColors); - } - } - } - //Saving Presentation1 - pres.save(dataDir+ "ChangeSmartArtColorStyle.pptx", SaveFormat.Pptx); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Tables/ExistingTable.java b/Examples/src/main/java/com/aspose/slides/examples/Tables/ExistingTable.java deleted file mode 100644 index 653a0611..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Tables/ExistingTable.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Tables; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class ExistingTable -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ExistingTable.class); - - //Instantiate Presentation class that represents PPTX - Presentation pres = new Presentation(dataDir+ "demotable.pptx"); - - //Access the first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Initialize null TableEx - ITable tbl = null; - - //Iterate through the Shapes1 and set a reference to the table found - for (IShape shp : sld.getShapes()) - if (shp instanceof ITable) - tbl = (ITable)shp; - - //Set the Text1 of the first column of second row - tbl.getRows().get_Item(0).get_Item(1).getTextFrame().setText("New"); - - //Save the PPTX to Disk - pres.save(dataDir+ "table1.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Tables/RemoveRowColumn.java b/Examples/src/main/java/com/aspose/slides/examples/Tables/RemoveRowColumn.java deleted file mode 100644 index 7a7bff12..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Tables/RemoveRowColumn.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Tables; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class RemoveRowColumn -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(RemoveRowColumn.class); - - Presentation pres = new Presentation(); - - ISlide slide = pres.getSlides().get_Item(0); - double[] colWidth = { 100, 50, 30 }; - double[] rowHeight = { 30, 50, 30 }; - - ITable table = slide.getShapes().addTable(100, 100, colWidth, rowHeight); - - table.getRows().removeAt(1, false); - table.getColumns().removeAt(1, false); - - pres.save(dataDir+ "TestTable.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Tables/TableFromScratch/CellsBorder.java b/Examples/src/main/java/com/aspose/slides/examples/Tables/TableFromScratch/CellsBorder.java deleted file mode 100644 index 036d0e23..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Tables/TableFromScratch/CellsBorder.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Tables.TableFromScratch; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class CellsBorder -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(CellsBorder.class); - - //Instantiate Presentation class that represents PPTX file - Presentation pres = new Presentation(); - - //Access first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Define columns with widths and rows with heights - double[] dblCols = { 50, 50, 50 }; - double[] dblRows = { 50, 30, 30, 30, 30 }; - - //Add table shape to slide - ITable tbl = sld.getShapes().addTable(100, 50, dblCols, dblRows); - - //Set border format for each cell - for(int row = 0; row < tbl.getRows().size(); row++) - { - for (int cell = 0; cell < tbl.getRows().get_Item(row).size(); cell++) - { - tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().getFillFormat().setFillType(FillType.NoFill); - tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().getFillFormat().setFillType(FillType.NoFill); - tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().getFillFormat().setFillType(FillType.NoFill); - tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().getFillFormat().setFillType(FillType.NoFill); - - } - } - - //Save PPTX to Disk - pres.save(dataDir+ "table_no_border.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Tables/TableFromScratch/FromScratch.java b/Examples/src/main/java/com/aspose/slides/examples/Tables/TableFromScratch/FromScratch.java deleted file mode 100644 index 89d27ef6..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Tables/TableFromScratch/FromScratch.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Tables.TableFromScratch; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class FromScratch -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(FromScratch.class); - - //Instantiate Presentation class that represents PPTX file - Presentation pres = new Presentation(); - - //Access first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Define columns with widths and rows with heights - double[] dblCols = { 50, 50, 50 }; - double[] dblRows = { 50, 30, 30, 30, 30 }; - - //Add table shape to slide - ITable tbl = sld.getShapes().addTable(100, 50, dblCols, dblRows); - - //Set border format for each cell - for(int row = 0; row < tbl.getRows().size(); row++) - { - for (int cell = 0; cell < tbl.getRows().get_Item(row).size(); cell++) - { - tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().getFillFormat().setFillType(FillType.Solid); - tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().getFillFormat().getSolidFillColor().setColor(Color.RED); - tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().setWidth(5); - - tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().getFillFormat().setFillType(FillType.Solid); - tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().getFillFormat().getSolidFillColor().setColor(Color.RED); - tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().setWidth(5); - - tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().getFillFormat().setFillType(FillType.Solid); - tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().getFillFormat().getSolidFillColor().setColor(Color.RED); - tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().setWidth(5); - - tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().getFillFormat().setFillType(FillType.Solid); - tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().getFillFormat().getSolidFillColor().setColor(Color.RED); - tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().setWidth(5); - } - } - //Merge cells 1 & 2 of row 1 - tbl.mergeCells(tbl.getRows().get_Item(0).get_Item(0), tbl.getRows().get_Item(1).get_Item(0), false); - - //Add Text1 to the merged cell - tbl.getRows().get_Item(0).get_Item(0).getTextFrame().setText("Merged Cells"); - - //Save PPTX to Disk - pres.save(dataDir+ "table.pptx", SaveFormat.Pptx); - System.out.println("Program executed successfully"); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/CustomFonts.java b/Examples/src/main/java/com/aspose/slides/examples/Text/CustomFonts.java deleted file mode 100644 index e6348165..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/CustomFonts.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text; - -import com.aspose.slides.examples.Utils; - -public class CustomFonts -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(CustomFonts.class); - - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/DefaultFonts.java b/Examples/src/main/java/com/aspose/slides/examples/Text/DefaultFonts.java deleted file mode 100644 index 70041789..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/DefaultFonts.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.io.File; - -public class DefaultFonts -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(DefaultFonts.class); - - //Use load options to define the default regualr and asian fonts - LoadOptions lo = new LoadOptions(LoadFormat.Auto); - lo.setDefaultRegularFont("Wingdings"); - lo.setDefaultAsianFont("Wingdings"); - - //Do Some work and perform Presentation1/Slides1 rendering - Presentation presentation = new Presentation(dataDir+ "input.pptx"); - - //Generate slide thumbnail - BufferedImage image = presentation.getSlides().get_Item(0).getThumbnail(1, 1); - ImageIO.write(image, "png", new File(dataDir+ "output.png")); - - //Generate PDF - presentation.save("output.pdf", SaveFormat.Pdf); - - //Generate XPS - presentation.save(dataDir+ "output.xps", SaveFormat.Xps); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/FontFamily.java b/Examples/src/main/java/com/aspose/slides/examples/Text/FontFamily.java deleted file mode 100644 index 6e58ecda..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/FontFamily.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class FontFamily -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(FontFamily.class); - - //Instantiate a Presentation object that represents a PPTX file - Presentation pres = new Presentation(); - - //Get first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add an AutoShape of Rectangle type - IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 50, 200, 50); - - //Remove any fill style associated with the AutoShape - ashp.getFillFormat().setFillType(FillType.NoFill); - - //Access the TextFrame associated with the AutoShape - ITextFrame tf = ashp.getTextFrame(); - tf.setText("Aspose TextBox"); - - //Access the Portion associated with the TextFrame - IPortion port = tf.getParagraphs().get_Item(0).getPortions().get_Item(0); - - //Set the Font for the Portion - port.getPortionFormat().setLatinFont(new FontData("Times New Roman")); - - //Set Bold property of the Font - port.getPortionFormat().setFontBold(NullableBool.True); - - //Set Italic property of the Font - port.getPortionFormat().setFontItalic(NullableBool.True); - - //Set Underline property of the Font - port.getPortionFormat().setFontUnderline(TextUnderlineType.Single); - - //Set the Height of the Font - port.getPortionFormat().setFontHeight(25); - - //Set the color of the Font - port.getPortionFormat().getFillFormat().setFillType(FillType.Solid); - port.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); - - //Save the Presentation1 to disk - pres.save(dataDir+ "pptxFont.pptx", SaveFormat.Pptx); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/FontProperties.java b/Examples/src/main/java/com/aspose/slides/examples/Text/FontProperties.java deleted file mode 100644 index d28141ea..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/FontProperties.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text; - - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class FontProperties -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(FontProperties.class); - - //Instantiate a Presentation object that represents a PPTX file - Presentation pres = new Presentation(dataDir+ "welcome.pptx"); - - //Accessing a slide using its slide position - ISlide slide = pres.getSlides().get_Item(0); - - //Accessing the first and second placeholder in the slide and typecasting it as AutoShape - ITextFrame tf1 = ((IAutoShape)slide.getShapes().get_Item(0)).getTextFrame(); - ITextFrame tf2 = ((IAutoShape)slide.getShapes().get_Item(1)).getTextFrame(); - - //Accessing the first Paragraph - IParagraph para1 = tf1.getParagraphs().get_Item(0); - IParagraph para2 = tf2.getParagraphs().get_Item(0); - - //Accessing the first portion - IPortion port1 = para1.getPortions().get_Item(0); - IPortion port2 = para2.getPortions().get_Item(0); - - //Define new fonts - FontData fd1 = new FontData("Elephant"); - FontData fd2 = new FontData("Castellar"); - - //Assign new fonts to portion - port1.getPortionFormat().setLatinFont(fd1); - port2.getPortionFormat().setLatinFont(fd2); - - //Set font to Bold - port1.getPortionFormat().setFontBold(NullableBool.True); - port2.getPortionFormat().setFontBold(NullableBool.True); - - //Set font to Italic - port1.getPortionFormat().setFontItalic(NullableBool.True); - port2.getPortionFormat().setFontItalic(NullableBool.True); - - //Set font color - port1.getPortionFormat().getFillFormat().setFillType(FillType.Solid); - port1.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); - port2.getPortionFormat().getFillFormat().setFillType(FillType.Solid); - port2.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.GREEN); - - //Save the PPTX to disk - pres.save(dataDir+ "WelcomeFont.pptx", SaveFormat.Pptx); - - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/HTMLText/ExportParagraphText.java b/Examples/src/main/java/com/aspose/slides/examples/Text/HTMLText/ExportParagraphText.java deleted file mode 100644 index 792e453e..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/HTMLText/ExportParagraphText.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text.HTMLText; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.io.FileOutputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; - -public class ExportParagraphText -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ExportParagraphText.class); - - //Load the Presentation1 file - Presentation pres = new Presentation(dataDir+ "input.pptx"); - - //Acesss the default first slide of Presentation1 - ISlide slide = pres.getSlides().get_Item(0); - - //Desired index - int index=0; - - //Accessing the added shape - IAutoShape ashape = (IAutoShape)slide.getShapes().get_Item(index); - - try{ - //Creating output html file - OutputStream os = new FileOutputStream(dataDir+ "first paragraph_Java.html"); - Writer writer = new OutputStreamWriter(os,"UTF-8"); - - // Extracting first paragraph as HTML - //Writing Paragraphs data to HTML by providing paragraph starting index, total paragraphs to be copied - writer.write(ashape.getTextFrame().getParagraphs().exportToHtml(0, ashape.getTextFrame().getParagraphs().getCount(), null)); - writer.close(); - } - catch(Exception fo) - { - fo.printStackTrace(); - - } - - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/HTMLText/ImportHTMLText.java b/Examples/src/main/java/com/aspose/slides/examples/Text/HTMLText/ImportHTMLText.java deleted file mode 100644 index 5594fb1b..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/HTMLText/ImportHTMLText.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text.HTMLText; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.io.*; - -public class ImportHTMLText -{ - public static void main(String[] args) throws Exception { - - // The path to the documents directory. - String dataDir = Utils.getDataDir(ImportHTMLText.class); - - //Create Empty Presentation1 instance//Create Empty Presentation1 instance - Presentation pres = new Presentation(); - - //Acesss the default first slide of Presentation1 - ISlide slide = pres.getSlides().get_Item(0); - - //Adding the AutoShape to accomodate the HTML content - IAutoShape ashape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 10, 10, (float) pres.getSlideSize().getSize().getWidth(), (float) pres.getSlideSize().getSize().getHeight()); - - ashape.getFillFormat().setFillType(FillType.NoFill); - - //Adding Text1 frame to the shape - ashape.addTextFrame(""); - - //Clearing all paragraphs in added Text1 frame - ashape.getTextFrame().getParagraphs().clear(); - - //Loading the HTML file using InputStream - InputStream inputStream = new FileInputStream(dataDir + "html from pp2010 clipboard.html"); - Reader reader = new InputStreamReader(inputStream); - - int data = reader.read(); - String content = ReadFile(dataDir + "html from pp2010 clipboard.html"); - - //Adding Text1 from HTML stream reader in Text1 frame - ashape.getTextFrame().getParagraphs().addFromHtml(content); - - //Saving Presentation - pres.save(dataDir + "output.pptx", SaveFormat.Pptx); - } - - - public static String ReadFile(String FileName) throws Exception - { - - File file = new File(FileName); - StringBuilder contents = new StringBuilder(); - BufferedReader reader = null; - - try { - reader = new BufferedReader(new FileReader(file)); - String text = null; - - // repeat until all lines is read - while ((text = reader.readLine()) != null) { - contents.append(text) - .append(System.getProperty( - "line.separator")); - } - } catch (IOException e) { - e.printStackTrace(); - } finally { - try { - if (reader != null) { - reader.close(); - } - } catch (IOException e) { - e.printStackTrace(); - return null; - } - } - - return contents.toString(); - - - } - } - - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/MultipleParagraphs.java b/Examples/src/main/java/com/aspose/slides/examples/Text/MultipleParagraphs.java deleted file mode 100644 index d860f9fd..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/MultipleParagraphs.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class MultipleParagraphs -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(MultipleParagraphs.class); - - //Instantiate a Presentation class that represents a PPTX file - Presentation pres = new Presentation(); - - //Accessing first slide - ISlide slide = pres.getSlides().get_Item(0); - - //Add an AutoShape of Rectangle type - IAutoShape ashp = slide.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 300, 150); - - //Access TextFrame of the AutoShape - ITextFrame tf = ashp.getTextFrame(); - - //Create Paragraphs and Portions with different Text1 formats - IParagraph para0 = tf.getParagraphs().get_Item(0); - IPortion port01 = new Portion(); - IPortion port02 = new Portion(); - para0.getPortions().add(port01); - para0.getPortions().add(port02); - - IParagraph para1 = new Paragraph(); - tf.getParagraphs().add(para1); - IPortion port10 = new Portion(); - IPortion port11 = new Portion(); - IPortion port12 = new Portion(); - para1.getPortions().add(port10); - para1.getPortions().add(port11); - para1.getPortions().add(port12); - - IParagraph para2 = new Paragraph(); - tf.getParagraphs().add(para2); - IPortion port20 = new Portion(); - IPortion port21 = new Portion(); - IPortion port22 = new Portion(); - para2.getPortions().add(port20); - para2.getPortions().add(port21); - para2.getPortions().add(port22); - - for (int i = 0; i < 3; i++) - for (int j = 0; j < 3; j++) - { - tf.getParagraphs().get_Item(i).getPortions().get_Item(j).setText("Portion0" + j); - if (j == 0) - { - tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().getFillFormat().setFillType(FillType.Solid); - tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.RED); - tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().setFontBold(NullableBool.True); - tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().setFontHeight(15); - } - else if (j == 1) - { - tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().getFillFormat().setFillType(FillType.Solid); - tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); - tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().setFontItalic(NullableBool.True); - tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().setFontHeight(18); - } - } - - //SavePPTX to Disk - pres.save(dataDir+ "multiParaPort.pptx", SaveFormat.Pptx); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/ParagraphBullets.java b/Examples/src/main/java/com/aspose/slides/examples/Text/ParagraphBullets.java deleted file mode 100644 index 2eeae514..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/ParagraphBullets.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class ParagraphBullets -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ParagraphBullets.class); - - //Instantiate a Presentation class that represents a PPTX file - Presentation pres = new Presentation(); - - //Accessing first slide - ISlide slide = pres.getSlides().get_Item(0); - - //Adding and accessing Autoshape - IAutoShape aShp = slide.getShapes().addAutoShape(ShapeType.Rectangle, 200, 200, 400, 200); - - //Accessing the Text1 frame of created autoshape - ITextFrame txtFrm = aShp.getTextFrame(); - - //Removing the default exisiting paragraph - txtFrm.getParagraphs().removeAt(0); - - //Creating a paragraph - Paragraph para = new Paragraph(); - - //Setting paragraph bullet style and symbol - para.getParagraphFormat().getBullet().setType(BulletType.Symbol); - para.getParagraphFormat().getBullet().setChar((char) 8226); - - //Setting paragraph Text1 - para.setText("Welcome to Aspose.Slides"); - - //Setting bullet indent - para.getParagraphFormat().setIndent(25); - - //Setting bullet color - para.getParagraphFormat().getBullet().getColor().setColorType(ColorType.RGB); - para.getParagraphFormat().getBullet().getColor().setColor(Color.BLACK); - - // set IsBulletHardColor to true to use own bullet color - para.getParagraphFormat().getBullet().isBulletHardColor(NullableBool.True); - - //Setting Bullet Height - para.getParagraphFormat().getBullet().setHeight(100); - - //Adding Paragraph to Text1 frame - txtFrm.getParagraphs().add(para); - - //Creating second paragraph - Paragraph para2 = new Paragraph(); - - //Setting paragraph bullet type and style - para2.getParagraphFormat().getBullet().setType(BulletType.Numbered); - para2.getParagraphFormat().getBullet().setNumberedBulletStyle(NumberedBulletStyle.BulletCircleNumWDBlackPlain); - - //Adding paragraph Text1 - para2.setText("This is numbered bullet"); - - //Setting bullet indent - para2.getParagraphFormat().setIndent(25); - - para2.getParagraphFormat().getBullet().getColor().setColorType(ColorType.RGB); - para2.getParagraphFormat().getBullet().getColor().setColor(Color.BLACK); - - // set IsBulletHardColor to true to use own bullet color - para2.getParagraphFormat().getBullet().isBulletHardColor(NullableBool.True); - - - //Setting Bullet Height - para2.getParagraphFormat().getBullet().setHeight(100); - - //Adding Paragraph to Text1 frame - txtFrm.getParagraphs().add(para2); - - //saving the Presentation1 as a PPTX file - pres.save(dataDir+ "Bullet.pptx", SaveFormat.Pptx); - - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/ParagraphIndent.java b/Examples/src/main/java/com/aspose/slides/examples/Text/ParagraphIndent.java deleted file mode 100644 index c9e35897..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/ParagraphIndent.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class ParagraphIndent -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ParagraphIndent.class); - - //Instantiate Presentation Class - Presentation pres = new Presentation(); - - //Get first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add a Rectangle Shape - IAutoShape rect = sld.getShapes().addAutoShape(ShapeType.Rectangle,100, 100, 500, 150); - - //Add TextFrame to the Rectangle - ITextFrame tf = rect.addTextFrame("This is first line \rThis is second line \rThis is third line"); - - //Set the Text1 to fit the shape - tf.getTextFrameFormat().setAutofitType(TextAutofitType.Shape); - - //Hide the lines of the Rectangle - rect.getLineFormat().getFillFormat().setFillType(FillType.Solid); - - //Get first Paragraph in the TextFrame and set its Indent - IParagraph para1 = tf.getParagraphs().get_Item(0); - - //Setting paragraph bullet style and symbol - para1.getParagraphFormat().getBullet().setType(BulletType.Symbol); - para1.getParagraphFormat().getBullet().setChar((char)(8226)); - para1.getParagraphFormat().setAlignment(TextAlignment.Left); - - para1.getParagraphFormat().setDepth((short)2); - para1.getParagraphFormat().setIndent(30); - - //Get second Paragraph in the TextFrame and set its Indent - IParagraph para2 = tf.getParagraphs().get_Item(1); - para2.getParagraphFormat().getBullet().setType(BulletType.Symbol); - para2.getParagraphFormat().getBullet().setChar((char)(8226)); - para2.getParagraphFormat().setAlignment(TextAlignment.Left); - para2.getParagraphFormat().setDepth((short)2); - para2.getParagraphFormat().setIndent(40); - - //Get third Paragraph in the TextFrame and set its Indent - IParagraph para3 = tf.getParagraphs().get_Item(2); - para3.getParagraphFormat().getBullet().setType(BulletType.Symbol); - para3.getParagraphFormat().getBullet().setChar((char)(8226)); - para3.getParagraphFormat().setAlignment(TextAlignment.Left); - para3.getParagraphFormat().setDepth((short)2); - para3.getParagraphFormat().setIndent(50); - - //Write the Presentation to disk - pres.save(dataDir+ "InOutDent.pptx", SaveFormat.Pptx); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/ParagraphsAlignment.java b/Examples/src/main/java/com/aspose/slides/examples/Text/ParagraphsAlignment.java deleted file mode 100644 index 1191f848..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/ParagraphsAlignment.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class ParagraphsAlignment -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ParagraphsAlignment.class); - - //Instantiate a Presentation object that represents a PPTX file - Presentation pres = new Presentation(dataDir+ "leftalign.pptx"); - - //Accessing first slide - ISlide slide = pres.getSlides().get_Item(0); - - //Accessing the first and second placeholder in the slide and typecasting it as AutoShape - ITextFrame tf1 = ((IAutoShape)slide.getShapes().get_Item(0)).getTextFrame(); - ITextFrame tf2 = ((IAutoShape)slide.getShapes().get_Item(1)).getTextFrame(); - - //Change the Text1 in both placeholders - tf1.setText("Center Align by Aspose"); - tf2.setText("Center Align by Aspose"); - - //Getting the first paragraph of the placeholders - IParagraph para1 = tf1.getParagraphs().get_Item(0); - IParagraph para2 = tf2.getParagraphs().get_Item(0); - - //Aligning the Text1 paragraph to center - para1.getParagraphFormat().setAlignment(TextAlignment.Center); - para2.getParagraphFormat().setAlignment(TextAlignment.Center); - - //Writing the Presentation1 as a PPTX file - pres.save(dataDir+ "Centeralign.pptx", SaveFormat.Pptx); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/ReplacingText.java b/Examples/src/main/java/com/aspose/slides/examples/Text/ReplacingText.java deleted file mode 100644 index 35288a75..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/ReplacingText.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class ReplacingText -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ReplacingText.class); - - //Instantiate Presentation class that represents PPTX - Presentation pres = new Presentation(dataDir+ "welcome.pptx"); - - //Access first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Iterate through Shapes1 to find the placeholder - for (IShape shp : sld.getShapes()) - if (shp.getPlaceholder() != null) - { - //Change the Text1 of each placeholder - ((IAutoShape)shp).getTextFrame().setText("This is Placeholder"); - } - - //Save the PPTX to Disk - pres.save(dataDir+ "welcome_PH.pptx", SaveFormat.Pptx); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/ShadowEffects.java b/Examples/src/main/java/com/aspose/slides/examples/Text/ShadowEffects.java deleted file mode 100644 index 019d67bd..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/ShadowEffects.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -import java.awt.*; - -public class ShadowEffects -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(ShadowEffects.class); - - //Create an instance of Presentation class - Presentation Pres = new Presentation(); - - //Get first slide - ISlide Slide = Pres.getSlides().get_Item(0); - - //Add an AutoShape of Rectangle type - IAutoShape aShp = Slide.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 150, 50); - - //Add TextFrame to the Rectangle - aShp.addTextFrame("Aspose TextBox"); - - // Disable shape fill in case we want to get shadow of Text1 - aShp.getFillFormat().setFillType(FillType.NoFill); - - // Add outer shadow and set all necessary parameters - aShp.getEffectFormat().enableOuterShadowEffect(); - IOuterShadow Shadow = aShp.getEffectFormat().getOuterShadowEffect(); - Shadow.setBlurRadius(4.0); - Shadow.setDirection(45); - Shadow.setDistance(3); - Shadow.setRectangleAlign(RectangleAlignment.TopLeft); - Shadow.getShadowColor().setColor(Color.black); - - //Write the Presentation1 to disk - Pres.save(dataDir+ "pres.pptx", SaveFormat.Pptx); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/TextBoxHyperlink.java b/Examples/src/main/java/com/aspose/slides/examples/Text/TextBoxHyperlink.java deleted file mode 100644 index ae012e50..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/TextBoxHyperlink.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class TextBoxHyperlink -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(TextBoxHyperlink.class); - - //Instantiate Presentation class that represents PPTX - Presentation pres = new Presentation(); - - //Access first slide - ISlide slide = pres.getSlides().get_Item(0); - - //Add an AutoShape of Rectangle Type - IShape pptxShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 150, 150, 150, 50); - - //Cast the shape to AutoShape - IAutoShape pptxAutoShape = (IAutoShape)pptxShape; - - //Access ITextFrame associated with the AutoShape - pptxAutoShape.addTextFrame(""); - - ITextFrame ITextFrame = pptxAutoShape.getTextFrame(); - - //Add some Text1 to the frame - ITextFrame.getParagraphs().get_Item(0).getPortions().get_Item(0).setText("Aspose.Slides"); - - //Set Hyperlink for the portion Text1 - IHyperlinkManager HypMan = ITextFrame.getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getHyperlinkManager(); - HypMan.setExternalHyperlinkClick("http://www.aspose.com"); - - //Save the PPTX to Disk - pres.save(dataDir+ "hLinkPPTX.pptx", SaveFormat.Pptx); - - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Text/TextBoxOnSlide.java b/Examples/src/main/java/com/aspose/slides/examples/Text/TextBoxOnSlide.java deleted file mode 100644 index c148a6f6..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Text/TextBoxOnSlide.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. - * - * This file is part of Aspose.Slides. The source code in this file - * is only intended as a supplement to the documentation, and is provided - * "as is", without warranty of any kind, either expressed or implied. - */ - -package com.aspose.slides.examples.Text; - -import com.aspose.slides.*; -import com.aspose.slides.examples.Utils; - -public class TextBoxOnSlide -{ - public static void main(String[] args) throws Exception - { - // The path to the documents directory. - String dataDir = Utils.getDataDir(TextBoxOnSlide.class); - - //Instantiate Presentation class that represents PPTX - Presentation pres = new Presentation(); - - //Access first slide - ISlide sld = pres.getSlides().get_Item(0); - - //Add an AutoShape of Rectangle type - IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 150, 50); - - //Add TextFrame to the Rectangle - ashp.addTextFrame(" "); - - //Accessing the Text1 frame - ITextFrame txtFrame = ashp.getTextFrame(); - - //Create the Paragraph object for Text1 frame - IParagraph para = txtFrame.getParagraphs().get_Item(0); - - //Create Portion object for paragraph - IPortion portion = para.getPortions().get_Item(0); - - //Set Text - portion.setText("Aspose TextBox"); - - //Save the PPTX to Disk - pres.save(dataDir+ "Textbox.pptx", SaveFormat.Pptx); - } -} - - - - diff --git a/Examples/src/main/java/com/aspose/slides/examples/Utils.java b/Examples/src/main/java/com/aspose/slides/examples/Utils.java deleted file mode 100644 index f2595948..00000000 --- a/Examples/src/main/java/com/aspose/slides/examples/Utils.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.aspose.slides.examples; - -import com.aspose.slides.License; - -import java.io.File; - -public class Utils { - - public static String getDataDir(Class c) { - File dir = new File(System.getProperty("user.dir")); - dir = new File(dir, "src"); - dir = new File(dir, "main"); - dir = new File(dir, "resources"); - - for (String s : c.getName().split("\\.")) { - dir = new File(dir, s); - if (dir.isDirectory() == false) - dir.mkdir(); - } - - System.out.println("Using data directory: " + dir.toString()); - return dir.toString() + File.separator; - } -} diff --git a/Examples/src/main/java/com/aspose/slides/examples/activex/LinkingVideoActiveXControl.java b/Examples/src/main/java/com/aspose/slides/examples/activex/LinkingVideoActiveXControl.java new file mode 100644 index 00000000..c799ea53 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/activex/LinkingVideoActiveXControl.java @@ -0,0 +1,49 @@ +package com.aspose.slides.examples.activex; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class LinkingVideoActiveXControl +{ + public static void main(String[] args) + { + //ExStart:LinkingVideoActiveXControl + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_ActiveX(); + String dataVideo = RunExamples.getDataDir_Video(); + + // Instantiate Presentation class that represents PPTX file + Presentation presentation = new Presentation(dataDir + "template.pptx"); + try + { + // Create empty presentation instance + Presentation newPresentation = new Presentation(); + try + { + + // Remove default slide + newPresentation.getSlides().removeAt(0); + + // Clone slide with Media Player ActiveX Control + newPresentation.getSlides().insertClone(0, presentation.getSlides().get_Item(0)); + + // Access the Media Player ActiveX control and set the video path + newPresentation.getSlides().get_Item(0).getControls().get_Item(0).getProperties().set_Item("URL", dataVideo + "Wildlife.mp4"); + + // Save the Presentation + newPresentation.save(dataDir + "LinkingVideoActiveXControl_out.pptx", SaveFormat.Pptx); + } + finally + { + if (newPresentation != null) newPresentation.dispose(); + } + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:LinkingVideoActiveXControl + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/activex/ManageActiveXControl.java b/Examples/src/main/java/com/aspose/slides/examples/activex/ManageActiveXControl.java new file mode 100644 index 00000000..90612f0e --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/activex/ManageActiveXControl.java @@ -0,0 +1,153 @@ +package com.aspose.slides.examples.activex; + + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import javax.imageio.ImageIO; +import java.awt.SystemColor; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +public class ManageActiveXControl +{ + public static void main(String[] args) + { + //ExStart:ManageActiveXControl + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_ActiveX(); + + // Accessing the presentation with ActiveX controls + Presentation presentation = new Presentation(dataDir + "ActiveX.pptm"); + + try + { + // Accessing the first slide in presentation + ISlide slide = presentation.getSlides().get_Item(0); + + // changing TextBox text + IControl control = slide.getControls().get_Item(0); + + if ("TextBox1".equals(control.getName()) && control.getProperties() != null) + { + String newText = "Changed text"; + control.getProperties().set_Item("Value", newText); + + // Changing substitute image. PowerPoint will replace this image during activeX activation, + // so sometime it's OK to leave image unchanged. + BufferedImage image = new BufferedImage((int) control.getFrame().getWidth(), (int) control.getFrame().getHeight(), + BufferedImage.TYPE_INT_ARGB); + + Graphics graphics = image.getGraphics(); + graphics.setColor(SystemColor.window); + graphics.fillRect(0, 0, image.getWidth(), image.getHeight()); + + Font font = new Font(control.getProperties().get_Item("FontName"), Font.PLAIN, 16); + graphics.setColor(SystemColor.windowText); + graphics.setFont(font); + graphics.drawString(newText, 10, 20); + + graphics.setColor(SystemColor.controlShadow); + graphics.drawLine(0, image.getHeight() - 1, 0, 0); + graphics.drawLine(0, 0, image.getWidth() - 1, 0); + + graphics.setColor(SystemColor.controlDkShadow); + graphics.drawLine(1, image.getHeight() - 2, 1, 1); + graphics.drawLine(1, 1, image.getWidth() - 2, 1); + + graphics.setColor(SystemColor.controlHighlight); + graphics.drawLine(1, image.getHeight() - 1, image.getWidth() - 1, image.getHeight() - 1); + graphics.drawLine(image.getWidth() - 1, image.getHeight() - 1, image.getWidth() - 1, 1); + + graphics.setColor(SystemColor.controlLtHighlight); + graphics.drawLine(0, image.getHeight(), image.getWidth(), image.getHeight()); + graphics.drawLine(image.getWidth(), image.getHeight(), image.getWidth(), 0); + + graphics.dispose(); + + final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + try { + ImageIO.write(image, "PNG", byteArrayOutputStream); + } catch (IOException e) { + e.printStackTrace(); + } + IImage img = Images.fromData(byteArrayOutputStream.toByteArray()); + control.getSubstitutePictureFormat().getPicture().setImage(presentation.getImages().addImage(img)); + } + + // Changing Button caption + control = presentation.getSlides().get_Item(0).getControls().get_Item(1); + + if (control.getName().equalsIgnoreCase("CommandButton1") && control.getProperties() != null) + { + String newCaption = "Show MessageBox"; + control.getProperties().set_Item("Caption", newCaption); + // Changing substitute + BufferedImage image = new BufferedImage((int) control.getFrame().getWidth(), (int) control.getFrame().getHeight(), + BufferedImage.TYPE_INT_ARGB); + Graphics graphics = image.getGraphics(); + graphics.setColor(SystemColor.control); + graphics.fillRect(0, 0, image.getWidth(), image.getHeight()); + + Font font = new Font(control.getProperties().get_Item("FontName"), Font.PLAIN, 16); + graphics.setColor(SystemColor.windowText); + graphics.setFont(font); + FontMetrics metrics = graphics.getFontMetrics(font); + graphics.drawString(newCaption, (image.getWidth() - metrics.stringWidth(newCaption)) / 2, 20); + + graphics.setColor(SystemColor.controlLtHighlight); + graphics.drawLine(0, image.getHeight() - 1, 0, 0); + graphics.drawLine(0, 0, image.getWidth() - 1, 0); + + graphics.setColor(SystemColor.controlHighlight); + graphics.drawLine(1, image.getHeight() - 2, 1, 1); + graphics.drawLine(1, 1, image.getWidth() - 2, 1); + + graphics.setColor(SystemColor.controlShadow); + graphics.drawLine(1, image.getHeight() - 1, image.getWidth() - 1, image.getHeight() - 1); + graphics.drawLine(image.getWidth() - 1, image.getHeight() - 1, image.getWidth() - 1, 1); + + graphics.setColor(SystemColor.controlDkShadow); + graphics.drawLine(0, image.getHeight(), image.getWidth(), image.getHeight()); + graphics.drawLine(image.getWidth(), image.getHeight(), image.getWidth(), 0); + + graphics.dispose(); + + final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + try { + ImageIO.write(image, "PNG", byteArrayOutputStream); + } catch (IOException e) { + e.printStackTrace(); + } + IImage img = Images.fromData(byteArrayOutputStream.toByteArray()); + control.getSubstitutePictureFormat().getPicture().setImage(presentation.getImages().addImage(img)); + } + + // Moving ActiveX frames 100 points down + for (IControl ctl : slide.getControls()) + { + IShapeFrame frame = control.getFrame(); + control.setFrame(new ShapeFrame( + frame.getX(), frame.getY() + 100, frame.getWidth(), frame.getHeight(), + frame.getFlipH(), frame.getFlipV(), frame.getRotation())); + } + + // Save the presentation with Edited ActiveX Controls + presentation.save(RunExamples.getOutPath() + "withActiveX-edited_out.pptm", SaveFormat.Pptm); + + // Now removing controls + slide.getControls().clear(); + + // Saving the presentation with cleared ActiveX controls + presentation.save(RunExamples.getOutPath() + "withActiveX.cleared_out.pptm", SaveFormat.Pptm); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ManageActiveXControl + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/applylicense/MeteredLicensing.java b/Examples/src/main/java/com/aspose/slides/examples/applylicense/MeteredLicensing.java new file mode 100644 index 00000000..76efb736 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/applylicense/MeteredLicensing.java @@ -0,0 +1,46 @@ +package com.aspose.slides.examples.applylicense; + +import com.aspose.slides.Metered; + +import java.util.logging.Level; +import java.util.logging.Logger; + +public class MeteredLicensing +{ + + public static void main(String[] args) + { + //ExStart:MeteredLicensing + + // Create an instance of CAD Metered class + Metered metered = new Metered(); + + try + { + // Access the setMeteredKey property and pass public and private keys as parameters + metered.setMeteredKey("*****", "*****"); + + // Get metered data amount before calling API + double amountbefore = Metered.getConsumptionQuantity(); + + // Display information + System.out.println("Amount Consumed Before: " + amountbefore); + // Get metered data amount After calling API + double amountafter = Metered.getConsumptionQuantity(); + + // Display information + System.out.println("Amount Consumed After: " + amountafter); + + // Print status of a Metered license. + System.out.println("Is metered license accepted: " + Metered.isMeteredLicensed()); + + } + catch (Exception ex) + { + Logger.getLogger(MeteredLicensing.class.getName()).log(Level.SEVERE, null, ex); + } + //ExEnd:MeteredLicensing + } + +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/AddColorToDataPoints.java b/Examples/src/main/java/com/aspose/slides/examples/charts/AddColorToDataPoints.java new file mode 100644 index 00000000..b7cbeafc --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/AddColorToDataPoints.java @@ -0,0 +1,50 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AddColorToDataPoints +{ + public static void main(String[] args) + { + + //ExStart:AddColorToDataPoints + + Presentation pres = new Presentation(); + try + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Sunburst, 100, 100, 450, 400); + + IChartDataPointCollection dataPoints = chart.getChartData().getSeries().get_Item(0).getDataPoints(); + dataPoints.get_Item(3).getDataPointLevels().get_Item(0).getLabel().getDataLabelFormat().setShowValue(true); + + + IDataLabel branch1Label = dataPoints.get_Item(0).getDataPointLevels().get_Item(2).getLabel(); + branch1Label.getDataLabelFormat().setShowCategoryName(false); + branch1Label.getDataLabelFormat().setShowSeriesName(true); + + branch1Label.getDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().setFillType(FillType.Solid); + branch1Label.getDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().getSolidFillColor().setColor(java.awt.Color.YELLOW); + + + IFormat steam4Format = dataPoints.get_Item(9).getFormat(); + steam4Format.getFill().setFillType(FillType.Solid); + + steam4Format.getFill().getSolidFillColor().setColor(com.aspose.cells.Color.fromArgb(0, 176, 240, 255).d());//TODO + + pres.save(dataDir + "AddColorToDataPoints.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AddColorToDataPoints + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/AddCustomError.java b/Examples/src/main/java/com/aspose/slides/examples/charts/AddCustomError.java new file mode 100644 index 00000000..1620e224 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/AddCustomError.java @@ -0,0 +1,57 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AddCustomError +{ + public static void main(String[] args) + { + //ExStart:AddCustomError + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Creating empty presentation + Presentation presentation = new Presentation(); + try + { + // Creating a bubble chart + IChart chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.Bubble, 50, 50, 400, 300, true); + + // Adding custom Error bars and setting its format + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + IErrorBarsFormat errBarX = series.getErrorBarsXFormat(); + IErrorBarsFormat errBarY = series.getErrorBarsYFormat(); + errBarX.setVisible(true); + errBarY.setVisible(true); + errBarX.setValueType(ErrorBarValueType.Custom); + errBarY.setValueType(ErrorBarValueType.Custom); + + // Accessing chart series data point and setting error bars values for individual point + IChartDataPointCollection points = series.getDataPoints(); + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForXPlusValues(DataSourceType.DoubleLiterals); + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForXMinusValues(DataSourceType.DoubleLiterals); + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForYPlusValues(DataSourceType.DoubleLiterals); + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForYMinusValues(DataSourceType.DoubleLiterals); + + // Setting error bars for chart series points + for (int i = 0; i < points.size(); i++) + { + points.get_Item(i).getErrorBarsCustomValues().getXMinus().setAsLiteralDouble(i + 1); + points.get_Item(i).getErrorBarsCustomValues().getXPlus().setAsLiteralDouble(i + 1); + points.get_Item(i).getErrorBarsCustomValues().getYMinus().setAsLiteralDouble(i + 1); + points.get_Item(i).getErrorBarsCustomValues().getYPlus().setAsLiteralDouble(i + 1); + } + + // Saving presentation + presentation.save(dataDir + "ErrorBarsCustomValues_out.pptx", SaveFormat.Pptx); + + //ExEnd:AddCustomError + } + finally + { + if (presentation != null) presentation.dispose(); + } + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/AddDoughnutCallout.java b/Examples/src/main/java/com/aspose/slides/examples/charts/AddDoughnutCallout.java new file mode 100644 index 00000000..9eca9cb6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/AddDoughnutCallout.java @@ -0,0 +1,74 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class AddDoughnutCallout +{ + public static void main(String[] args) + { + //ExStart:AddDoughnutCallout + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "testc.pptx"); + ISlide slide = pres.getSlides().get_Item(0); + IChart chart = slide.getShapes().addChart(ChartType.Doughnut, 10, 10, 500, 500, false); + IChartDataWorkbook workBook = chart.getChartData().getChartDataWorkbook(); + chart.getChartData().getSeries().clear(); + chart.getChartData().getCategories().clear(); + chart.setLegend(false); + int seriesIndex = 0; + while (seriesIndex < 15) + { + IChartSeries series = chart.getChartData().getSeries().add(workBook.getCell(0, 0, seriesIndex + 1, "SERIES " + seriesIndex), chart.getType()); + series.setExplosion(0); + series.getParentSeriesGroup().setDoughnutHoleSize((byte) 20); + series.getParentSeriesGroup().setFirstSliceAngle(351); + seriesIndex++; + } + int categoryIndex = 0; + while (categoryIndex < 15) + { + chart.getChartData().getCategories().add(workBook.getCell(0, categoryIndex + 1, 0, "CATEGORY " + categoryIndex)); + int i = 0; + while (i < chart.getChartData().getSeries().size()) + { + IChartSeries iCS = chart.getChartData().getSeries().get_Item(i); + IChartDataPoint dataPoint = iCS.getDataPoints().addDataPointForDoughnutSeries(workBook.getCell(0, categoryIndex + 1, i + 1, 1)); + dataPoint.getFormat().getFill().setFillType(FillType.Solid); + dataPoint.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); + dataPoint.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.WHITE); + dataPoint.getFormat().getLine().setWidth(1); + dataPoint.getFormat().getLine().setStyle(LineStyle.Single); + dataPoint.getFormat().getLine().setDashStyle(LineDashStyle.Solid); + if (i == chart.getChartData().getSeries().size() - 1) + { + IDataLabel lbl = dataPoint.getLabel(); + lbl.getTextFormat().getTextBlockFormat().setAutofitType(TextAutofitType.Shape); + lbl.getDataLabelFormat().getTextFormat().getPortionFormat().setFontBold(NullableBool.True); + lbl.getDataLabelFormat().getTextFormat().getPortionFormat().setLatinFont(new FontData("DINPro-Bold")); + lbl.getDataLabelFormat().getTextFormat().getPortionFormat().setFontHeight(12); + lbl.getDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().setFillType(FillType.Solid); + lbl.getDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.LIGHT_GRAY); + lbl.getDataLabelFormat().getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.WHITE); + lbl.getDataLabelFormat().setShowValue(false); + lbl.getDataLabelFormat().setShowCategoryName(true); + lbl.getDataLabelFormat().setShowSeriesName(false); + //lbl.getDataLabelFormat().setShowLabelAsDataCallout(true); + lbl.getDataLabelFormat().setShowLeaderLines(true); + lbl.getDataLabelFormat().setShowLabelAsDataCallout(false); + chart.validateChartLayout(); + lbl.setX(lbl.getX() + (float) 0.5); + lbl.setY(lbl.getY() + (float) 0.5); + } + i++; + } + categoryIndex++; + } + pres.save(dataDir + "chart.pptx", SaveFormat.Pptx); + + } + //ExEnd:AddDoughnutCallout +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/AddErrorBars.java b/Examples/src/main/java/com/aspose/slides/examples/charts/AddErrorBars.java new file mode 100644 index 00000000..9ba1da43 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/AddErrorBars.java @@ -0,0 +1,44 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AddErrorBars +{ + public static void main(String[] args) + { + //ExStart:AddErrorBars + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Creating empty presentation + Presentation presentation = new Presentation(); + try + { + // Creating a bubble chart + IChart chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.Bubble, 50, 50, 400, 300, true); + + // Adding Error bars and setting its format + IErrorBarsFormat errBarX = chart.getChartData().getSeries().get_Item(0).getErrorBarsXFormat(); + IErrorBarsFormat errBarY = chart.getChartData().getSeries().get_Item(0).getErrorBarsYFormat(); + errBarX.setVisible(true); + errBarY.setVisible(true); + errBarX.setValueType(ErrorBarValueType.Fixed); + errBarX.setValue(0.1f); + errBarY.setValueType(ErrorBarValueType.Percentage); + errBarY.setValue(5); + errBarX.setType(ErrorBarType.Plus); + errBarY.getFormat().getLine().setWidth(2); + errBarX.setEndCap(true); + + // Saving presentation + presentation.save(dataDir + "ErrorBars_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AddErrorBars + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/AddingCustomLines.java b/Examples/src/main/java/com/aspose/slides/examples/charts/AddingCustomLines.java new file mode 100644 index 00000000..a9d16f29 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/AddingCustomLines.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class AddingCustomLines +{ + public static void main(String[] args) + { + + //ExStart:AddingCustomLines + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 500, 400); + IAutoShape shape = chart.getUserShapes().getShapes().addAutoShape(ShapeType.Line, 0, chart.getHeight() / 2, chart.getWidth(), 0); + shape.getLineFormat().getFillFormat().setFillType(FillType.Solid); + shape.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.RED); + pres.save(dataDir + "AddCustomLines.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AddingCustomLines + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/AnimatingCategoriesElements.java b/Examples/src/main/java/com/aspose/slides/examples/charts/AnimatingCategoriesElements.java new file mode 100644 index 00000000..90961328 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/AnimatingCategoriesElements.java @@ -0,0 +1,48 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AnimatingCategoriesElements +{ + public static void main(String[] args) + { + //ExStart:AnimatingCategoriesElements + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + Presentation presentation = new Presentation(dataDir + "ExistingChart.pptx"); + try + { + // Get reference of the chart object + ISlide slide = presentation.getSlides().get_Item(0); + IShapeCollection shapes = slide.getShapes(); + IChart chart = (IChart) shapes.get_Item(0); + + // Animate categories' elements + slide.getTimeline().getMainSequence().addEffect(chart, EffectType.Fade, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInCategory, 0, 0, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInCategory, 0, 1, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInCategory, 0, 2, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInCategory, 0, 3, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInCategory, 1, 0, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInCategory, 1, 1, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInCategory, 1, 2, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInCategory, 1, 3, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInCategory, 2, 0, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInCategory, 2, 1, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInCategory, 2, 2, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInCategory, 2, 3, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + + // Write the presentation file to disk + presentation.save(dataDir + "AnimatingCategoriesElements_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AnimatingCategoriesElements + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/AnimatingSeries.java b/Examples/src/main/java/com/aspose/slides/examples/charts/AnimatingSeries.java new file mode 100644 index 00000000..1f17f7fb --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/AnimatingSeries.java @@ -0,0 +1,53 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AnimatingSeries +{ + public static void main(String[] args) + { + //ExStart:AnimatingSeries + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Instantiate Presentation class that represents a presentation file + Presentation presentation = new Presentation(dataDir + "ExistingChart.pptx"); + try + { + // Get reference of the chart object + ISlide slide = presentation.getSlides().get_Item(0); + IShapeCollection shapes = slide.getShapes(); + IChart chart = (IChart) shapes.get_Item(0); + + // Animate the series + slide.getTimeline().getMainSequence().addEffect(chart, EffectType.Fade, EffectSubtype.None, + EffectTriggerType.AfterPrevious); + + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, + EffectChartMajorGroupingType.BySeries, 0, + EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, + EffectChartMajorGroupingType.BySeries, 1, + EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, + EffectChartMajorGroupingType.BySeries, 2, + EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, + EffectChartMajorGroupingType.BySeries, 3, + EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + + // Write the modified presentation to disk + presentation.save(dataDir + "AnimatingSeries_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AnimatingSeries + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/AnimatingSeriesElements.java b/Examples/src/main/java/com/aspose/slides/examples/charts/AnimatingSeriesElements.java new file mode 100644 index 00000000..19bb1757 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/AnimatingSeriesElements.java @@ -0,0 +1,51 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AnimatingSeriesElements +{ + public static void main(String[] args) + { + //ExStart:AnimatingSeriesElements + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Load a presentation + Presentation presentation = new Presentation(dataDir + "ExistingChart.pptx"); + try + { + // Get reference of the chart object + ISlide slide = presentation.getSlides().get_Item(0); + IShapeCollection shapes = slide.getShapes(); + IChart chart = (IChart) shapes.get_Item(0); + + // Animate series elements + slide.getTimeline().getMainSequence().addEffect(chart, EffectType.Fade, EffectSubtype.None, EffectTriggerType.AfterPrevious); + + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInSeries, 0, 0, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInSeries, 0, 1, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInSeries, 0, 2, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInSeries, 0, 3, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInSeries, 1, 0, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInSeries, 1, 1, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInSeries, 1, 2, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInSeries, 1, 3, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInSeries, 2, 0, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInSeries, 2, 1, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInSeries, 2, 2, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + ((Sequence) slide.getTimeline().getMainSequence()).addEffect(chart, EffectChartMinorGroupingType.ByElementInSeries, 2, 3, EffectType.Appear, EffectSubtype.None, EffectTriggerType.AfterPrevious); + + // Write the presentation file to disk + presentation.save(dataDir + "AnimatingSeriesElements_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AnimatingSeriesElements + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/AutomaticChartSeriescolor.java b/Examples/src/main/java/com/aspose/slides/examples/charts/AutomaticChartSeriescolor.java new file mode 100644 index 00000000..5053ca2d --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/AutomaticChartSeriescolor.java @@ -0,0 +1,84 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class AutomaticChartSeriescolor +{ + public static void main(String[] args) + { + //ExStart:AutomaticChartSeriescolor + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + try + { + // Access first slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Add chart with default data + IChart chart = slide.getShapes().addChart(ChartType.ClusteredColumn, 0, 0, 500, 500); + + // Set first series to Show Values + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(true); + + // Setting the index of chart data sheet + int defaultWorksheetIndex = 0; + + // Getting the chart data worksheet + IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); + + // Delete default generated series and categories + chart.getChartData().getSeries().clear(); + chart.getChartData().getCategories().clear(); + int s = chart.getChartData().getSeries().size(); + s = chart.getChartData().getCategories().size(); + + // Adding new series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 1, "Series 1"), chart.getType()); + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 2, "Series 2"), chart.getType()); + + // Adding new categories + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "Caetegoty 1")); + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 2, 0, "Caetegoty 2")); + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 3, 0, "Caetegoty 3")); + + // Take first chart series + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + + // Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)); + + // Setting automatic fill color for series + series.getFormat().getFill().setFillType(FillType.NotDefined); + + // Take second chart series + series = chart.getChartData().getSeries().get_Item(1); + + // Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 2, 30)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 2, 10)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 2, 60)); + + // Setting fill color for series + series.getFormat().getFill().setFillType(FillType.Solid); + series.getFormat().getFill().getSolidFillColor().setColor(Color.GRAY); + + // Save presentation with chart + presentation.save(dataDir + "AutomaticColor_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AutomaticChartSeriescolor + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/BoxChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/BoxChart.java new file mode 100644 index 00000000..da4d787a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/BoxChart.java @@ -0,0 +1,56 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class BoxChart +{ + //ExStart:BoxChart + public static void main(String[] args) + { + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(dataDir + "test.pptx"); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.BoxAndWhisker, 50, 50, 500, 400); + chart.getChartData().getCategories().clear(); + chart.getChartData().getSeries().clear(); + + IChartDataWorkbook wb = chart.getChartData().getChartDataWorkbook(); + + wb.clear(0); + + chart.getChartData().getCategories().add(wb.getCell(0, "A1", "Category 1")); + chart.getChartData().getCategories().add(wb.getCell(0, "A2", "Category 1")); + chart.getChartData().getCategories().add(wb.getCell(0, "A3", "Category 1")); + chart.getChartData().getCategories().add(wb.getCell(0, "A4", "Category 1")); + chart.getChartData().getCategories().add(wb.getCell(0, "A5", "Category 1")); + chart.getChartData().getCategories().add(wb.getCell(0, "A6", "Category 1")); + + IChartSeries series = chart.getChartData().getSeries().add(ChartType.BoxAndWhisker); + + series.setQuartileMethod(QuartileMethodType.Exclusive); + series.setShowMeanLine(true); + series.setShowMeanMarkers(true); + series.setShowInnerPoints(true); + series.setShowOutlierPoints(true); + + series.getDataPoints().addDataPointForBoxAndWhiskerSeries(wb.getCell(0, "B1", 15)); + series.getDataPoints().addDataPointForBoxAndWhiskerSeries(wb.getCell(0, "B2", 41)); + series.getDataPoints().addDataPointForBoxAndWhiskerSeries(wb.getCell(0, "B3", 16)); + series.getDataPoints().addDataPointForBoxAndWhiskerSeries(wb.getCell(0, "B4", 10)); + series.getDataPoints().addDataPointForBoxAndWhiskerSeries(wb.getCell(0, "B5", 23)); + series.getDataPoints().addDataPointForBoxAndWhiskerSeries(wb.getCell(0, "B6", 16)); + + + pres.save("BoxAndWhisker.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + } + //ExEnd:BoxChart +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/CalculateFormulas.java b/Examples/src/main/java/com/aspose/slides/examples/charts/CalculateFormulas.java new file mode 100644 index 00000000..307928aa --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/CalculateFormulas.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.charts;/* + * Copyright (c) 2009-2021 Aspose Pty Ltd. All Rights Reserved. + */ + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class CalculateFormulas +{ + //ExStart:CalculateFormulas + public static void main(String[] args) + { + String resultPath = RunExamples.getOutPath() + "CalculateFormulas_out.pptx"; + + Presentation presentation = new Presentation(); + try { + IChart s_chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 10, 10, 600, 300); + + IChartDataWorkbook workbook = s_chart.getChartData().getChartDataWorkbook(); + IChartDataCell cell = workbook.getCell(0, "A1"); + cell.setFormula("ABS(A2) + MAX(B2:C2)"); + + workbook.getCell(0, "A2").setValue(-1); + workbook.calculateFormulas(); + + workbook.getCell(0, "B2").setFormula("2"); + workbook.calculateFormulas(); + + workbook.getCell(0, "C2").setFormula("A2 + 4"); + workbook.calculateFormulas(); + + cell.setFormula("MAX(2:2)"); + workbook.calculateFormulas(); + + presentation.save(resultPath, SaveFormat.Pptx); + } finally { + if (presentation != null) presentation.dispose(); + } + } + //ExEnd:CalculateFormulas +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ChangeChartCategoryAxis.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ChangeChartCategoryAxis.java new file mode 100644 index 00000000..d0c3185c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ChangeChartCategoryAxis.java @@ -0,0 +1,31 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ChangeChartCategoryAxis +{ + public static void main(String[] args) + { + //ExStart:ChangeChartCategoryAxis + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation presentation = new Presentation(dataDir + "ExistingChart.pptx"); + try + { + IChart chart = (IChart) presentation.getSlides().get_Item(0).getShapes().get_Item(0); + chart.getAxes().getHorizontalAxis().setCategoryAxisType(CategoryAxisType.Date); + chart.getAxes().getHorizontalAxis().setAutomaticMajorUnit(false); + chart.getAxes().getHorizontalAxis().setMajorUnit(1); + chart.getAxes().getHorizontalAxis().setMajorUnitScale(TimeUnitType.Months); + presentation.save(dataDir + "ChangeChartCategoryAxis_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ChangeChartCategoryAxis + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ChangeColorOfCategories.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ChangeColorOfCategories.java new file mode 100644 index 00000000..a9d63ab1 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ChangeColorOfCategories.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class ChangeColorOfCategories +{ + public static void main(String[] args) + { + //ExStart:ChangeColorOfCategories + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(); + try + + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 600, 400); + + IChartDataPoint point = chart.getChartData().getSeries().get_Item(0).getDataPoints().get_Item(0); + + point.getFormat().getFill().setFillType(FillType.Solid); + + point.getFormat().getFill().getSolidFillColor().setColor(Color.BLUE); + pres.save(dataDir + "output.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ChangeColorOfCategories + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ChartDataCell_Formulas.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ChartDataCell_Formulas.java new file mode 100644 index 00000000..ec20f5b9 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ChartDataCell_Formulas.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class ChartDataCell_Formulas +{ + public static void main(String[] args) + { + String outpptxFile = RunExamples.getOutPath() + File.pathSeparator + "ChartDataCell_Formulas_out.pptx"; + + Presentation presentation = new Presentation(); + try + { + IChart chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 150, 150, 500, 300); + IChartDataWorkbook workbook = chart.getChartData().getChartDataWorkbook(); + + IChartDataCell cell1 = workbook.getCell(0, "B2"); + cell1.setFormula("1 + SUM(F2:H5)"); + + IChartDataCell cell2 = workbook.getCell(0, "C2"); + cell2.setR1C1Formula("MAX(R2C6:R5C8) / 3"); + workbook.calculateFormulas(); + + presentation.save(outpptxFile, SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ChartDataPointIndex.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ChartDataPointIndex.java new file mode 100644 index 00000000..954580ee --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ChartDataPointIndex.java @@ -0,0 +1,24 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class ChartDataPointIndex +{ + public static void main(String[] args) + { + String dataDir = RunExamples.getDataDir_Charts(); + String pptxFile = dataDir + "ChartIndex.pptx"; + + Presentation presentation = new Presentation(pptxFile); + try { + Chart chart = (Chart)presentation.getSlides().get_Item(0).getShapes().get_Item(0); + for (IChartDataPoint dataPoint : chart.getChartData().getSeries().get_Item(0).getDataPoints()) + { + System.out.println("Point with index " + dataPoint.getIndex() + " is applied to " + dataPoint.getValue()); + } + } finally { + if (presentation != null) presentation.dispose(); + } + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ChartEntities.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ChartEntities.java new file mode 100644 index 00000000..459e8c92 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ChartEntities.java @@ -0,0 +1,168 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class ChartEntities +{ + public static void main(String[] args) + { + //ExStart:ChartEntities + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiating presentation// Instantiating presentation + Presentation pres = new Presentation(); + try + { + // Accessing the first slide + ISlide slide = pres.getSlides().get_Item(0); + + // Adding the sample chart + IChart chart = slide.getShapes().addChart(ChartType.LineWithMarkers, 50, 50, 500, 400); + + // Setting Chart Titile + chart.setTitle(true); + chart.getChartTitle().addTextFrameForOverriding(""); + IPortion chartTitle = chart.getChartTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0); + chartTitle.setText("Sample Chart"); + chartTitle.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + chartTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.GRAY); + chartTitle.getPortionFormat().setFontHeight(20); + chartTitle.getPortionFormat().setFontBold(NullableBool.True); + chartTitle.getPortionFormat().setFontItalic(NullableBool.True); + + // Setting Major grid lines format for value axis + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.Solid); + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.BLUE); + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setWidth(5); + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setDashStyle(LineDashStyle.DashDot); + + // Setting Minor grid lines format for value axis + chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.Solid); + chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.RED); + chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().setWidth(3); + + // Setting value axis number format + chart.getAxes().getVerticalAxis().setNumberFormatLinkedToSource(false); + chart.getAxes().getVerticalAxis().setDisplayUnit(DisplayUnitType.Thousands); + chart.getAxes().getVerticalAxis().setNumberFormat("0.0%"); + + // Setting chart maximum, minimum values + chart.getAxes().getVerticalAxis().setAutomaticMajorUnit(false); + chart.getAxes().getVerticalAxis().setAutomaticMaxValue(false); + chart.getAxes().getVerticalAxis().setAutomaticMinorUnit(false); + chart.getAxes().getVerticalAxis().setAutomaticMinValue(false); + + chart.getAxes().getVerticalAxis().setMaxValue(15f); + chart.getAxes().getVerticalAxis().setMinValue(-2f); + chart.getAxes().getVerticalAxis().setMinorUnit(0.5f); + chart.getAxes().getVerticalAxis().setMajorUnit(2.0f); + + // Setting Value Axis Text Properties + IChartPortionFormat txtVal = chart.getAxes().getVerticalAxis().getTextFormat().getPortionFormat(); + txtVal.setFontBold(NullableBool.True); + txtVal.setFontHeight(16); + txtVal.setFontItalic(NullableBool.True); + txtVal.getFillFormat().setFillType(FillType.Solid); + txtVal.getFillFormat().getSolidFillColor().setColor(Color.GREEN); + txtVal.setLatinFont(new FontData("Times New Roman")); + + // Setting value axis title + chart.getAxes().getVerticalAxis().setTitle(true); + chart.getAxes().getVerticalAxis().getTitle().addTextFrameForOverriding(""); + IPortion valtitle = chart.getAxes().getVerticalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0); + valtitle.setText("Primary Axis"); + valtitle.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + valtitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.GRAY); + valtitle.getPortionFormat().setFontHeight(20); + valtitle.getPortionFormat().setFontBold(NullableBool.True); + valtitle.getPortionFormat().setFontItalic(NullableBool.True); + + // Setting value axis line format : Now Obselete + // chart.getAxes().getVerticalAxis().aVerticalAxis.l.AxisLine.setWidth(10); + // chart.getAxes().getVerticalAxis().AxisLine.getFillFormat().setFillType(FillType.Solid); + // Chart.getAxes().getVerticalAxis().AxisLine.getFillFormat().getSolidFillColor().Color = Color.Red; + + // Setting Major grid lines format for Category axis + chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.Solid); + chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.GREEN); + chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().setWidth(5); + + // Setting Minor grid lines format for Category axis + chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.Solid); + chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.YELLOW); + chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().setWidth(3); + + // Setting Category Axis Text Properties + IChartPortionFormat txtCat = chart.getAxes().getHorizontalAxis().getTextFormat().getPortionFormat(); + txtCat.setFontBold(NullableBool.True); + txtCat.setFontHeight(16); + txtCat.setFontItalic(NullableBool.True); + txtCat.getFillFormat().setFillType(FillType.Solid); + txtCat.getFillFormat().getSolidFillColor().setColor(Color.BLUE); + txtCat.setLatinFont(new FontData("Arial")); + + // Setting Category Titile + chart.getAxes().getHorizontalAxis().setTitle(true); + chart.getAxes().getHorizontalAxis().getTitle().addTextFrameForOverriding(""); + + IPortion catTitle = chart.getAxes().getHorizontalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0); + catTitle.setText("Sample Category"); + catTitle.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + catTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.GRAY); + catTitle.getPortionFormat().setFontHeight(20); + catTitle.getPortionFormat().setFontBold(NullableBool.True); + catTitle.getPortionFormat().setFontItalic(NullableBool.True); + + // Setting category axis lable position + chart.getAxes().getHorizontalAxis().setTickLabelPosition(TickLabelPositionType.Low); + + // Setting category axis lable rotation angle + chart.getAxes().getHorizontalAxis().setTickLabelRotationAngle(45); + + // Setting Legends Text Properties + IChartPortionFormat txtleg = chart.getLegend().getTextFormat().getPortionFormat(); + txtleg.setFontBold(NullableBool.True); + txtleg.setFontHeight(16); + txtleg.setFontItalic(NullableBool.True); + txtleg.getFillFormat().setFillType(FillType.Solid); + txtleg.getFillFormat().getSolidFillColor().setColor(Color.RED); + + // Set show chart legends without overlapping chart + + chart.getLegend().setOverlay(true); + + // Ploting first series on secondary value axis + // Chart.getChartData().getSeries().get_Item(0).PlotOnSecondAxis = true; + + // Setting chart back wall color + chart.getBackWall().setThickness(1); + chart.getBackWall().getFormat().getFill().setFillType(FillType.Solid); + chart.getBackWall().getFormat().getFill().getSolidFillColor().setColor(Color.ORANGE); + + chart.getFloor().getFormat().getFill().setFillType(FillType.Solid); + chart.getFloor().getFormat().getFill().getSolidFillColor().getColor(); + // Setting Plot area color + chart.getPlotArea().getFormat().getFill().setFillType(FillType.Solid); + chart.getPlotArea().getFormat().getFill().getSolidFillColor().setColor(new Color(PresetColor.LightCyan)); + + // Save Presentation + pres.save(dataDir + "FormattedChart_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ChartEntities + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ChartMarkerOptionsOnDataPoint.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ChartMarkerOptionsOnDataPoint.java new file mode 100644 index 00000000..b0da23e6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ChartMarkerOptionsOnDataPoint.java @@ -0,0 +1,75 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ChartMarkerOptionsOnDataPoint +{ + public static void main(String[] args) + { + //ExStart:ChartMarkerOptionsOnDataPoint + String dataDir = RunExamples.getDataDir_Charts(); + String outputDir = RunExamples.getOutPath(); + + Presentation pres = new Presentation(dataDir + "Test.pptx"); + + ISlide slide = pres.getSlides().get_Item(0); + + //Creating the default chart + IChart chart = slide.getShapes().addChart(ChartType.LineWithMarkers, 0, 0, 400, 400); + + //Getting the default chart data worksheet index + int defaultWorksheetIndex = 0; + + //Getting the chart data worksheet + IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); + + //Delete demo series + chart.getChartData().getSeries().clear(); + + //Add new series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 1, "Series 1"), chart.getType()); + + + //Set the picture + IImage img = Images.fromFile(dataDir + "aspose-logo.jpg"); + IPPImage imgx1 = pres.getImages().addImage(img); + + //Set the picture + IImage img2 = Images.fromFile(dataDir + "Tulips.jpg"); + IPPImage imgx2 = pres.getImages().addImage(img2); + + //Take first chart series + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + + //Add new point (1:3) there. + IChartDataPoint point = series.getDataPoints().addDataPointForLineSeries(fact.getCell(defaultWorksheetIndex, 1, 1, (double) 4.5)); + point.getMarker().getFormat().getFill().setFillType(FillType.Picture); + point.getMarker().getFormat().getFill().getPictureFillFormat().getPicture().setImage(imgx1); + + point = series.getDataPoints().addDataPointForLineSeries(fact.getCell(defaultWorksheetIndex, 2, 1, (double) 2.5)); + point.getMarker().getFormat().getFill().setFillType(FillType.Picture); + point.getMarker().getFormat().getFill().getPictureFillFormat().getPicture().setImage(imgx2); + + + point = series.getDataPoints().addDataPointForLineSeries(fact.getCell(defaultWorksheetIndex, 3, 1, (double) 3.5)); + point.getMarker().getFormat().getFill().setFillType(FillType.Picture); + point.getMarker().getFormat().getFill().getPictureFillFormat().getPicture().setImage(imgx1); + + + point = series.getDataPoints().addDataPointForLineSeries(fact.getCell(defaultWorksheetIndex, 4, 1, (double) 4.5)); + point.getMarker().getFormat().getFill().setFillType(FillType.Picture); + point.getMarker().getFormat().getFill().getPictureFillFormat().getPicture().setImage(imgx2); + + + //Changing the chart series marker + series.getMarker().setSize(15); + + pres.save(outputDir + "AsposeScatterChart.pptx", SaveFormat.Pptx); + } + + //ExEnd:ChartMarkerOptionsOnDataPoint +} + + \ No newline at end of file diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ChartTrendLines.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ChartTrendLines.java new file mode 100644 index 00000000..d88eae16 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ChartTrendLines.java @@ -0,0 +1,67 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class ChartTrendLines +{ + public static void main(String[] args) + { + //ExStart:ChartTrendLines + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Creating empty presentation + Presentation pres = new Presentation(); + + // Creating a clustered column chart + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 20, 20, 500, 400); + + // Adding ponential trend line for chart series 1 + ITrendline tredLinep = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(TrendlineType.Exponential); + tredLinep.setDisplayEquation(false); + tredLinep.setDisplayRSquaredValue(false); + + // Adding Linear trend line for chart series 1 + ITrendline tredLineLin = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(TrendlineType.Linear); + tredLineLin.setTrendlineType(TrendlineType.Linear); + tredLineLin.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); + tredLineLin.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.RED); + + + // Adding Logarithmic trend line for chart series 2 + ITrendline tredLineLog = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(TrendlineType.Logarithmic); + tredLineLog.setTrendlineType(TrendlineType.Logarithmic); + tredLineLog.addTextFrameForOverriding("New log trend line"); + + // Adding MovingAverage trend line for chart series 2 + ITrendline tredLineMovAvg = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(TrendlineType.MovingAverage); + tredLineMovAvg.setTrendlineType(TrendlineType.MovingAverage); + tredLineMovAvg.setPeriod((byte) 3); + tredLineMovAvg.setTrendlineName("New TrendLine Name"); + + // Adding Polynomial trend line for chart series 3 + ITrendline tredLinePol = chart.getChartData().getSeries().get_Item(2).getTrendLines().add(TrendlineType.Polynomial); + tredLinePol.setTrendlineType(TrendlineType.Polynomial); + tredLinePol.setForward(1); + tredLinePol.setOrder((byte) 3); + + // Adding Power trend line for chart series 3 + ITrendline tredLinePower = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(TrendlineType.Power); + tredLinePower.setTrendlineType(TrendlineType.Power); + tredLinePower.setBackward(1); + + // Saving presentation + pres.save(dataDir + "ChartTrendLines_out.pptx", SaveFormat.Pptx); + //ExEnd:ChartTrendLines + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/Chart_GetRange.java b/Examples/src/main/java/com/aspose/slides/examples/charts/Chart_GetRange.java new file mode 100644 index 00000000..d0844cb0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/Chart_GetRange.java @@ -0,0 +1,31 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + +public class Chart_GetRange { + + public static void main(String[] args) + { + //ExStart:Chart_GetRange + // The path to the documents directory. + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 10, 10, 400, 300); + + String result = chart.getChartData().getRange(); + + System.out.println("GetRange result : " + result); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:Chart_GetRange + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/Chart_RecoverWorkbook.java b/Examples/src/main/java/com/aspose/slides/examples/charts/Chart_RecoverWorkbook.java new file mode 100644 index 00000000..c6439761 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/Chart_RecoverWorkbook.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +; + +public class Chart_RecoverWorkbook +{ + public static void main(String[] args) + { + //ExStart:PieChart + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + String pptxFile = dataDir + "ExternalWB.pptx"; + String outPptxFile = RunExamples.getOutPath() + "ExternalWB_out.pptx"; + + LoadOptions lo = new LoadOptions(); + lo.getSpreadsheetOptions().setRecoverWorkbookFromChartCache(true); + + Presentation pres = new Presentation(pptxFile, lo); + try + { + IChart chart = (IChart) pres.getSlides().get_Item(0).getShapes().get_Item(0); + IChartDataWorkbook wb = chart.getChartData().getChartDataWorkbook(); + + pres.save(outPptxFile, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + } +} \ No newline at end of file diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ClearSpecificChartSeriesDataPointsData.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ClearSpecificChartSeriesDataPointsData.java new file mode 100644 index 00000000..bcaac7e0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ClearSpecificChartSeriesDataPointsData.java @@ -0,0 +1,43 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ClearSpecificChartSeriesDataPointsData +{ + public static void main(String[] args) + { + + //ExStart:ClearSpecificChartSeriesDataPointsData + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(dataDir + "TestChart.pptx"); + try + { + ISlide sl = pres.getSlides().get_Item(0); + + IChart chart = (IChart) sl.getShapes().get_Item(0); + + for (IChartDataPoint dataPoint : chart.getChartData().getSeries().get_Item(0).getDataPoints()) + { + dataPoint.getXValue().getAsCell().setValue(null); + dataPoint.getYValue().getAsCell().setValue(null); + } + + chart.getChartData().getSeries().get_Item(0).getDataPoints().clear(); + + pres.save(dataDir + "ClearSpecificChartSeriesDataPointsData.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:ClearSpecificChartSeriesDataPointsData + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/CreateExternalWorkbook.java b/Examples/src/main/java/com/aspose/slides/examples/charts/CreateExternalWorkbook.java new file mode 100644 index 00000000..fcdc0842 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/CreateExternalWorkbook.java @@ -0,0 +1,57 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.ChartType; +import com.aspose.slides.IChart; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; + + +public class CreateExternalWorkbook +{ + public static void main(String[] args) + { + + //ExStart:CreateExternalWorkbook + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "presentation.pptx"); + try + { + String externalWbPath = dataDir + "externalWorkbook1.xlsx"; + + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 50, 50, 400, 600); + + java.io.File file = new File(externalWbPath); + if (file.exists()) + file.delete(); + + byte[] worbookData = chart.getChartData().readWorkbookStream(); + FileOutputStream outputStream = new FileOutputStream(file); + outputStream.write(worbookData); + outputStream.close(); + + chart.getChartData().setExternalWorkbook(externalWbPath); + } + catch (FileNotFoundException e) + { + e.printStackTrace(); + } + catch (IOException e) + { + e.printStackTrace(); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:CreateExternalWorkbook + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/DataSourceTypePropertyAdded.java b/Examples/src/main/java/com/aspose/slides/examples/charts/DataSourceTypePropertyAdded.java new file mode 100644 index 00000000..150d88d2 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/DataSourceTypePropertyAdded.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class DataSourceTypePropertyAdded +{ + public static void main(String[] args) + { + //ExStart:DataSourceTypePropertyAdded + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(dataDir + "pres.pptx"); + try + { + ISlide slide = pres.getSlides().get_Item(1); + IChart chart = (IChart) slide.getShapes().get_Item(0); + + int sourceType = chart.getChartData().getDataSourceType(); + if (sourceType == ChartDataSourceType.ExternalWorkbook) + { + String path = chart.getChartData().getExternalWorkbookPath(); + } + // Saving presentation + pres.save(dataDir + "Result.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + + } + //ExEnd:DataSourceTypePropertyAdded +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/DefaultMarkersInChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/DefaultMarkersInChart.java new file mode 100644 index 00000000..cefe901c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/DefaultMarkersInChart.java @@ -0,0 +1,63 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class DefaultMarkersInChart +{ + public static void main(String[] args) + { + + //ExStart:DefaultMarkersInChart + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + + Presentation pres = new Presentation(); + try + { + ISlide slide = pres.getSlides().get_Item(0); + IChart chart = slide.getShapes().addChart(ChartType.LineWithMarkers, 10, 10, 400, 400); + + chart.getChartData().getSeries().clear(); + chart.getChartData().getCategories().clear(); + + IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); + chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()); + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + + chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "C1")); + series.getDataPoints().addDataPointForLineSeries(fact.getCell(0, 1, 1, 24)); + chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "C2")); + series.getDataPoints().addDataPointForLineSeries(fact.getCell(0, 2, 1, 23)); + chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "C3")); + series.getDataPoints().addDataPointForLineSeries(fact.getCell(0, 3, 1, -10)); + chart.getChartData().getCategories().add(fact.getCell(0, 4, 0, "C4")); + series.getDataPoints().addDataPointForLineSeries(fact.getCell(0, 4, 1, null)); + + chart.getChartData().getSeries().add(fact.getCell(0, 0, 2, "Series 2"), chart.getType()); + //Take second chart series + IChartSeries series2 = chart.getChartData().getSeries().get_Item(1); + + //Now populating series data + series2.getDataPoints().addDataPointForLineSeries(fact.getCell(0, 1, 2, 30)); + series2.getDataPoints().addDataPointForLineSeries(fact.getCell(0, 2, 2, 10)); + series2.getDataPoints().addDataPointForLineSeries(fact.getCell(0, 3, 2, 60)); + series2.getDataPoints().addDataPointForLineSeries(fact.getCell(0, 4, 2, 40)); + + chart.setLegend(true); + chart.getLegend().setOverlay(false); + + pres.save(dataDir + "DefaultMarkersInChart.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:DefaultMarkersInChart + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/DisplayChartLabels.java b/Examples/src/main/java/com/aspose/slides/examples/charts/DisplayChartLabels.java new file mode 100644 index 00000000..86ee47d3 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/DisplayChartLabels.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.ChartType; +import com.aspose.slides.IChart; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class DisplayChartLabels +{ + public static void main(String[] args) + { + //ExStart:DisplayChartLabels + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation presentation = new Presentation(); + try + { + IChart chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 50, 50, 500, 400); + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(true); + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowLabelAsDataCallout(true); + chart.getChartData().getSeries().get_Item(0).getLabels().get_Item(2).getDataLabelFormat().setShowLabelAsDataCallout(false); + presentation.save(dataDir + "DisplayChartLabels_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:DisplayChartLabels + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/DisplayPercentageAsLabels.java b/Examples/src/main/java/com/aspose/slides/examples/charts/DisplayPercentageAsLabels.java new file mode 100644 index 00000000..3c1888a0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/DisplayPercentageAsLabels.java @@ -0,0 +1,72 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class DisplayPercentageAsLabels +{ + public static void main(String[] args) + { + //ExStart:DisplayPercentageAsLabels + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + try + { + ISlide slide = presentation.getSlides().get_Item(0); + IChart chart = slide.getShapes().addChart(ChartType.StackedColumn, 20, 20, 400, 400); + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + IChartCategory cat; + double[] total_for_Cat = new double[chart.getChartData().getCategories().size()]; + for (int k = 0; k < chart.getChartData().getCategories().size(); k++) + { + cat = chart.getChartData().getCategories().get_Item(k); + + for (int i = 0; i < chart.getChartData().getSeries().size(); i++) + { + total_for_Cat[k] = total_for_Cat[k] + (double) (chart.getChartData().getSeries().get_Item(i).getDataPoints().get_Item(k).getValue().getData()); + } + } + + double dataPontPercent = 0f; + + for (int x = 0; x < chart.getChartData().getSeries().size(); x++) + { + series = chart.getChartData().getSeries().get_Item(x); + series.getLabels().getDefaultDataLabelFormat().setShowLegendKey(false); + + for (int j = 0; j < series.getDataPoints().size(); j++) + { + IDataLabel lbl = series.getDataPoints().get_Item(j).getLabel(); + dataPontPercent = (double) (series.getDataPoints().get_Item(j).getValue().getData()) / total_for_Cat[j] * 100; + + IPortion port = new Portion(); + port.setText(String.format("{0:F2} %f", dataPontPercent)); + port.getPortionFormat().setFontHeight(8f); + lbl.getTextFrameForOverriding().setText(""); + IParagraph para = lbl.getTextFrameForOverriding().getParagraphs().get_Item(0); + para.getPortions().add(port); + + lbl.getDataLabelFormat().setShowSeriesName(false); + lbl.getDataLabelFormat().setShowPercentage(false); + lbl.getDataLabelFormat().setShowLegendKey(false); + lbl.getDataLabelFormat().setShowCategoryName(false); + lbl.getDataLabelFormat().setShowBubbleSize(false); + + } + + } + + // Save presentation with chart + presentation.save(dataDir + "DisplayPercentageAsLabels_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:DisplayPercentageAsLabels + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/DoughnutChartHole.java b/Examples/src/main/java/com/aspose/slides/examples/charts/DoughnutChartHole.java new file mode 100644 index 00000000..c0e4efe6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/DoughnutChartHole.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.ChartType; +import com.aspose.slides.IChart; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class DoughnutChartHole +{ + public static void main(String[] args) + { + //ExStart:DoughnutChartHole + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + try + { + IChart chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.Doughnut, 50, 50, 400, 400); + chart.getChartData().getSeriesGroups().get_Item(0).setDoughnutHoleSize((byte) 90); + + // Write presentation to disk + presentation.save(dataDir + "DoughnutHoleSize_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:DoughnutChartHole + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/EditChartDatainExternalWorkbook.java b/Examples/src/main/java/com/aspose/slides/examples/charts/EditChartDatainExternalWorkbook.java new file mode 100644 index 00000000..d1882a09 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/EditChartDatainExternalWorkbook.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.ChartData; +import com.aspose.slides.IChart; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class EditChartDatainExternalWorkbook +{ + public static void main(String[] args) + { + + // Pay attention the path to external workbook is hardly saved in the presentation + // so please copy file externalWorkbook.xlsx from Data/Chart directory D:\Aspose.Slides\Aspose.Slides-for-.NET-master\Examples\Data\Charts\ before run the example + + //ExStart:EditChartDatainExternalWorkbook + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "presentation.pptx"); + try + { + IChart chart = (IChart) pres.getSlides().get_Item(0).getShapes().get_Item(0); + ChartData chartData = (ChartData) chart.getChartData(); + + + chartData.getSeries().get_Item(0).getDataPoints().get_Item(0).getValue().getAsCell().setValue(100); + pres.save(RunExamples.getOutPath() + "presentation_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:EditChartDatainExternalWorkbook + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ExistingChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ExistingChart.java new file mode 100644 index 00000000..ce8e3756 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ExistingChart.java @@ -0,0 +1,72 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ExistingChart +{ + public static void main(String[] args) + { + //ExStart:ExistingChart + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Instantiate Presentation class that represents PPTX file// Instantiate Presentation class that represents PPTX file + Presentation pres = new Presentation(dataDir + "ExistingChart.pptx"); + + // Access first slideMarker + ISlide sld = pres.getSlides().get_Item(0); + + // Add chart with default data + IChart chart = (IChart) sld.getShapes().get_Item(0); + + // Setting the index of chart data sheet + int defaultWorksheetIndex = 0; + + // Getting the chart data worksheet + IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); + + + // Changing chart Category Name + fact.getCell(defaultWorksheetIndex, 1, 0, "Modified Category 1"); + fact.getCell(defaultWorksheetIndex, 2, 0, "Modified Category 2"); + + + // Take first chart series + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + + // Now updating series data + fact.getCell(defaultWorksheetIndex, 0, 1, "New_Series1");// Modifying series name + series.getDataPoints().get_Item(0).getValue().setData(90); + series.getDataPoints().get_Item(1).getValue().setData(123); + series.getDataPoints().get_Item(2).getValue().setData(44); + + // Take Second chart series + series = chart.getChartData().getSeries().get_Item(1); + + // Now updating series data + fact.getCell(defaultWorksheetIndex, 0, 2, "New_Series2");// Modifying series name + series.getDataPoints().get_Item(0).getValue().setData(23); + series.getDataPoints().get_Item(1).getValue().setData(67); + series.getDataPoints().get_Item(2).getValue().setData(99); + + + // Now, Adding a new series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 3, "Series 3"), chart.getType()); + + // Take 3rd chart series + series = chart.getChartData().getSeries().get_Item(2); + + // Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 3, 20)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 50)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 30)); + + chart.setType(ChartType.ClusteredCylinder); + + // Save presentation with chart + pres.save(dataDir + "AsposeChartModified_out.pptx", SaveFormat.Pptx); + //ExEnd:ExistingChart + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ExtractExcelDataExample.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ExtractExcelDataExample.java new file mode 100644 index 00000000..9f339108 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ExtractExcelDataExample.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.Collections.Generic.Dictionary; +import com.aspose.slides.Collections.Generic.KeyValuePair; +import com.aspose.slides.Collections.Generic.List; +import com.aspose.slides.examples.RunExamples; + +public class ExtractExcelDataExample +{ + public static void main(String[] args) + { + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + String externalWbPath = dataDir + "book1.xlsx"; + + //ExStart:ExtractExcelDataExample + // extract a value from a cell + IExcelDataWorkbook workbook = new ExcelDataWorkbook(externalWbPath); + IExcelDataCell cell = workbook.getCell("Sheet2", "B2"); + System.out.println(cell.getValue()); + + //retrieve worksheet names and chart names from an Excel workbook + List sheetNames = workbook.getWorksheetNames(); + for (String name : sheetNames) + { + System.out.println("Worksheet " + name + " has the following charts:"); + + Dictionary sheetCharts = workbook.getChartsFromWorksheet(name); + for (KeyValuePair chart : sheetCharts) + System.out.println(chart.getKey() + " - " + chart.getValue()); + } + //ExEnd:ExtractExcelDataExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/FonSizeLegend.java b/Examples/src/main/java/com/aspose/slides/examples/charts/FonSizeLegend.java new file mode 100644 index 00000000..218a9e1d --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/FonSizeLegend.java @@ -0,0 +1,43 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.ChartType; +import com.aspose.slides.IChart; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class FonSizeLegend +{ + public static void main(String[] args) + { + //ExStart:FontSizeLegend + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(dataDir + "test.pptx"); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 600, 400); + + chart.getLegend().getTextFormat().getPortionFormat().setFontHeight(20); + + chart.getAxes().getVerticalAxis().setAutomaticMinValue(false); + + chart.getAxes().getVerticalAxis().setMinValue(-5); + + chart.getAxes().getVerticalAxis().setAutomaticMaxValue(false); + + chart.getAxes().getVerticalAxis().setMaxValue(10); + + pres.save(dataDir + "output.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:FontSizeLegend + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/FontPropertiesForChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/FontPropertiesForChart.java new file mode 100644 index 00000000..d68ffa37 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/FontPropertiesForChart.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.ChartType; +import com.aspose.slides.IChart; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class FontPropertiesForChart +{ + public static void main(String[] args) + { + + //ExStart:FontPropertiesForChart + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(); + try + { + + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 500, 400); + chart.getTextFormat().getPortionFormat().setFontHeight(20); + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(true); + pres.save(dataDir + "FontPropertiesForChart.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:FontPropertiesForChart + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/FontPropertiesForInvidualLegend.java b/Examples/src/main/java/com/aspose/slides/examples/charts/FontPropertiesForInvidualLegend.java new file mode 100644 index 00000000..39452d4c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/FontPropertiesForInvidualLegend.java @@ -0,0 +1,42 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class FontPropertiesForInvidualLegend +{ + public static void main(String[] args) + { + + //ExStart:FontPropertiesForInvidualLegend + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "test.pptx"); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 600, 400); + + IChartTextFormat tf = chart.getLegend().getEntries().get_Item(1).getTextFormat(); + + tf.getPortionFormat().setFontBold(NullableBool.True); + + tf.getPortionFormat().setFontHeight(20); + + tf.getPortionFormat().setFontItalic(NullableBool.True); + + tf.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + + tf.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); + pres.save(dataDir + "output.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:FontPropertiesForInvidualLegend + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/FunnelChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/FunnelChart.java new file mode 100644 index 00000000..baa15c9b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/FunnelChart.java @@ -0,0 +1,52 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class FunnelChart +{ + + //ExStart:FunnelChart + public static void main(String[] args) + + { + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "test.pptx"); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Funnel, 50, 50, 500, 400); + chart.getChartData().getCategories().clear(); + chart.getChartData().getSeries().clear(); + + IChartDataWorkbook wb = chart.getChartData().getChartDataWorkbook(); + + wb.clear(0); + + chart.getChartData().getCategories().add(wb.getCell(0, "A1", "Category 1")); + chart.getChartData().getCategories().add(wb.getCell(0, "A2", "Category 2")); + chart.getChartData().getCategories().add(wb.getCell(0, "A3", "Category 3")); + chart.getChartData().getCategories().add(wb.getCell(0, "A4", "Category 4")); + chart.getChartData().getCategories().add(wb.getCell(0, "A5", "Category 5")); + chart.getChartData().getCategories().add(wb.getCell(0, "A6", "Category 6")); + + IChartSeries series = chart.getChartData().getSeries().add(ChartType.Funnel); + + series.getDataPoints().addDataPointForFunnelSeries(wb.getCell(0, "B1", 50)); + series.getDataPoints().addDataPointForFunnelSeries(wb.getCell(0, "B2", 100)); + series.getDataPoints().addDataPointForFunnelSeries(wb.getCell(0, "B3", 200)); + series.getDataPoints().addDataPointForFunnelSeries(wb.getCell(0, "B4", 300)); + series.getDataPoints().addDataPointForFunnelSeries(wb.getCell(0, "B5", 400)); + series.getDataPoints().addDataPointForFunnelSeries(wb.getCell(0, "B6", 500)); + + pres.save(dataDir + "Funnel.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + } + //ExEnd:FunnelChart +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/GetActualPositionOFChartDatalabel.java b/Examples/src/main/java/com/aspose/slides/examples/charts/GetActualPositionOFChartDatalabel.java new file mode 100644 index 00000000..5acdb498 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/GetActualPositionOFChartDatalabel.java @@ -0,0 +1,53 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class GetActualPositionOFChartDatalabel +{ + public static void main(String[] args) + { + //ExStart:GetActualPositionOFChartDatalabel + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 500, 400); + for (IChartSeries series : chart.getChartData().getSeries()) + { + series.getLabels().getDefaultDataLabelFormat().setPosition(LegendDataLabelPosition.OutsideEnd); + series.getLabels().getDefaultDataLabelFormat().setShowValue(true); + } + + chart.validateChartLayout(); + + for (IChartSeries series : chart.getChartData().getSeries()) + { + for (IChartDataPoint point : series.getDataPoints()) + { + if (point.getValue().toDouble() > 4) + { + float x = point.getLabel().getActualX(); + float y = point.getLabel().getActualY(); + float w = point.getLabel().getActualWidth(); + float h = point.getLabel().getActualHeight(); + + IAutoShape shape = chart.getUserShapes().getShapes().addAutoShape(ShapeType.Ellipse, x, y, w, h); + shape.getFillFormat().setFillType(FillType.Solid); + shape.getFillFormat().getSolidFillColor().setColor(com.aspose.cells.Color.fromArgb(100, 0, 255, 0).d());//TODO + } + } + } + + pres.save(dataDir + "GetActualPositionOFChartDatalabel", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:GetActualPositionOFChartDatalabel + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/GetChartImage.java b/Examples/src/main/java/com/aspose/slides/examples/charts/GetChartImage.java new file mode 100644 index 00000000..47a0ff30 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/GetChartImage.java @@ -0,0 +1,30 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + + +public class GetChartImage +{ + public static void main(String[] args) + { + //ExStart:GetChartImage + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(dataDir + "test.pptx"); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 600, 400); + IImage img = chart.getImage(); + img.save(dataDir + "image.png", ImageFormat.Png); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:GetChartImage + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/GetValuesAndUnitScaleFromAxis.java b/Examples/src/main/java/com/aspose/slides/examples/charts/GetValuesAndUnitScaleFromAxis.java new file mode 100644 index 00000000..f97ef549 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/GetValuesAndUnitScaleFromAxis.java @@ -0,0 +1,42 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.Chart; +import com.aspose.slides.ChartType; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class GetValuesAndUnitScaleFromAxis +{ + public static void main(String[] args) + { + //ExStart:GetValuesAndUnitScaleFromAxis + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(); + try + { + Chart chart = (Chart) pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Area, 100, 100, 500, 350); + chart.validateChartLayout(); + + double maxValue = chart.getAxes().getVerticalAxis().getActualMaxValue(); + double minValue = chart.getAxes().getVerticalAxis().getActualMinValue(); + + double majorUnit = chart.getAxes().getHorizontalAxis().getActualMajorUnit(); + double minorUnit = chart.getAxes().getHorizontalAxis().getActualMinorUnit(); + + // Saving presentation + pres.save(dataDir + "ErrorBars_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + + } + //ExEnd:GetValuesAndUnitScaleFromAxis +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/GetWidthHeightFromChartPlotArea.java b/Examples/src/main/java/com/aspose/slides/examples/charts/GetWidthHeightFromChartPlotArea.java new file mode 100644 index 00000000..80c2deb6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/GetWidthHeightFromChartPlotArea.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.Chart; +import com.aspose.slides.ChartType; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class GetWidthHeightFromChartPlotArea +{ + public static void main(String[] args) + { + //ExStart:GetWidthHeightFromChartPlotArea + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(dataDir + "test.Pptx"); + try + { + Chart chart = (Chart) pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 500, 350); + chart.validateChartLayout(); + + double x = chart.getPlotArea().getActualX(); + double y = chart.getPlotArea().getActualY(); + double w = chart.getPlotArea().getActualWidth(); + double h = chart.getPlotArea().getActualHeight(); + + // Save presentation with chart + pres.save(dataDir + "Chart_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + + //ExEnd:GetWidthHeightFromChartPlotArea + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/HideInformationFromChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/HideInformationFromChart.java new file mode 100644 index 00000000..10a84f3e --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/HideInformationFromChart.java @@ -0,0 +1,65 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class HideInformationFromChart +{ + public static void main(String[] args) + { + + //ExStart:HideInformationFromChart + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(); + try + { + ISlide slide = pres.getSlides().get_Item(0); + IChart chart = slide.getShapes().addChart(ChartType.LineWithMarkers, 140, 118, 320, 370); + + //Hiding chart Title + chart.setTitle(false); + + ///Hiding Values axis + chart.getAxes().getVerticalAxis().setVisible(false); + + //Category Axis visibility + chart.getAxes().getHorizontalAxis().setVisible(false); + + //Hiding Legend + chart.setLegend(false); + + //Hiding MajorGridLines + chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.NoFill); + + for (int i = 0; i < chart.getChartData().getSeries().size(); i++) + { + chart.getChartData().getSeries().removeAt(i); + } + + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + + series.getMarker().setSymbol(MarkerStyleType.Circle); + series.getLabels().getDefaultDataLabelFormat().setShowValue(true); + series.getLabels().getDefaultDataLabelFormat().setPosition(LegendDataLabelPosition.Top); + series.getMarker().setSize(15); + + //Setting series line color + series.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); + series.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.Purple)); + series.getFormat().getLine().setDashStyle(LineDashStyle.Solid); + + pres.save(dataDir + "HideInformationFromChart.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:HideInformationFromChart + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/HistogramChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/HistogramChart.java new file mode 100644 index 00000000..14aa30c4 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/HistogramChart.java @@ -0,0 +1,48 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class HistogramChart +{ + + //ExStart:HistogramChart + public static void main(String[] args) + + { + + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "test.pptx"); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Histogram, 50, 50, 500, 400); + chart.getChartData().getCategories().clear(); + chart.getChartData().getSeries().clear(); + + IChartDataWorkbook wb = chart.getChartData().getChartDataWorkbook(); + + wb.clear(0); + + IChartSeries series = chart.getChartData().getSeries().add(ChartType.Histogram); + series.getDataPoints().addDataPointForHistogramSeries(wb.getCell(0, "A1", 15)); + series.getDataPoints().addDataPointForHistogramSeries(wb.getCell(0, "A2", -41)); + series.getDataPoints().addDataPointForHistogramSeries(wb.getCell(0, "A3", 16)); + series.getDataPoints().addDataPointForHistogramSeries(wb.getCell(0, "A4", 10)); + series.getDataPoints().addDataPointForHistogramSeries(wb.getCell(0, "A5", -23)); + series.getDataPoints().addDataPointForHistogramSeries(wb.getCell(0, "A6", 16)); + + chart.getAxes().getHorizontalAxis().setAggregationType(AxisAggregationType.Automatic); + + pres.save(dataDir + "Histogram.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + } + + //ExEnd:HistogramChart +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/IActualLayoutAdded.java b/Examples/src/main/java/com/aspose/slides/examples/charts/IActualLayoutAdded.java new file mode 100644 index 00000000..a729ebf5 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/IActualLayoutAdded.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.Chart; +import com.aspose.slides.ChartType; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class IActualLayoutAdded +{ + public static void main(String[] args) + { + //ExStart:IActualLayoutadded + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Creating empty presentation + Presentation pres = new Presentation(); + try + { + Chart chart = (Chart) pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 500, 350); + chart.validateChartLayout(); + + double x = chart.getPlotArea().getActualX(); + double y = chart.getPlotArea().getActualY(); + double w = chart.getPlotArea().getActualWidth(); + double h = chart.getPlotArea().getActualHeight(); + } + finally + { + if (pres != null) pres.dispose(); + } + } + //ExEnd:IActualLayoutadded +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ImportingChartsFromExcelExample.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ImportingChartsFromExcelExample.java new file mode 100644 index 00000000..f533f950 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ImportingChartsFromExcelExample.java @@ -0,0 +1,49 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.Collections.Generic.Dictionary; +import com.aspose.slides.Collections.Generic.KeyValuePair; +import com.aspose.slides.Collections.Generic.List; +import com.aspose.slides.examples.RunExamples; + +public class ImportingChartsFromExcelExample +{ + public static void main(String[] args) + { + // Path to excel file + String dataDir = RunExamples.getDataDir_Charts(); + String externalWbPath = dataDir + "book1.xlsx"; + + // Path to output file + String outFileName = RunExamples.getOutPath() + "ImportExcelChart.pptx"; + + //ExStart:ImportingChartsFromExcelExample + // Initializes a new instance using the specified file path + ExcelDataWorkbook workbook = new ExcelDataWorkbook(externalWbPath); + + Presentation pres = new Presentation(); + try { + ILayoutSlide blankLayout = pres.getLayoutSlides().getByType(SlideLayoutType.Blank); + + // Gets the names of all worksheets contained in the Excel workbook + List worksheetNames = workbook.getWorksheetNames(); + for (String name : worksheetNames) + { + // Gets a dictionary containing the indexes and names of all charts in the specified worksheet of an Excel workbook + Dictionary worksheetCharts = workbook.getChartsFromWorksheet(name); + for (KeyValuePair chart : worksheetCharts) + { + ISlide slide = pres.getSlides().addEmptySlide(blankLayout); + // Imports the chart from a workbook file by its name and worksheet name + ExcelWorkbookImporter.addChartFromWorkbook(slide.getShapes(), 10, 10, workbook, name, chart.getKey(), false); + } + } + + // Saves result + pres.save(outFileName, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ImportingChartsFromExcelExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/InvertIfNegativeForIndividualSeries.java b/Examples/src/main/java/com/aspose/slides/examples/charts/InvertIfNegativeForIndividualSeries.java new file mode 100644 index 00000000..e3b4e9ab --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/InvertIfNegativeForIndividualSeries.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class InvertIfNegativeForIndividualSeries +{ + public static void main(String[] args) + { + String dataDir = RunExamples.getDataDir_Charts(); + + //ExStart:InvertIfNegativeForIndividualSeries + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 600, 400, true); + IChartSeriesCollection series = chart.getChartData().getSeries(); + chart.getChartData().getSeries().clear(); + + series.add(chart.getChartData().getChartDataWorkbook().getCell(0, "B1"), chart.getType()); + series.get_Item(0).getDataPoints().addDataPointForBarSeries(chart.getChartData().getChartDataWorkbook().getCell(0, "B2", -5)); + series.get_Item(0).getDataPoints().addDataPointForBarSeries(chart.getChartData().getChartDataWorkbook().getCell(0, "B3", 3)); + series.get_Item(0).getDataPoints().addDataPointForBarSeries(chart.getChartData().getChartDataWorkbook().getCell(0, "B4", -2)); + series.get_Item(0).getDataPoints().addDataPointForBarSeries(chart.getChartData().getChartDataWorkbook().getCell(0, "B5", 1)); + + series.get_Item(0).setInvertIfNegative(false); + + series.get_Item(0).getDataPoints().get_Item(2).setInvertIfNegative(true); + + pres.save(dataDir + "InvertIfNegativeForIndividualSeries.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:InvertIfNegativeForIndividualSeries + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/LeaderLineColor.java b/Examples/src/main/java/com/aspose/slides/examples/charts/LeaderLineColor.java new file mode 100644 index 00000000..5bda0a52 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/LeaderLineColor.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; +import java.awt.*; + +public class LeaderLineColor +{ + public static void main(String[] args) + { + String presentationName = RunExamples.getDataDir_Charts() + "LeaderLinesColor.pptx"; + String outPath = RunExamples.getOutPath() + "LeaderLinesColor-out.pptx"; + + //ExStart:LeaderLineColor + Presentation pres = new Presentation(presentationName); + try { + // Get the chart from the first slide + IChart chart = (IChart)pres.getSlides().get_Item(0).getShapes().get_Item(0); + + // Get series of the chart + IChartSeriesCollection series = chart.getChartData().getSeries(); + + // Get lebels of the first serie + IDataLabelCollection labels = series.get_Item(0).getLabels(); + + // Change color of all leader lines in the collection + labels.getLeaderLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.RED); + + // Save result + pres.save(outPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:LeaderLineColor + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ManagePropertiesCharts.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ManagePropertiesCharts.java new file mode 100644 index 00000000..3d9a66a0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ManagePropertiesCharts.java @@ -0,0 +1,63 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ManagePropertiesCharts +{ + public static void main(String[] args) + { + //ExStart:ManagePropertiesCharts + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + + // Access first slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Add chart with default data + IChart chart = slide.getShapes().addChart(ChartType.StackedColumn3D, 0, 0, 500, 500); + + // Setting the index of chart data sheet + int defaultWorksheetIndex = 0; + + // Getting the chart data worksheet + IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); + + // Add series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 1, "Series 1"), chart.getType()); + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 2, "Series 2"), chart.getType()); + + // Add Catrgories + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "Caetegoty 1")); + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 2, 0, "Caetegoty 2")); + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 3, 0, "Caetegoty 3")); + + // Set Rotation3D properties + chart.getRotation3D().setRightAngleAxes(true); + chart.getRotation3D().setRotationX((byte) 40); + chart.getRotation3D().setRotationY(270); + chart.getRotation3D().setDepthPercents(150); + + // Take second chart series + IChartSeries series = chart.getChartData().getSeries().get_Item(1); + + // Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 2, 30)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 2, 10)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 2, 60)); + + // Set OverLap value + series.getParentSeriesGroup().setOverlap((byte) 100); + + // Write presentation to disk + presentation.save(dataDir + "Rotation3D_out.pptx", SaveFormat.Pptx); + //ExEnd:ManagePropertiesCharts + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/MapChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/MapChart.java new file mode 100644 index 00000000..6266eae0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/MapChart.java @@ -0,0 +1,54 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + +public class MapChart +{ + + // This example demonstrates creating Map charts. + // Please pay attension that when you first open a presentation in PP it may take a few seconds to upload an image + // of the chart from the Bing service since we don't provide cached image. + public static void main(String[] args) + { + //ExStart:MapChart + + String resultPath = RunExamples.getOutPath() + "MapChart_out.pptx"; + + Presentation presentation = new Presentation(); + try { + //create empty chart + IChart chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.Map, 50, 50, 500, 400, false); + + IChartDataWorkbook wb = chart.getChartData().getChartDataWorkbook(); + + //Add series and few data points + IChartSeries series = chart.getChartData().getSeries().add(ChartType.Map); + series.getDataPoints().addDataPointForMapSeries(wb.getCell(0, "B2", 5)); + series.getDataPoints().addDataPointForMapSeries(wb.getCell(0, "B3", 1)); + series.getDataPoints().addDataPointForMapSeries(wb.getCell(0, "B4", 10)); + + //add categories + chart.getChartData().getCategories().add(wb.getCell(0, "A2", "United States")); + chart.getChartData().getCategories().add(wb.getCell(0, "A3", "Mexico")); + chart.getChartData().getCategories().add(wb.getCell(0, "A4", "Brazil")); + + //change data point value + IChartDataPoint dataPoint = series.getDataPoints().get_Item(1); + dataPoint.getColorValue().getAsCell().setValue("15"); + + //set data point appearance + dataPoint.getFormat().getFill().setFillType(FillType.Solid); + dataPoint.getFormat().getFill().getSolidFillColor().setColor(Color.GREEN); + + presentation.save(resultPath, SaveFormat.Pptx); + } finally { + if (presentation != null) presentation.dispose(); + } + + //ExEnd:MapChart + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/MultiCategoryChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/MultiCategoryChart.java new file mode 100644 index 00000000..765c092e --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/MultiCategoryChart.java @@ -0,0 +1,59 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class MultiCategoryChart +{ + public static void main(String[] args) + { + //ExStart:MultiCategoryChart + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(); + ISlide slide = pres.getSlides().get_Item(0); + + IChart ch = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 600, 450); + ch.getChartData().getSeries().clear(); + ch.getChartData().getCategories().clear(); + + + IChartDataWorkbook fact = ch.getChartData().getChartDataWorkbook(); + fact.clear(0); + int defaultWorksheetIndex = 0; + + IChartCategory category = ch.getChartData().getCategories().add(fact.getCell(0, "c2", "A")); + category.getGroupingLevels().setGroupingItem(1, "Group1"); + category = ch.getChartData().getCategories().add(fact.getCell(0, "c3", "B")); + + category = ch.getChartData().getCategories().add(fact.getCell(0, "c4", "C")); + category.getGroupingLevels().setGroupingItem(1, "Group2"); + category = ch.getChartData().getCategories().add(fact.getCell(0, "c5", "D")); + + category = ch.getChartData().getCategories().add(fact.getCell(0, "c6", "E")); + category.getGroupingLevels().setGroupingItem(1, "Group3"); + category = ch.getChartData().getCategories().add(fact.getCell(0, "c7", "F")); + + category = ch.getChartData().getCategories().add(fact.getCell(0, "c8", "G")); + category.getGroupingLevels().setGroupingItem(1, "Group4"); + category = ch.getChartData().getCategories().add(fact.getCell(0, "c9", "H")); + + // Adding Series + IChartSeries series = ch.getChartData().getSeries().add(fact.getCell(0, "D1", "Series 1"), + ChartType.ClusteredColumn); + + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, "D2", 10)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, "D3", 20)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, "D4", 30)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, "D5", 40)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, "D6", 50)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, "D7", 60)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, "D8", 70)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, "D9", 80)); + // Save presentation with chart + pres.save(dataDir + "AsposeChart_out.pptx", SaveFormat.Pptx); + //ExEnd:MultiCategoryChart + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/NormalCharts.java b/Examples/src/main/java/com/aspose/slides/examples/charts/NormalCharts.java new file mode 100644 index 00000000..97df7381 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/NormalCharts.java @@ -0,0 +1,106 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class NormalCharts +{ + public static void main(String[] args) + { + //ExStart:NormalCharts + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Presentation class that represents PPTX file + Presentation pres = new Presentation(); + + // Access first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add chart with default data + IChart chart = sld.getShapes().addChart(ChartType.ClusteredColumn, 0, 0, 500, 500); + + // Setting chart Title + // Chart.getChartTitle().getTextFrameForOverriding().setText("Sample Title"); + chart.getChartTitle().addTextFrameForOverriding("Sample Title"); + chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(NullableBool.True); + chart.getChartTitle().setHeight(20); + chart.setTitle(true); + + // Set first series to Show Values + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(true); + + // Setting the index of chart data sheet + int defaultWorksheetIndex = 0; + + // Getting the chart data worksheet + IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); + + // Delete default generated series and categories + chart.getChartData().getSeries().clear(); + chart.getChartData().getCategories().clear(); + int s = chart.getChartData().getSeries().size(); + s = chart.getChartData().getCategories().size(); + + // Adding new series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 1, "Series 1"), chart.getType()); + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 2, "Series 2"), chart.getType()); + + // Adding new categories + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "Caetegoty 1")); + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 2, 0, "Caetegoty 2")); + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 3, 0, "Caetegoty 3")); + + // Take first chart series + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + + // Now populating series data + + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)); + + // Setting fill color for series + series.getFormat().getFill().setFillType(FillType.Solid); + series.getFormat().getFill().getSolidFillColor().setColor(Color.RED); + + + // Take second chart series + series = chart.getChartData().getSeries().get_Item(1); + + // Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 2, 30)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 2, 10)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 2, 60)); + + // Setting fill color for series + series.getFormat().getFill().setFillType(FillType.Solid); + series.getFormat().getFill().getSolidFillColor().setColor(Color.GREEN); + + // First label will be show Category name + IDataLabel lbl = series.getDataPoints().get_Item(0).getLabel(); + lbl.getDataLabelFormat().setShowCategoryName(true); + + lbl = series.getDataPoints().get_Item(1).getLabel(); + lbl.getDataLabelFormat().setShowSeriesName(true); + + // Show value for third label + lbl = series.getDataPoints().get_Item(2).getLabel(); + lbl.getDataLabelFormat().setShowValue(true); + lbl.getDataLabelFormat().setShowSeriesName(true); + lbl.getDataLabelFormat().setSeparator("/"); + + // Save presentation with chart + pres.save(dataDir + "AsposeChart_out.pptx", SaveFormat.Pptx); + //ExEnd:NormalCharts + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/NumberFormat.java b/Examples/src/main/java/com/aspose/slides/examples/charts/NumberFormat.java new file mode 100644 index 00000000..6f373d16 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/NumberFormat.java @@ -0,0 +1,56 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class NumberFormat +{ + public static void main(String[] args) + { + //ExStart:NumberFormat + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate the presentation// Instantiate the presentation + Presentation pres = new Presentation(); + try + { + // Access the first presentation slide + ISlide slide = pres.getSlides().get_Item(0); + + // Adding a defautlt clustered column chart + IChart chart = slide.getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 500, 400); + + // Accessing the chart series collection + IChartSeriesCollection series = chart.getChartData().getSeries(); + + // Setting the preset number format + // Traverse through every chart series + for (IChartSeries ser : series) + { + // Traverse through every data cell in series + for (IChartDataPoint cell : ser.getDataPoints()) + { + // Setting the number format + cell.getValue().getAsCell().setPresetNumberFormat((byte) 10); //0.00% + } + } + + // Saving presentation + pres.save(dataDir + "PresetNumberFormat_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:NumberFormat + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/OrganizationChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/OrganizationChart.java new file mode 100644 index 00000000..0b71e768 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/OrganizationChart.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.ISmartArt; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.SmartArtLayoutType; +import com.aspose.slides.examples.RunExamples; + + +public class OrganizationChart +{ + //ExStart:OrganizationChart + public static void main(String[] args) + { + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "test.pptx"); + try + { + ISmartArt smartArt = pres.getSlides().get_Item(0).getShapes().addSmartArt(0, 0, 400, 400, SmartArtLayoutType.PictureOrganizationChart); + + pres.save(dataDir + "OrganizationChart.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + } + //ExEnd:OrganizationChart +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/PieChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/PieChart.java new file mode 100644 index 00000000..d980ac1b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/PieChart.java @@ -0,0 +1,120 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class PieChart +{ + public static void main(String[] args) + { + //ExStart:PieChart + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Instantiate Presentation class that represents PPTX file + Presentation presentation = new Presentation(); + + // Access first slide + ISlide slides = presentation.getSlides().get_Item(0); + + // Add chart with default data + IChart chart = slides.getShapes().addChart(ChartType.Pie, 100, 100, 400, 400); + + // Setting chart Title + chart.getChartTitle().addTextFrameForOverriding("Sample Title"); + chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(NullableBool.True); + chart.getChartTitle().setHeight(20); + chart.setTitle(true); + + // Set first series to Show Values + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(true); + + // Setting the index of chart data sheet + int defaultWorksheetIndex = 0; + + // Getting the chart data worksheet + IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); + + // Delete default generated series and categories + chart.getChartData().getSeries().clear(); + chart.getChartData().getCategories().clear(); + + // Adding new categories + chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "First Qtr")); + chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "2nd Qtr")); + chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "3rd Qtr")); + + // Adding new series + IChartSeries series = chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()); + + // Now populating series data + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)); + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)); + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)); + + // Not working in new version + // Adding new points and setting sector color + // series.IsColorVaried = true; + chart.getChartData().getSeriesGroups().get_Item(0).setColorVaried(true); + + IChartDataPoint point = series.getDataPoints().get_Item(0); + point.getFormat().getFill().setFillType(FillType.Solid); + point.getFormat().getFill().getSolidFillColor().setColor(new Color(PresetColor.Cyan)); + // Setting Sector border + point.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); + point.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.GRAY); + point.getFormat().getLine().setWidth(3.0); + point.getFormat().getLine().setStyle(LineStyle.ThinThick); + point.getFormat().getLine().setDashStyle(LineDashStyle.DashDot); + + IChartDataPoint point1 = series.getDataPoints().get_Item(1); + point1.getFormat().getFill().setFillType(FillType.Solid); + point1.getFormat().getFill().getSolidFillColor().setColor(new Color(PresetColor.Brown)); + + // Setting Sector border + point1.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); + point1.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.BLUE); + point1.getFormat().getLine().setWidth(3.0); + point1.getFormat().getLine().setStyle(LineStyle.Single); + point1.getFormat().getLine().setDashStyle(LineDashStyle.LargeDashDot); + + IChartDataPoint point2 = series.getDataPoints().get_Item(2); + point2.getFormat().getFill().setFillType(FillType.Solid); + point2.getFormat().getFill().getSolidFillColor().setColor(new Color(PresetColor.Coral)); + + // Setting Sector border + point2.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); + point2.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.RED); + point2.getFormat().getLine().setWidth(2.0); + point2.getFormat().getLine().setStyle(LineStyle.ThinThin); + point2.getFormat().getLine().setDashStyle(LineDashStyle.LargeDashDotDot); + + // Create custom labels for each of categories for new series + IDataLabel lbl1 = series.getDataPoints().get_Item(0).getLabel(); + + // lbl.setShowCategoryName(true); + lbl1.getDataLabelFormat().setShowValue(true); + + IDataLabel lbl2 = series.getDataPoints().get_Item(1).getLabel(); + lbl2.getDataLabelFormat().setShowValue(true); + lbl2.getDataLabelFormat().setShowLegendKey(true); + lbl2.getDataLabelFormat().setShowPercentage(true); + + IDataLabel lbl3 = series.getDataPoints().get_Item(2).getLabel(); + lbl3.getDataLabelFormat().setShowSeriesName(true); + lbl3.getDataLabelFormat().setShowPercentage(true); + + // Showing Leader Lines for Chart + series.getLabels().getDefaultDataLabelFormat().setShowLeaderLines(true); + + // Setting Rotation Angle for Pie Chart Sectors + chart.getChartData().getSeriesGroups().get_Item(0).setFirstSliceAngle(180); + + // Save presentation with chart + presentation.save(dataDir + "PieChart_out.pptx", SaveFormat.Pptx); + //ExEnd:PieChart + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/RadarChartCreating.java b/Examples/src/main/java/com/aspose/slides/examples/charts/RadarChartCreating.java new file mode 100644 index 00000000..811f89db --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/RadarChartCreating.java @@ -0,0 +1,119 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class RadarChartCreating +{ + public static void main(String[] args) + { + String outPath = RunExamples.getOutPath() + File.separator + "RadarChart_Out.pptx"; + + Presentation pres = new Presentation(); + try + { + // Access first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add Radar chart + IChart ichart = sld.getShapes().addChart(ChartType.Radar, 0, 0, 400, 400); + + // Setting the index of chart data sheet + int defaultWorksheetIndex = 0; + + // Getting the chart data WorkSheet + IChartDataWorkbook fact = ichart.getChartData().getChartDataWorkbook(); + + // Set chart title + ichart.getChartTitle().addTextFrameForOverriding("Radar Chart"); + + // Delete default generated series and categories + ichart.getChartData().getCategories().clear(); + ichart.getChartData().getSeries().clear(); + + // Adding new categories + ichart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "Caetegoty 1")); + ichart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 2, 0, "Caetegoty 3")); + ichart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 3, 0, "Caetegoty 5")); + ichart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 4, 0, "Caetegoty 7")); + ichart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 5, 0, "Caetegoty 9")); + ichart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 6, 0, "Caetegoty 11")); + + // Adding new series + ichart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 1, "Series 1"), ichart.getType()); + ichart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 2, "Series 2"), ichart.getType()); + + // Now populating series data + IChartSeries series = ichart.getChartData().getSeries().get_Item(0); + series.getDataPoints().addDataPointForRadarSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 2.7)); + series.getDataPoints().addDataPointForRadarSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 2.4)); + series.getDataPoints().addDataPointForRadarSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 1.5)); + series.getDataPoints().addDataPointForRadarSeries(fact.getCell(defaultWorksheetIndex, 4, 1, 3.5)); + series.getDataPoints().addDataPointForRadarSeries(fact.getCell(defaultWorksheetIndex, 5, 1, 5)); + series.getDataPoints().addDataPointForRadarSeries(fact.getCell(defaultWorksheetIndex, 6, 1, 3.5)); + + // Set series color + series.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); + series.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.RED); + + // Now populating another series data + series = ichart.getChartData().getSeries().get_Item(1); + series.getDataPoints().addDataPointForRadarSeries(fact.getCell(defaultWorksheetIndex, 1, 2, 2.5)); + series.getDataPoints().addDataPointForRadarSeries(fact.getCell(defaultWorksheetIndex, 2, 2, 2.4)); + series.getDataPoints().addDataPointForRadarSeries(fact.getCell(defaultWorksheetIndex, 3, 2, 1.6)); + series.getDataPoints().addDataPointForRadarSeries(fact.getCell(defaultWorksheetIndex, 4, 2, 3.5)); + series.getDataPoints().addDataPointForRadarSeries(fact.getCell(defaultWorksheetIndex, 5, 2, 4)); + series.getDataPoints().addDataPointForRadarSeries(fact.getCell(defaultWorksheetIndex, 6, 2, 3.6)); + + // Set series color + series.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); + series.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.ORANGE); + + // Set legend position + ichart.getLegend().setPosition(LegendPositionType.Bottom); + + // Setting Category Axis Text Properties + IChartPortionFormat txtCat = ichart.getAxes().getHorizontalAxis().getTextFormat().getPortionFormat(); + txtCat.setFontBold(NullableBool.True); + txtCat.setFontHeight(10); + txtCat.getFillFormat().setFillType(FillType.Solid); + txtCat.getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.DimGray)); + txtCat.setLatinFont(new FontData("Calibri")); + + // Setting Legends Text Properties + IChartPortionFormat txtleg = ichart.getLegend().getTextFormat().getPortionFormat(); + txtleg.setFontBold(NullableBool.True); + txtleg.setFontHeight(10); + txtleg.getFillFormat().setFillType(FillType.Solid); + txtleg.getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.DimGray)); + txtCat.setLatinFont(new FontData("Calibri")); + + // Setting Value Axis Text Properties + IChartPortionFormat txtVal = ichart.getAxes().getVerticalAxis().getTextFormat().getPortionFormat(); + txtVal.setFontBold(NullableBool.True); + txtVal.setFontHeight(10); + txtVal.getFillFormat().setFillType(FillType.Solid); + txtVal.getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.DimGray)); + txtVal.setLatinFont(new FontData("Calibri")); + + // Setting value axis number format + ichart.getAxes().getVerticalAxis().setNumberFormatLinkedToSource(false); + ichart.getAxes().getVerticalAxis().setNumberFormat("\"$\"#,##0.00"); + + // Setting chart major unit value + ichart.getAxes().getVerticalAxis().setAutomaticMajorUnit(false); + ichart.getAxes().getVerticalAxis().setMajorUnit(1.25f); + + // Save generated presentation + pres.save(outPath, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ScatteredChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ScatteredChart.java new file mode 100644 index 00000000..8cd597ac --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ScatteredChart.java @@ -0,0 +1,80 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class ScatteredChart +{ + public static void main(String[] args) + { + //ExStart:ScatteredChart + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + Presentation pres = new Presentation(); + + ISlide slide = pres.getSlides().get_Item(0); + + // Creating the default chart + IChart chart = slide.getShapes().addChart(ChartType.ScatterWithSmoothLines, 0, 0, 400, 400); + + // Getting the default chart data worksheet index + int defaultWorksheetIndex = 0; + + // Getting the chart data worksheet + IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); + + // Delete demo series + chart.getChartData().getSeries().clear(); + + // Add new series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 1, "Series 1"), chart.getType()); + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 3, "Series 2"), chart.getType()); + + // Take first chart series + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + + // Add new point (1:3) there. + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 1), fact.getCell(defaultWorksheetIndex, 2, 2, 3)); + + // Add new point (2:10) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 2), fact.getCell(defaultWorksheetIndex, 3, 2, 10)); + + // Edit the type of series + series.setType(ChartType.ScatterWithStraightLinesAndMarkers); + + // Changing the chart series marker + series.getMarker().setSize(10); + series.getMarker().setSymbol(MarkerStyleType.Star); + + // Take second chart series + series = chart.getChartData().getSeries().get_Item(1); + + // Add new point (5:2) there. + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 5), fact.getCell(defaultWorksheetIndex, 2, 4, 2)); + + // Add new point (3:1) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 3), fact.getCell(defaultWorksheetIndex, 3, 4, 1)); + + // Add new point (2:2) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 4, 3, 2), fact.getCell(defaultWorksheetIndex, 4, 4, 2)); + + // Add new point (5:1) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 5, 3, 5), fact.getCell(defaultWorksheetIndex, 5, 4, 1)); + + // Changing the chart series marker + series.getMarker().setSize(10); + series.getMarker().setSymbol(MarkerStyleType.Circle); + + pres.save(dataDir + "AsposeChart_out.pptx", SaveFormat.Pptx); + //ExEnd:ScatteredChart + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SecondPlotOptionsforCharts.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SecondPlotOptionsforCharts.java new file mode 100644 index 00000000..8e275779 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SecondPlotOptionsforCharts.java @@ -0,0 +1,31 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class SecondPlotOptionsforCharts +{ + public static void main(String[] args) + { + //ExStart:SecondPlotOptionsforCharts + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + + // Add chart on slide + IChart chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.PieOfPie, 50, 50, 500, 400); + + // Set different properties + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(true); + chart.getChartData().getSeries().get_Item(0).getParentSeriesGroup().setSecondPieSize(149); + chart.getChartData().getSeries().get_Item(0).getParentSeriesGroup().setPieSplitBy(PieSplitType.ByPercentage); + chart.getChartData().getSeries().get_Item(0).getParentSeriesGroup().setPieSplitPosition(53); + + // Write presentation to disk + presentation.save(dataDir + "SecondPlotOptionsforCharts_out.pptx", SaveFormat.Pptx); + //ExEnd:SecondPlotOptionsforCharts + + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SetAutomaticSeriesFillColor.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SetAutomaticSeriesFillColor.java new file mode 100644 index 00000000..46eb7052 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SetAutomaticSeriesFillColor.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.ChartType; +import com.aspose.slides.IChart; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SetAutomaticSeriesFillColor +{ + public static void main(String[] args) + { + //ExStart:SetAutomaticSeriesFillColor + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + Presentation presentation = new Presentation(); + try + { + // Creating a clustered column chart + IChart chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 50, 600, 400); + + // Setting series fill format to automatic + for (int i = 0; i < chart.getChartData().getSeries().size(); i++) + { + chart.getChartData().getSeries().get_Item(i).getAutomaticSeriesColor(); + } + + // Write the presentation file to disk + presentation.save(dataDir + "AutoFillSeries_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SetAutomaticSeriesFillColor + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SetCategoryAxisLabelDistance.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SetCategoryAxisLabelDistance.java new file mode 100644 index 00000000..4e0e336a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SetCategoryAxisLabelDistance.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetCategoryAxisLabelDistance +{ + public static void main(String[] args) + { + //ExStart:SetCategoryAxisLabelDistance + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation presentation = new Presentation(); + try + { + // Get reference of the slide + ISlide sld = presentation.getSlides().get_Item(0); + + // Adding a chart on slide + IChart ch = sld.getShapes().addChart(ChartType.ClusteredColumn, 20, 20, 500, 300); + + // Setting the position of label from axis + ch.getAxes().getHorizontalAxis().setLabelOffset(500); + + // Write the presentation file to disk + presentation.save(dataDir + "SetCategoryAxisLabelDistance_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SetCategoryAxisLabelDistance + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SetChartDataFromWorkBook.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SetChartDataFromWorkBook.java new file mode 100644 index 00000000..1a472830 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SetChartDataFromWorkBook.java @@ -0,0 +1,47 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.cells.Workbook; +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; +import java.io.ByteArrayOutputStream; +import java.lang.Exception; + + +public class SetChartDataFromWorkBook +{ + + public static void main(String[] args) + { + String outPath = RunExamples.getOutPath() + "response2.pptx"; + + //ExStart:SetChartDataFromWorkBook + Presentation pres = new Presentation(); + try { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 50, 50, 500, 400); + chart.getChartData().getChartDataWorkbook().clear(0); + + Workbook workbook = null; + try { + workbook = new Workbook(RunExamples.getDataDir_Charts() + "book1.xlsx"); + } catch (Exception ex) { + System.out.println(ex); + } + + ByteArrayOutputStream mem = new ByteArrayOutputStream(); + workbook.save(mem, com.aspose.cells.SaveFormat.XLSX); + mem.flush(); + + chart.getChartData().writeWorkbookStream(mem.toByteArray()); + + chart.getChartData().setRange("Sheet2!$A$1:$B$3"); + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + series.getParentSeriesGroup().setColorVaried(true); + + pres.save(outPath, SaveFormat.Pptx); + } catch(Exception e) { + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:SetChartDataFromWorkBook + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SetChartSeriesOverlap.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SetChartSeriesOverlap.java new file mode 100644 index 00000000..2ae9146f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SetChartSeriesOverlap.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetChartSeriesOverlap +{ + public static void main(String[] args) + { + //ExStart:SetChartSeriesOverlap + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation presentation = new Presentation(); + try + { + // Adding chart + IChart chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 600, 400, true); + IChartSeriesCollection series = chart.getChartData().getSeries(); + if (series.get_Item(0).getOverlap() == 0) + { + // Setting series overlap + series.get_Item(0).getParentSeriesGroup().setOverlap((byte) -30); + } + + // Write the presentation file to disk + presentation.save(dataDir + "SetChartSeriesOverlap_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SetChartSeriesOverlap + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SetDataLabelsPercentageSign.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SetDataLabelsPercentageSign.java new file mode 100644 index 00000000..222c7152 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SetDataLabelsPercentageSign.java @@ -0,0 +1,77 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class SetDataLabelsPercentageSign +{ + public static void main(String[] args) + { + //ExStart:SetDataLabelsPercentageSign + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + + // Get reference of the slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Add PercentsStackedColumn chart on a slide + IChart chart = slide.getShapes().addChart(ChartType.PercentsStackedColumn, 20, 20, 500, 400); + + // Set NumberFormatLinkedToSource to false + chart.getAxes().getVerticalAxis().setNumberFormatLinkedToSource(false); + chart.getAxes().getVerticalAxis().setNumberFormat("0.00%"); + + chart.getChartData().getSeries().clear(); + int defaultWorksheetIndex = 0; + + // Getting the chart data worksheet + IChartDataWorkbook workbook = chart.getChartData().getChartDataWorkbook(); + + // Add new series + IChartSeries series = chart.getChartData().getSeries().add(workbook.getCell(defaultWorksheetIndex, 0, 1, "Reds"), chart.getType()); + series.getDataPoints().addDataPointForBarSeries(workbook.getCell(defaultWorksheetIndex, 1, 1, 0.30)); + series.getDataPoints().addDataPointForBarSeries(workbook.getCell(defaultWorksheetIndex, 2, 1, 0.50)); + series.getDataPoints().addDataPointForBarSeries(workbook.getCell(defaultWorksheetIndex, 3, 1, 0.80)); + series.getDataPoints().addDataPointForBarSeries(workbook.getCell(defaultWorksheetIndex, 4, 1, 0.65)); + + // Setting the fill color of series + series.getFormat().getFill().setFillType(FillType.Solid); + series.getFormat().getFill().getSolidFillColor().setColor(Color.RED); + + // Setting LabelFormat properties + series.getLabels().getDefaultDataLabelFormat().setShowValue(true); + series.getLabels().getDefaultDataLabelFormat().setNumberFormatLinkedToSource(false); + series.getLabels().getDefaultDataLabelFormat().setNumberFormat("0.0%"); + series.getLabels().getDefaultDataLabelFormat().getTextFormat().getPortionFormat().setFontHeight(10); + series.getLabels().getDefaultDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().setFillType(FillType.Solid); + series.getLabels().getDefaultDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.WHITE); + series.getLabels().getDefaultDataLabelFormat().setShowValue(true); + + // Add new series + IChartSeries series2 = chart.getChartData().getSeries().add(workbook.getCell(defaultWorksheetIndex, 0, 2, "Blues"), chart.getType()); + series2.getDataPoints().addDataPointForBarSeries(workbook.getCell(defaultWorksheetIndex, 1, 2, 0.70)); + series2.getDataPoints().addDataPointForBarSeries(workbook.getCell(defaultWorksheetIndex, 2, 2, 0.50)); + series2.getDataPoints().addDataPointForBarSeries(workbook.getCell(defaultWorksheetIndex, 3, 2, 0.20)); + series2.getDataPoints().addDataPointForBarSeries(workbook.getCell(defaultWorksheetIndex, 4, 2, 0.35)); + + // Setting Fill type and color + series2.getFormat().getFill().setFillType(FillType.Solid); + series2.getFormat().getFill().getSolidFillColor().setColor(Color.BLUE); + series2.getLabels().getDefaultDataLabelFormat().setShowValue(true); + series2.getLabels().getDefaultDataLabelFormat().setNumberFormatLinkedToSource(false); + series2.getLabels().getDefaultDataLabelFormat().setNumberFormat("0.0%"); + series2.getLabels().getDefaultDataLabelFormat().getTextFormat().getPortionFormat().setFontHeight(10); + series2.getLabels().getDefaultDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().setFillType(FillType.Solid); + series2.getLabels().getDefaultDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.WHITE); + + // Write presentation to disk + presentation.save(dataDir + "SetDataLabelsPercentageSign_out.pptx", SaveFormat.Pptx); + //ExEnd:SetDataLabelsPercentageSign + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SetDataRange.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SetDataRange.java new file mode 100644 index 00000000..16045ddb --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SetDataRange.java @@ -0,0 +1,28 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.IChart; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SetDataRange +{ + public static void main(String[] args) + { + //ExStart:SetDataRange + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Instantiate Presentation class that represents PPTX file + Presentation presentation = new Presentation(dataDir + "ExistingChart.pptx"); + + // Access first slideMarker and add chart with default data + ISlide slide = presentation.getSlides().get_Item(0); + IChart chart = (IChart) slide.getShapes().get_Item(0); + chart.getChartData().setRange("Sheet1!A1:B4"); + presentation.save(dataDir + "SetDataRange_out.pptx", SaveFormat.Pptx); + //ExEnd:SetDataRange + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SetExternalWorkbook.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SetExternalWorkbook.java new file mode 100644 index 00000000..a95d6fa2 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SetExternalWorkbook.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetExternalWorkbook +{ + public static void main(String[] args) + { + //ExStart:SetExternalWorkbook + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 50, 50, 400, 600, false); + IChartData chartData = chart.getChartData(); + + chartData.setExternalWorkbook(dataDir + "externalWorkbook.xlsx"); + + chartData.getSeries().add(chartData.getChartDataWorkbook().getCell(0, "B1"), ChartType.Pie); + chartData.getSeries().get_Item(0).getDataPoints().addDataPointForPieSeries(chartData.getChartDataWorkbook().getCell(0, "B2")); + chartData.getSeries().get_Item(0).getDataPoints().addDataPointForPieSeries(chartData.getChartDataWorkbook().getCell(0, "B3")); + chartData.getSeries().get_Item(0).getDataPoints().addDataPointForPieSeries(chartData.getChartDataWorkbook().getCell(0, "B4")); + + chartData.getCategories().add(chartData.getChartDataWorkbook().getCell(0, "A2")); + chartData.getCategories().add(chartData.getChartDataWorkbook().getCell(0, "A3")); + chartData.getCategories().add(chartData.getChartDataWorkbook().getCell(0, "A4")); + pres.save(dataDir + "Presentation_with_externalWorkbook.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:SetExternalWorkbook + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SetExternalWorkbookWithUpdateChartData.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SetExternalWorkbookWithUpdateChartData.java new file mode 100644 index 00000000..d79ba851 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SetExternalWorkbookWithUpdateChartData.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetExternalWorkbookWithUpdateChartData +{ + public static void main(String[] args) + { + + //ExStart:SetExternalWorkbookWithUpdateChartData + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 50, 50, 400, 600, true); + + IChartData chartData = chart.getChartData(); + chartData.setExternalWorkbook("http://path/doesnt/exists", false); + + pres.save(dataDir + "SetExternalWorkbookWithUpdateChartData.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:SetExternalWorkbookWithUpdateChartData + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SetGapWidth.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SetGapWidth.java new file mode 100644 index 00000000..b53f252b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SetGapWidth.java @@ -0,0 +1,57 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetGapWidth +{ + public static void main(String[] args) + { + //ExStart:SetGapWidth + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Creating empty presentation + Presentation presentation = new Presentation(); + + // Access first slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Add chart with default data + IChart chart = slide.getShapes().addChart(ChartType.StackedColumn, 0, 0, 500, 500); + + // Setting the index of chart data sheet + int defaultWorksheetIndex = 0; + + // Getting the chart data worksheet + IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); + + // Add series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 1, "Series 1"), chart.getType()); + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 2, "Series 2"), chart.getType()); + + // Add Catrgories + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "Caetegoty 1")); + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 2, 0, "Caetegoty 2")); + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 3, 0, "Caetegoty 3")); + + // Take second chart series + IChartSeries series = chart.getChartData().getSeries().get_Item(1); + + // Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 2, 30)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 2, 10)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 2, 60)); + + // Set GapWidth value + series.getParentSeriesGroup().setGapWidth(50); + + // Save presentation with chart + presentation.save(dataDir + "GapWidth_out.pptx", SaveFormat.Pptx); + //ExEnd:SetGapWidth + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SetInvertFillColorChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SetInvertFillColorChart.java new file mode 100644 index 00000000..8a20b4d4 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SetInvertFillColorChart.java @@ -0,0 +1,50 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class SetInvertFillColorChart +{ + public static void main(String[] args) + { + //ExStart:SetInvertFillColorChart + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + Color inverColor = Color.RED; + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 400, 300); + IChartDataWorkbook workBook = chart.getChartData().getChartDataWorkbook(); + + chart.getChartData().getSeries().clear(); + chart.getChartData().getCategories().clear(); + + // Adding new series and categories + chart.getChartData().getSeries().add(workBook.getCell(0, 0, 1, "Series 1"), chart.getType()); + chart.getChartData().getCategories().add(workBook.getCell(0, 1, 0, "Category 1")); + chart.getChartData().getCategories().add(workBook.getCell(0, 2, 0, "Category 2")); + chart.getChartData().getCategories().add(workBook.getCell(0, 3, 0, "Category 3")); + + // Take first chart series and populating series data. + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + series.getDataPoints().addDataPointForBarSeries(workBook.getCell(0, 1, 1, -20)); + series.getDataPoints().addDataPointForBarSeries(workBook.getCell(0, 2, 1, 50)); + series.getDataPoints().addDataPointForBarSeries(workBook.getCell(0, 3, 1, -30)); + Color seriesColor = series.getAutomaticSeriesColor(); + series.setInvertIfNegative(true); + series.getFormat().getFill().setFillType(FillType.Solid); + series.getFormat().getFill().getSolidFillColor().setColor(seriesColor); + series.getInvertedSolidFillColor().setColor(Color.RED); + pres.save(dataDir + "SetInvertFillColorChart_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SetInvertFillColorChart + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SetLayoutMode.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SetLayoutMode.java new file mode 100644 index 00000000..dbf73787 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SetLayoutMode.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetLayoutMode +{ + public static void main(String[] args) + { + + //ExStart:SetLayoutMode + String dataDir = RunExamples.getDataDir_Charts(); + Presentation presentation = new Presentation(); + try + { + ISlide slide = presentation.getSlides().get_Item(0); + IChart chart = slide.getShapes().addChart(ChartType.ClusteredColumn, 20, 100, 600, 400); + chart.getPlotArea().setX(0.2f); + chart.getPlotArea().setY(0.2f); + chart.getPlotArea().setWidth(0.7f); + chart.getPlotArea().setHeight(0.7f); + chart.getPlotArea().setLayoutTargetType(LayoutTargetType.Inner); + + presentation.save(dataDir + "SetLayoutMode_outer.pptx", SaveFormat.Pptx); + + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SetLayoutMode + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SetMarkerOptions.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SetMarkerOptions.java new file mode 100644 index 00000000..c9ac9f01 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SetMarkerOptions.java @@ -0,0 +1,72 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + + +public class SetMarkerOptions +{ + public static void main(String[] args) + { + //ExStart:SetMarkerOptions + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + String outputDir = RunExamples.getOutPath(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + + ISlide slide = presentation.getSlides().get_Item(0); + + // Creating the default chart + IChart chart = slide.getShapes().addChart(ChartType.LineWithMarkers, 0, 0, 400, 400); + + // Getting the default chart data worksheet index + int defaultWorksheetIndex = 0; + + // Getting the chart data worksheet + IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); + + // Delete demo series + chart.getChartData().getSeries().clear(); + + // Add new series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 1, "Series 1"), chart.getType()); + + // Set the picture + IImage image1 = Images.fromFile(dataDir + "aspose-logo.jpg"); + IPPImage imgx1 = presentation.getImages().addImage(image1); + + // Set the picture + IImage image2 = Images.fromFile(dataDir + "Tulips.jpg"); + IPPImage imgx2 = presentation.getImages().addImage(image2); + + // Take first chart series + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + + // Add new point (1:3) there. + IChartDataPoint point = series.getDataPoints().addDataPointForLineSeries(fact.getCell(defaultWorksheetIndex, 1, 1, (double) 4.5)); + point.getMarker().getFormat().getFill().setFillType(FillType.Picture); + point.getMarker().getFormat().getFill().getPictureFillFormat().getPicture().setImage(imgx1); + + point = series.getDataPoints().addDataPointForLineSeries(fact.getCell(defaultWorksheetIndex, 2, 1, (double) 2.5)); + point.getMarker().getFormat().getFill().setFillType(FillType.Picture); + point.getMarker().getFormat().getFill().getPictureFillFormat().getPicture().setImage(imgx2); + + point = series.getDataPoints().addDataPointForLineSeries(fact.getCell(defaultWorksheetIndex, 3, 1, (double) 3.5)); + point.getMarker().getFormat().getFill().setFillType(FillType.Picture); + point.getMarker().getFormat().getFill().getPictureFillFormat().getPicture().setImage(imgx1); + + point = series.getDataPoints().addDataPointForLineSeries(fact.getCell(defaultWorksheetIndex, 4, 1, (double) 4.5)); + point.getMarker().getFormat().getFill().setFillType(FillType.Picture); + point.getMarker().getFormat().getFill().getPictureFillFormat().getPicture().setImage(imgx2); + + // Changing the chart series marker + series.getMarker().setSize(15); + + // Write presentation to disk + presentation.save(outputDir + "MarkOptions_out.pptx", SaveFormat.Pptx); + //ExEnd:SetMarkerOptions + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SetlegendCustomOptions.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SetlegendCustomOptions.java new file mode 100644 index 00000000..7ad00014 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SetlegendCustomOptions.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetlegendCustomOptions +{ + public static void main(String[] args) + { + //ExStart:SetlegendCustomOptions + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + try + { + // Get reference of the slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Add a clustered column chart on the slide + IChart chart = slide.getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 500, 500); + + // Set Legend Properties + chart.getLegend().setX(50 / chart.getWidth()); + chart.getLegend().setY(50 / chart.getHeight()); + chart.getLegend().setWidth(100 / chart.getWidth()); + chart.getLegend().setHeight(100 / chart.getHeight()); + + // Write presentation to disk + presentation.save(dataDir + "Legend_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SetlegendCustomOptions + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SettingAutomicPieChartSliceColors.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SettingAutomicPieChartSliceColors.java new file mode 100644 index 00000000..518a3d64 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SettingAutomicPieChartSliceColors.java @@ -0,0 +1,67 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SettingAutomicPieChartSliceColors +{ + public static void main(String[] args) + { + //ExStart:SettingAutomicPieChartSliceColors + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + // Instantiate Presentation class that represents PPTX file + Presentation presentation = new Presentation(); + try + { + + // Access first slide + ISlide slides = presentation.getSlides().get_Item(0); + + // Add chart with default data + IChart chart = slides.getShapes().addChart(ChartType.Pie, 100, 100, 400, 400); + + // Setting chart Title + chart.getChartTitle().addTextFrameForOverriding("Sample Title"); + chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(NullableBool.True); + chart.getChartTitle().setHeight(20); + chart.setTitle(true); + + // Set first series to Show Values + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(true); + + // Setting the index of chart data sheet + int defaultWorksheetIndex = 0; + + // Getting the chart data worksheet + IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); + + // Delete default generated series and categories + chart.getChartData().getSeries().clear(); + chart.getChartData().getCategories().clear(); + + // Adding new categories + chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "First Qtr")); + chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "2nd Qtr")); + chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "3rd Qtr")); + + // Adding new series + IChartSeries series = chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()); + + // Now populating series data + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)); + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)); + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)); + + series.getParentSeriesGroup().setColorVaried(true); + presentation.save(dataDir + "Pie.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + } + //ExEnd:SettingAutomicPieChartSliceColors +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SettingCalloutForDataLabel.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SettingCalloutForDataLabel.java new file mode 100644 index 00000000..fd126267 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SettingCalloutForDataLabel.java @@ -0,0 +1,74 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class SettingCalloutForDataLabel +{ + public static void main(String[] args) + { + //ExStart:SettingCalloutForDataLabel + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "testc.pptx"); + ISlide slide = pres.getSlides().get_Item(0); + IChart chart = slide.getShapes().addChart(ChartType.Doughnut, 10, 10, 500, 500, false); + IChartDataWorkbook workBook = chart.getChartData().getChartDataWorkbook(); + chart.getChartData().getSeries().clear(); + chart.getChartData().getCategories().clear(); + chart.setLegend(false); + int seriesIndex = 0; + while (seriesIndex < 15) + { + IChartSeries series = chart.getChartData().getSeries().add(workBook.getCell(0, 0, seriesIndex + 1, "SERIES " + seriesIndex), chart.getType()); + series.setExplosion(0); + series.getParentSeriesGroup().setDoughnutHoleSize((byte) 20); + series.getParentSeriesGroup().setFirstSliceAngle(351); + seriesIndex++; + } + int categoryIndex = 0; + while (categoryIndex < 15) + { + chart.getChartData().getCategories().add(workBook.getCell(0, categoryIndex + 1, 0, "CATEGORY " + categoryIndex)); + int i = 0; + while (i < chart.getChartData().getSeries().size()) + { + IChartSeries iCS = chart.getChartData().getSeries().get_Item(i); + IChartDataPoint dataPoint = iCS.getDataPoints().addDataPointForDoughnutSeries(workBook.getCell(0, categoryIndex + 1, i + 1, 1)); + dataPoint.getFormat().getFill().setFillType(FillType.Solid); + dataPoint.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); + dataPoint.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.WHITE); + dataPoint.getFormat().getLine().setWidth(1); + dataPoint.getFormat().getLine().setStyle(LineStyle.Single); + dataPoint.getFormat().getLine().setDashStyle(LineDashStyle.Solid); + if (i == chart.getChartData().getSeries().size() - 1) + { + IDataLabel lbl = dataPoint.getLabel(); + lbl.getTextFormat().getTextBlockFormat().setAutofitType(TextAutofitType.Shape); + lbl.getDataLabelFormat().getTextFormat().getPortionFormat().setFontBold(NullableBool.True); + lbl.getDataLabelFormat().getTextFormat().getPortionFormat().setLatinFont(new FontData("DINPro-Bold")); + lbl.getDataLabelFormat().getTextFormat().getPortionFormat().setFontHeight(12); + lbl.getDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().setFillType(FillType.Solid); + lbl.getDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.LIGHT_GRAY); + lbl.getDataLabelFormat().getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.WHITE); + lbl.getDataLabelFormat().setShowValue(false); + lbl.getDataLabelFormat().setShowCategoryName(true); + lbl.getDataLabelFormat().setShowSeriesName(false); + //lbl.getDataLabelFormat().setShowLabelAsDataCallout(true); + lbl.getDataLabelFormat().setShowLeaderLines(true); + lbl.getDataLabelFormat().setShowLabelAsDataCallout(false); + chart.validateChartLayout(); + lbl.setX(lbl.getX() + (float) 0.5); + lbl.setY(lbl.getY() + (float) 0.5); + } + i++; + } + categoryIndex++; + } + pres.save("chart.pptx", SaveFormat.Pptx); + + } + //ExEnd:SettingCalloutForDataLabel +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SettingDateFormatForCategoryAxis.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SettingDateFormatForCategoryAxis.java new file mode 100644 index 00000000..8e552a19 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SettingDateFormatForCategoryAxis.java @@ -0,0 +1,63 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.concurrent.TimeUnit; + + +public class SettingDateFormatForCategoryAxis +{ + public static void main(String[] args) throws ParseException + { + //ExStart:SettingDateFormatForCategoryAxis + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Area, 50, 50, 450, 300); + + IChartDataWorkbook wb = chart.getChartData().getChartDataWorkbook(); + wb.clear(0); + + chart.getChartData().getCategories().clear(); + chart.getChartData().getSeries().clear(); + chart.getChartData().getCategories().add(wb.getCell(0, "A2", convertToOADate(new GregorianCalendar(2015, 1, 1)))); + chart.getChartData().getCategories().add(wb.getCell(0, "A3", convertToOADate(new GregorianCalendar(2016, 1, 1)))); + chart.getChartData().getCategories().add(wb.getCell(0, "A4", convertToOADate(new GregorianCalendar(2017, 1, 1)))); + chart.getChartData().getCategories().add(wb.getCell(0, "A5", convertToOADate(new GregorianCalendar(2018, 1, 1)))); + + IChartSeries series = chart.getChartData().getSeries().add(ChartType.Line); + series.getDataPoints().addDataPointForLineSeries(wb.getCell(0, "B2", 1)); + series.getDataPoints().addDataPointForLineSeries(wb.getCell(0, "B3", 2)); + series.getDataPoints().addDataPointForLineSeries(wb.getCell(0, "B4", 3)); + series.getDataPoints().addDataPointForLineSeries(wb.getCell(0, "B5", 4)); + chart.getAxes().getHorizontalAxis().setCategoryAxisType(CategoryAxisType.Date); + chart.getAxes().getHorizontalAxis().setNumberFormatLinkedToSource(false); + chart.getAxes().getHorizontalAxis().setNumberFormat("yyyy"); + pres.save(RunExamples.getOutPath() + "test.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SettingDateFormatForCategoryAxis + } + + public static String convertToOADate(GregorianCalendar date) throws ParseException + { + double oaDate; + SimpleDateFormat myFormat = new SimpleDateFormat("dd MM yyyy"); + java.util.Date baseDate = myFormat.parse("30 12 1899"); + Long days = TimeUnit.DAYS.convert(date.getTimeInMillis() - baseDate.getTime(), TimeUnit.MILLISECONDS); + + oaDate = (double) days + ((double) date.get(Calendar.HOUR_OF_DAY) / 24) + ((double) date.get(Calendar.MINUTE) / (60 * 24)) + ((double) date.get(Calendar.SECOND) / (60 * 24 * 60)); + return String.valueOf(oaDate); + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SettingFontProperties.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SettingFontProperties.java new file mode 100644 index 00000000..f2a7d250 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SettingFontProperties.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SettingFontProperties +{ + public static void main(String[] args) + { + //ExStart:SettingFontProperties + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "test.pptx"); + try + { + + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 600, 400); + + chart.setDataTable(true); + + chart.getChartDataTable().getTextFormat().getPortionFormat().setFontBold(NullableBool.True); + chart.getChartDataTable().getTextFormat().getPortionFormat().setFontHeight(20); + + pres.save(dataDir + "output.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + } + //ExEnd:SettingFontProperties +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SettingPositionAxis.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SettingPositionAxis.java new file mode 100644 index 00000000..ca76d243 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SettingPositionAxis.java @@ -0,0 +1,32 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.ChartType; +import com.aspose.slides.IChart; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SettingPositionAxis +{ + public static void main(String[] args) + { + //ExStart:SettingPositionAxis + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 450, 300); + chart.getAxes().getHorizontalAxis().setAxisBetweenCategories(true); + + pres.save(dataDir + "AsposeScatterChart.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SettingPositionAxis + + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SettingRotationAngle.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SettingRotationAngle.java new file mode 100644 index 00000000..44f3caa8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SettingRotationAngle.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.ChartType; +import com.aspose.slides.IChart; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SettingRotationAngle +{ + public static void main(String[] args) + { + //ExStart:SettingRotationAngle + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 450, 300); + chart.getAxes().getVerticalAxis().setTitle(true); + chart.getAxes().getVerticalAxis().getTitle().getTextFormat().getTextBlockFormat().setRotationAngle(90); + + pres.save(dataDir + "test.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SettingRotationAngle + + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ShowingDisplayUnitLabel.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ShowingDisplayUnitLabel.java new file mode 100644 index 00000000..32894a29 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ShowingDisplayUnitLabel.java @@ -0,0 +1,27 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ShowingDisplayUnitLabel +{ + public static void main(String[] args) + { + //ExStart:ShowingDisplayUnitLabel + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "Test.pptx"); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 450, 300); + chart.getAxes().getVerticalAxis().setDisplayUnit(DisplayUnitType.Millions); + pres.save(dataDir + "Result.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ShowingDisplayUnitLabel + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SpreadsheetFormulasOptions.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SpreadsheetFormulasOptions.java new file mode 100644 index 00000000..a2642061 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SpreadsheetFormulasOptions.java @@ -0,0 +1,45 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; + +import java.util.Locale; + + +public class SpreadsheetFormulasOptions +{ + public static void main(String[] args) + { + LoadOptions loadOptions = new LoadOptions(); + + // Set preferred culture information for calculating some functions intended for use with languages + // that use the double-byte character set (DBCS). + loadOptions.getSpreadsheetOptions().setPreferredCulture(new Locale("ja-JP")); + + Presentation presentation = new Presentation(loadOptions); + try + { + IChart chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 150, 150, 500, 300); + IChartDataWorkbook workbook = chart.getChartData().getChartDataWorkbook(); + + IChartDataCell cell = workbook.getCell(0, "B2"); + + // Use the Formula property of the IChartDataCell interface to write a formula in a cell. + cell.setFormula("FINDB(\"ス\", \"テキスト\")"); + workbook.calculateFormulas(); + + //Check calculation. + if (Double.parseDouble(cell.getValue().toString()) == 5) + { + System.out.println("Calculated value = 5."); + } else + { + System.out.println("Wrong calculation!"); + } + } + finally + { + if (presentation != null) presentation.dispose(); + } + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SunburstChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SunburstChart.java new file mode 100644 index 00000000..3eae9de9 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SunburstChart.java @@ -0,0 +1,71 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SunburstChart +{ + //ExStart:SunburstChart + public static void main(String[] args) + { + + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "test.pptx"); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Sunburst, 50, 50, 500, 400); + chart.getChartData().getCategories().clear(); + chart.getChartData().getSeries().clear(); + + IChartDataWorkbook wb = chart.getChartData().getChartDataWorkbook(); + + wb.clear(0); + + //branch 1 + IChartCategory leaf = chart.getChartData().getCategories().add(wb.getCell(0, "C1", "Leaf1")); + leaf.getGroupingLevels().setGroupingItem(1, "Stem1"); + leaf.getGroupingLevels().setGroupingItem(2, "Branch1"); + + chart.getChartData().getCategories().add(wb.getCell(0, "C2", "Leaf2")); + + leaf = chart.getChartData().getCategories().add(wb.getCell(0, "C3", "Leaf3")); + leaf.getGroupingLevels().setGroupingItem(1, "Stem2"); + + chart.getChartData().getCategories().add(wb.getCell(0, "C4", "Leaf4")); + + //branch 2 + leaf = chart.getChartData().getCategories().add(wb.getCell(0, "C5", "Leaf5")); + leaf.getGroupingLevels().setGroupingItem(1, "Stem3"); + leaf.getGroupingLevels().setGroupingItem(2, "Branch2"); + + chart.getChartData().getCategories().add(wb.getCell(0, "C6", "Leaf6")); + + leaf = chart.getChartData().getCategories().add(wb.getCell(0, "C7", "Leaf7")); + leaf.getGroupingLevels().setGroupingItem(1, "Stem4"); + + chart.getChartData().getCategories().add(wb.getCell(0, "C8", "Leaf8")); + + IChartSeries series = chart.getChartData().getSeries().add(ChartType.Sunburst); + series.getLabels().getDefaultDataLabelFormat().setShowCategoryName(true); + series.getDataPoints().addDataPointForSunburstSeries(wb.getCell(0, "D1", 4)); + series.getDataPoints().addDataPointForSunburstSeries(wb.getCell(0, "D2", 5)); + series.getDataPoints().addDataPointForSunburstSeries(wb.getCell(0, "D3", 3)); + series.getDataPoints().addDataPointForSunburstSeries(wb.getCell(0, "D4", 6)); + series.getDataPoints().addDataPointForSunburstSeries(wb.getCell(0, "D5", 9)); + series.getDataPoints().addDataPointForSunburstSeries(wb.getCell(0, "D6", 9)); + series.getDataPoints().addDataPointForSunburstSeries(wb.getCell(0, "D7", 4)); + series.getDataPoints().addDataPointForSunburstSeries(wb.getCell(0, "D8", 3)); + + + pres.save("Sunburst.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + } + //ExEnd:SunburstChart +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForBubbleChartScaling.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForBubbleChartScaling.java new file mode 100644 index 00000000..a496643c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForBubbleChartScaling.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.ChartType; +import com.aspose.slides.IChart; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SupportForBubbleChartScaling +{ + public static void main(String[] args) + { + //ExStart:SupportForBubbleChartScaling + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Bubble, 100, 100, 400, 300); + + chart.getChartData().getSeriesGroups().get_Item(0).setBubbleSizeScale(150); + ; + + pres.save(dataDir + "Result.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:SupportForBubbleChartScaling + + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForChangingSeriesColor.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForChangingSeriesColor.java new file mode 100644 index 00000000..c8bd3552 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForChangingSeriesColor.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class SupportForChangingSeriesColor +{ + public static void main(String[] args) + { + //ExStart:SupportForChangingSeriesColor + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(dataDir + "test.pptx"); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 50, 50, 600, 400); + + IChartDataPoint point = chart.getChartData().getSeries().get_Item(0).getDataPoints().get_Item(1); + + point.setExplosion(30); + + point.getFormat().getFill().setFillType(FillType.Solid); + + point.getFormat().getFill().getSolidFillColor().setColor(Color.BLUE); + + + pres.save(dataDir + "output.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SupportForChangingSeriesColor + + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForChartAreaRoundedBorders.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForChartAreaRoundedBorders.java new file mode 100644 index 00000000..dab52e55 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForChartAreaRoundedBorders.java @@ -0,0 +1,32 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SupportForChartAreaRoundedBorders +{ + public static void main(String[] args) + { + //ExStart:SupportForChartAreaRoundedBorders + String dataDir = RunExamples.getDataDir_Charts(); + Presentation presentation = new Presentation(); + try + { + ISlide slide = presentation.getSlides().get_Item(0); + IChart chart = slide.getShapes().addChart(ChartType.ClusteredColumn, 20, 100, 600, 400); + chart.getLineFormat().getFillFormat().setFillType(FillType.Solid); + chart.getLineFormat().setStyle(LineStyle.Single); + chart.setRoundedCorners(true); + ; + + presentation.save(dataDir + "out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + } + //ExEnd:SupportForChartAreaRoundedBorders +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForPrecisionOfData.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForPrecisionOfData.java new file mode 100644 index 00000000..8b391146 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForPrecisionOfData.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.ChartType; +import com.aspose.slides.IChart; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SupportForPrecisionOfData +{ + public static void main(String[] args) + { + //ExStart:SupportForPrecisionOfData + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Line, 50, 50, 450, 300); + chart.setDataTable(true); + chart.getChartData().getSeries().get_Item(0).setNumberFormatOfValues("#,##0.00"); + + pres.save(dataDir + "PrecisionOfDatalabels_out.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SupportForPrecisionOfData + } +} + + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForStockChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForStockChart.java new file mode 100644 index 00000000..31e286c1 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForStockChart.java @@ -0,0 +1,71 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SupportForStockChart +{ + public static void main(String[] args) + { + //ExStart:SupportForStockChart + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "Test.pptx"); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.OpenHighLowClose, 50, 50, 600, 400, false); + + chart.getChartData().getSeries().clear(); + chart.getChartData().getCategories().clear(); + + IChartDataWorkbook wb = chart.getChartData().getChartDataWorkbook(); + + chart.getChartData().getCategories().add(wb.getCell(0, 1, 0, "A")); + chart.getChartData().getCategories().add(wb.getCell(0, 2, 0, "B")); + chart.getChartData().getCategories().add(wb.getCell(0, 3, 0, "C")); + + chart.getChartData().getSeries().add(wb.getCell(0, 0, 1, "Open"), chart.getType()); + chart.getChartData().getSeries().add(wb.getCell(0, 0, 2, "High"), chart.getType()); + chart.getChartData().getSeries().add(wb.getCell(0, 0, 3, "Low"), chart.getType()); + chart.getChartData().getSeries().add(wb.getCell(0, 0, 4, "Close"), chart.getType()); + + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + + series.getDataPoints().addDataPointForStockSeries(wb.getCell(0, 1, 1, 72)); + series.getDataPoints().addDataPointForStockSeries(wb.getCell(0, 2, 1, 25)); + series.getDataPoints().addDataPointForStockSeries(wb.getCell(0, 3, 1, 38)); + + series = chart.getChartData().getSeries().get_Item(1); + series.getDataPoints().addDataPointForStockSeries(wb.getCell(0, 1, 2, 172)); + series.getDataPoints().addDataPointForStockSeries(wb.getCell(0, 2, 2, 57)); + series.getDataPoints().addDataPointForStockSeries(wb.getCell(0, 3, 2, 57)); + + series = chart.getChartData().getSeries().get_Item(2); + series.getDataPoints().addDataPointForStockSeries(wb.getCell(0, 1, 3, 12)); + series.getDataPoints().addDataPointForStockSeries(wb.getCell(0, 2, 3, 12)); + series.getDataPoints().addDataPointForStockSeries(wb.getCell(0, 3, 3, 13)); + + series = chart.getChartData().getSeries().get_Item(3); + series.getDataPoints().addDataPointForStockSeries(wb.getCell(0, 1, 4, 25)); + series.getDataPoints().addDataPointForStockSeries(wb.getCell(0, 2, 4, 38)); + series.getDataPoints().addDataPointForStockSeries(wb.getCell(0, 3, 4, 50)); + + chart.getChartData().getSeriesGroups().get_Item(0).getUpDownBars().setUpDownBars(true); + chart.getChartData().getSeriesGroups().get_Item(0).getHiLowLinesFormat().getLine().getFillFormat().setFillType(FillType.Solid); + + for (IChartSeries ser : chart.getChartData().getSeries()) + { + ser.getFormat().getLine().getFillFormat().setFillType(FillType.NoFill); + } + + pres.save(dataDir + "output.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + } + //ExEnd:SupportForStockChart +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForSwitchingRowsAndColumns.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForSwitchingRowsAndColumns.java new file mode 100644 index 00000000..f4f3add8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportForSwitchingRowsAndColumns.java @@ -0,0 +1,43 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SupportForSwitchingRowsAndColumns +{ + public static void main(String[] args) + { + //ExStart:SupportForSwitchingRowsAndColumns + + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "Test.pptx"); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 400, 300); + + IChartDataCell[] categoriesCells = new IChartDataCell[chart.getChartData().getCategories().size()]; + + for (int i = 0; i < chart.getChartData().getCategories().size(); i++) + { + categoriesCells[i] = chart.getChartData().getCategories().get_Item(i).getAsCell(); + } + + IChartDataCell[] seriesCells = new IChartDataCell[chart.getChartData().getSeries().size()]; + for (int i = 0; i < chart.getChartData().getSeries().size(); i++) + { + seriesCells[i] = chart.getChartData().getSeries().get_Item(i).getName().getAsCells().get_Item(0); + } + + chart.getChartData().switchRowColumn(); + + pres.save(RunExamples.getOutPath() + "Test_out.pptx", SaveFormat.Pptx); + //ExEnd:SupportForSwitchingRowsAndColumns + } + finally + { + if (pres != null) pres.dispose(); + } + + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SupportOfBubbleSizeRepresentation.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportOfBubbleSizeRepresentation.java new file mode 100644 index 00000000..80679f39 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SupportOfBubbleSizeRepresentation.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SupportOfBubbleSizeRepresentation +{ + + public static void main(String[] args) + { + + + //ExStart:SupportOfBubbleSizeRepresentation + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Bubble, 50, 50, 600, 400, true); + + chart.getChartData().getSeriesGroups().get_Item(0).setBubbleSizeRepresentation(BubbleSizeRepresentationType.Width); + + pres.save(dataDir + "Presentation_BubbleSizeRepresentation.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:SupportOfBubbleSizeRepresentation + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/SwitchChartRowColumns.java b/Examples/src/main/java/com/aspose/slides/examples/charts/SwitchChartRowColumns.java new file mode 100644 index 00000000..34b4daef --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/SwitchChartRowColumns.java @@ -0,0 +1,48 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SwitchChartRowColumns +{ + public static void main(String[] args) + { + //ExStart:SwitchChartRowColumns + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + // Creating empty presentation + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 400, 300); + + //Add data + IChartDataCell[] categoriesCells = new IChartDataCell[chart.getChartData().getCategories().size()]; + + for (int i = 0; i < chart.getChartData().getCategories().size(); i++) + { + categoriesCells[i] = chart.getChartData().getCategories().get_Item(i).getAsCell(); + } + + IChartDataCell[] seriesCells = new IChartDataCell[chart.getChartData().getSeries().size()]; + for (int i = 0; i < chart.getChartData().getSeries().size(); i++) + { + seriesCells[i] = chart.getChartData().getSeries().get_Item(i).getName().getAsCells().get_Item(0); + } + + //Switching rows and columns + chart.getChartData().switchRowColumn(); + + // Saving presentation + pres.save(RunExamples.getOutPath() + "SwitchChartRowColumns_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SwitchChartRowColumns + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/TimeUnitTypeEnum.java b/Examples/src/main/java/com/aspose/slides/examples/charts/TimeUnitTypeEnum.java new file mode 100644 index 00000000..0f30577b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/TimeUnitTypeEnum.java @@ -0,0 +1,28 @@ +package com.aspose.slides.examples.charts; + + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class TimeUnitTypeEnum +{ + public static void main(String[] args) + { + //ExStart:SwitchChartRowColumns + String resultPath = RunExamples.getOutPath() + "TimeUnitTypeEnum.pptx"; + + // Creating empty presentation + Presentation pres = new Presentation(); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Area, 10, 10, 400, 300, true); + chart.getAxes().getHorizontalAxis().setMajorUnitScale(TimeUnitType.None); + pres.save(resultPath, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:TimeUnitTypeEnum + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/TitleLegendChartExample.java b/Examples/src/main/java/com/aspose/slides/examples/charts/TitleLegendChartExample.java new file mode 100644 index 00000000..ab2092fb --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/TitleLegendChartExample.java @@ -0,0 +1,29 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; + +public class TitleLegendChartExample +{ + public static void main(String[] args) + { + //ExStart:TitleLegendChartExample + Presentation pres = new Presentation(); + try { + Chart chart = (Chart)pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 500, 350); + chart.validateChartLayout(); + + IChartTitle chartTitle = chart.getChartTitle(); + System.out.println("ChartTitle.X = " + chartTitle.getActualX() + ", ChartTitle.Y = " + chartTitle.getActualY()); + System.out.println("ChartTitle.Width = " + chartTitle.getActualWidth() + ", ChartTitle.Height = " + chartTitle.getActualHeight()); + + ILegend legend = chart.getLegend(); + System.out.println("Legend.X = " + legend.getActualX() + ", Legend.Y = " + legend.getActualY()); + System.out.println("Legend.Width = " + legend.getActualWidth() + ", Legend.Height = " + legend.getActualHeight()); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:TitleLegendChartExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/TreeMapChart.java b/Examples/src/main/java/com/aspose/slides/examples/charts/TreeMapChart.java new file mode 100644 index 00000000..a4c09bc0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/TreeMapChart.java @@ -0,0 +1,74 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class TreeMapChart +{ + + //ExStart:TreeMapChart + public static void main(String[] args) + { + + + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "test.pptx"); + try + { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Treemap, 50, 50, 500, 400); + chart.getChartData().getCategories().clear(); + chart.getChartData().getSeries().clear(); + + IChartDataWorkbook wb = chart.getChartData().getChartDataWorkbook(); + + wb.clear(0); + + //branch 1 + IChartCategory leaf = chart.getChartData().getCategories().add(wb.getCell(0, "C1", "Leaf1")); + leaf.getGroupingLevels().setGroupingItem(1, "Stem1"); + leaf.getGroupingLevels().setGroupingItem(2, "Branch1"); + + chart.getChartData().getCategories().add(wb.getCell(0, "C2", "Leaf2")); + + leaf = chart.getChartData().getCategories().add(wb.getCell(0, "C3", "Leaf3")); + leaf.getGroupingLevels().setGroupingItem(1, "Stem2"); + + chart.getChartData().getCategories().add(wb.getCell(0, "C4", "Leaf4")); + + + //branch 2 + leaf = chart.getChartData().getCategories().add(wb.getCell(0, "C5", "Leaf5")); + leaf.getGroupingLevels().setGroupingItem(1, "Stem3"); + leaf.getGroupingLevels().setGroupingItem(2, "Branch2"); + + chart.getChartData().getCategories().add(wb.getCell(0, "C6", "Leaf6")); + + leaf = chart.getChartData().getCategories().add(wb.getCell(0, "C7", "Leaf7")); + leaf.getGroupingLevels().setGroupingItem(1, "Stem4"); + + chart.getChartData().getCategories().add(wb.getCell(0, "C8", "Leaf8")); + + IChartSeries series = chart.getChartData().getSeries().add(ChartType.Treemap); + series.getLabels().getDefaultDataLabelFormat().setShowCategoryName(true); + series.getDataPoints().addDataPointForTreemapSeries(wb.getCell(0, "D1", 4)); + series.getDataPoints().addDataPointForTreemapSeries(wb.getCell(0, "D2", 5)); + series.getDataPoints().addDataPointForTreemapSeries(wb.getCell(0, "D3", 3)); + series.getDataPoints().addDataPointForTreemapSeries(wb.getCell(0, "D4", 6)); + series.getDataPoints().addDataPointForTreemapSeries(wb.getCell(0, "D5", 9)); + series.getDataPoints().addDataPointForTreemapSeries(wb.getCell(0, "D6", 9)); + series.getDataPoints().addDataPointForTreemapSeries(wb.getCell(0, "D7", 4)); + series.getDataPoints().addDataPointForTreemapSeries(wb.getCell(0, "D8", 3)); + + series.setParentLabelLayout(ParentLabelLayoutType.Overlapping); + + pres.save("Treemap.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + } + //ExEnd:TreeMapChart +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/UsingWorkBookChartcellAsDatalabel.java b/Examples/src/main/java/com/aspose/slides/examples/charts/UsingWorkBookChartcellAsDatalabel.java new file mode 100644 index 00000000..f3711bbe --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/UsingWorkBookChartcellAsDatalabel.java @@ -0,0 +1,51 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class UsingWorkBookChartcellAsDatalabel +{ + public static void main(String[] args) + { + //ExStart:UsingWorkBookChartcellAsDatalabel + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + + + String lbl0 = "Label 0 cell value"; + String lbl1 = "Label 1 cell value"; + String lbl2 = "Label 2 cell value"; + + // Instantiate Presentation class that represents a presentation file + + Presentation pres = new Presentation(dataDir + "chart2.pptx"); + try + { + ISlide slide = pres.getSlides().get_Item(0); + + + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Bubble, 50, 50, 600, 400, true); + + IChartSeriesCollection series = chart.getChartData().getSeries(); + + series.get_Item(0).getLabels().getDefaultDataLabelFormat().setShowLabelValueFromCell(true); + + IChartDataWorkbook wb = chart.getChartData().getChartDataWorkbook(); + + series.get_Item(0).getLabels().get_Item(0).setValueFromCell(wb.getCell(0, "A10", lbl0)); + series.get_Item(0).getLabels().get_Item(1).setValueFromCell(wb.getCell(0, "A11", lbl1)); + series.get_Item(0).getLabels().get_Item(2).setValueFromCell(wb.getCell(0, "A12", lbl2)); + + pres.save(dataDir + "resultchart.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:UsingWorkBookChartcellAsDatalabel + + + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/ValidateChartLayoutAdded.java b/Examples/src/main/java/com/aspose/slides/examples/charts/ValidateChartLayoutAdded.java new file mode 100644 index 00000000..310d0acc --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/ValidateChartLayoutAdded.java @@ -0,0 +1,39 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.Chart; +import com.aspose.slides.ChartType; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ValidateChartLayoutAdded +{ + public static void main(String[] args) + { + //ExStart:ValidateChartLayoutAdded + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "test.pptx"); + try + { + Chart chart = (Chart) pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 500, 350); + chart.validateChartLayout(); + double x = chart.getPlotArea().getActualX(); + double y = chart.getPlotArea().getActualY(); + double w = chart.getPlotArea().getActualWidth(); + double h = chart.getPlotArea().getActualHeight(); + + + // Saving presentation + pres.save(dataDir + "Result.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + + //ExEnd:ValidateChartLayoutAdded + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/charts/WorksheetsExample.java b/Examples/src/main/java/com/aspose/slides/examples/charts/WorksheetsExample.java new file mode 100644 index 00000000..e42ffed5 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/charts/WorksheetsExample.java @@ -0,0 +1,30 @@ +package com.aspose.slides.examples.charts; + +import com.aspose.slides.ChartType; +import com.aspose.slides.IChart; +import com.aspose.slides.IChartDataWorkbook; +import com.aspose.slides.Presentation; + +/* +This example demonstrates using the IChartDataWorksheetCollection interface, ChartDataWorksheetCollection class, and IChartDataWorkbook.getWorksheets() method. +*/ +public class WorksheetsExample +{ + public static void main(String[] args) + { + //ExStart:WorksheetsExample + Presentation pres = new Presentation(); + try { + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 50, 50, 400, 500); + + IChartDataWorkbook workbook = chart.getChartData().getChartDataWorkbook(); + for (int i = 0; i < workbook.getWorksheets().size(); i++) + { + System.out.println(workbook.getWorksheets().get_Item(i).getName()); + } + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:WorksheetsExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/AccessBuiltinProperties.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/AccessBuiltinProperties.java new file mode 100644 index 00000000..e8e27618 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/AccessBuiltinProperties.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.presentations; + +import com.aspose.slides.IDocumentProperties; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class AccessBuiltinProperties +{ + public static void main(String[] args) + { + //ExStart:AccessBuiltinProperties + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationProperties(); + + // Instantiate the Presentation class that represents the presentation + Presentation pres = new Presentation(dataDir + "AccessBuiltin Properties.pptx"); + + // Create a reference to IDocumentProperties object associated with Presentation + IDocumentProperties documentProperties = pres.getDocumentProperties(); + + // Display the builtin properties + System.out.println("Category : " + documentProperties.getCategory()); + System.out.println("Current Status : " + documentProperties.getContentStatus()); + System.out.println("Creation Date : " + documentProperties.getCreatedTime()); + System.out.println("Author : " + documentProperties.getAuthor()); + System.out.println("Description : " + documentProperties.getComments()); + System.out.println("KeyWords : " + documentProperties.getKeywords()); + System.out.println("Last Modified By : " + documentProperties.getLastSavedBy()); + System.out.println("Supervisor : " + documentProperties.getManager()); + System.out.println("Modified Date : " + documentProperties.getLastSavedTime()); + System.out.println("Presentation Format : " + documentProperties.getPresentationFormat()); + System.out.println("Last Print Date : " + documentProperties.getLastPrinted()); + System.out.println("Is Shared between producers : " + documentProperties.getSharedDoc()); + System.out.println("Subject : " + documentProperties.getSubject()); + System.out.println("Title : " + documentProperties.getTitle()); + //ExEnd:AccessBuiltinProperties + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/AccessProperties.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/AccessProperties.java new file mode 100644 index 00000000..7670dacb --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/AccessProperties.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.presentations; + +import com.aspose.slides.IDocumentProperties; +import com.aspose.slides.LoadOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class AccessProperties +{ + public static void main(String[] args) + { + //ExStart:AccessProperties + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationProperties(); + + // Accessing the Document Properties of a Password Protected Presentation without Password + // creating instance of load options to set the presentation access password + LoadOptions loadOptions = new LoadOptions(); + + // Setting the access password to null + loadOptions.setPassword(null); + + // Setting the access to document properties + loadOptions.setOnlyLoadDocumentProperties(true); + + // Opening the presentation file by passing the file path and load options to the constructor of Presentation class + Presentation pres = new Presentation(dataDir + "AccessProperties.pptx", loadOptions); + + // Getting Document Properties + IDocumentProperties docProps = pres.getDocumentProperties(); + + System.out.println("Name of Application : " + docProps.getNameOfApplication()); + //ExEnd:AccessProperties + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/ModifyBuiltinProperties.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/ModifyBuiltinProperties.java new file mode 100644 index 00000000..bdb9bdb0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/ModifyBuiltinProperties.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.presentations; + +import com.aspose.slides.IDocumentProperties; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ModifyBuiltinProperties +{ + public static void main(String[] args) + { + //ExStart:ModifyBuiltinProperties + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationProperties(); + + // Instantiate the Presentation class that represents the Presentation + Presentation presentation = new Presentation(dataDir + "ModifyBuiltinProperties.pptx"); + try + { + // Create a reference to IDocumentProperties object associated with Presentation + IDocumentProperties documentProperties = presentation.getDocumentProperties(); + + // Set the builtin properties + documentProperties.setAuthor("Aspose.Slides for .NET"); + documentProperties.setTitle("Modifying Presentation Properties"); + documentProperties.setSubject("Aspose Subject"); + documentProperties.setComments("Aspose Description"); + documentProperties.setManager("Aspose Manager"); + + // Save your presentation to a file + presentation.save(dataDir + "DocumentProperties_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ModifyBuiltinProperties + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/UpdatePresentationPropertiesUsingNewTemplate.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/UpdatePresentationPropertiesUsingNewTemplate.java new file mode 100644 index 00000000..45d50a01 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/UpdatePresentationPropertiesUsingNewTemplate.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.presentations; + +import com.aspose.slides.DocumentProperties; +import com.aspose.slides.IDocumentProperties; +import com.aspose.slides.IPresentationInfo; +import com.aspose.slides.PresentationFactory; +import com.aspose.slides.examples.RunExamples; + + +public class UpdatePresentationPropertiesUsingNewTemplate +{ + //ExStart:UpdatePresentationPropertiesUsingNewTemplate + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationProperties(); + + DocumentProperties template = new DocumentProperties(); + template.setAuthor("Template Author"); + template.setTitle("Template Title"); + template.setCategory("Template Category"); + template.setKeywords("Keyword1, Keyword2, Keyword3"); + template.setCompany("Our Company"); + template.setComments("Created from template"); + template.setContentType("Template Content"); + template.setSubject("Template Subject"); + + updateByTemplate(dataDir + "doc1.pptx", template); + updateByTemplate(dataDir + "doc2.odp", template); + updateByTemplate(dataDir + "doc3.ppt", template); + } + + private static void updateByTemplate(String path, IDocumentProperties template) + { + IPresentationInfo toUpdate = PresentationFactory.getInstance().getPresentationInfo(path); + toUpdate.updateDocumentProperties(template); + toUpdate.writeBindedPresentation(path); + } + //ExEnd:UpdatePresentationPropertiesUsingNewTemplate +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConversionToTIFFNotes.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConversionToTIFFNotes.java new file mode 100644 index 00000000..d8577260 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConversionToTIFFNotes.java @@ -0,0 +1,32 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ConversionToTIFFNotes +{ + public static void main(String[] args) + { + //ExStart:ConversionToTIFFNotes + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "NotesFile.pptx"); + try + { + // Saving the presentation to TIFF notes + presentation.save(dataDir + "Notes_In_Tiff_out.tiff", SaveFormat.Tiff); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ConversionToTIFFNotes + } +} + + + \ No newline at end of file diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertHTMLEmbeddingImages.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertHTMLEmbeddingImages.java new file mode 100644 index 00000000..b00c75f8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertHTMLEmbeddingImages.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Html5Options; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + +public class ConvertHTMLEmbeddingImages +{ + public static void main(String[] args) + { + //ExStart:ConvertHTMLEmbeddingImages + // Path to source presentation + String presentationName = RunExamples.getDataDir_Conversion() + "PresentationDemo.pptx"; + // Path to HTML document + String outFilePath = RunExamples.getOutPath() + "HTMLConvertion" + File.separator; + + Presentation pres = new Presentation(presentationName); + try { + Html5Options options = new Html5Options(); + // Force do not save images in HTML5 document + options.setEmbedImages(false); + // Set path for external images + options.setOutputPath(outFilePath); + + // Create directory for output HTML document + File f = new File(outFilePath); + if (!f.exists()) + f.mkdir(); + + // Save presentation in HTML5 format. + pres.save(outFilePath + "pres.html", SaveFormat.Html5, options); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertHTMLEmbeddingImages + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertImagesToMarkdown.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertImagesToMarkdown.java new file mode 100644 index 00000000..00e993a1 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertImagesToMarkdown.java @@ -0,0 +1,80 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.IImage; +import com.aspose.slides.ISvgImage; +import com.aspose.slides.ImageFormat; +import com.aspose.slides.MarkdownExportType; +import com.aspose.slides.MarkdownSaveOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.UUID; + +/* +This example shows how to control the process of saving and referencing images in the resulting Markdown file +using the ImageSaving and SvgImageSaving events. +*/ +public class ConvertImagesToMarkdown +{ + public static void main(String[] args) + { + + // Path to source presentation + final String presentationName = RunExamples.getDataDir_Conversion() + "demo_2.pptx"; + final String outFilePath = RunExamples.getOutPath() + "output_markdown.md"; + final String imagesDir = RunExamples.getOutPath() + "ExportedImages/"; + + // Check the catalog for images + File imageDir = new File(imagesDir); + if (!imageDir.exists()) { + imageDir.mkdirs(); + } + + //ExStart:ConvertImagesToMarkdown + MarkdownSaveOptions options = new MarkdownSaveOptions(); + options.setImagesSaveFolderName("Images"); + options.setExportType(MarkdownExportType.Visual); + + options.setImageSaving(new MarkdownSaveOptions.MarkdownImageSavingHandler() { + @Override + public boolean invoke(IImage image, int format, String[] link) { + format = ImageFormat.Jpeg; //Force output format to JPEG for all images. + String fileName = "Image_" + UUID.randomUUID() + ".jpg"; + + link[0] = imagesDir + fileName; + image.save(link[0], format); + + return true; + } + }); + + options.setSvgImageSaving(new MarkdownSaveOptions.MarkdownSvgImageSavingHandler() { + @Override + public boolean invoke(ISvgImage svgImage, String[] link) { + String fileName = "Svg_" + UUID.randomUUID() + ".svg"; + + link[0] = imagesDir + fileName; + try { + FileOutputStream f = new FileOutputStream(link[0]); + f.write(svgImage.getSvgData()); + f.close(); + } catch (IOException e) { + e.printStackTrace(); + } + + return true; + } + }); + + Presentation presentation = new Presentation(presentationName); + try { + presentation.save(outFilePath, SaveFormat.Md, options); + } finally { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ConvertImagesToMarkdown + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertIndividualSlide.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertIndividualSlide.java new file mode 100644 index 00000000..919e0280 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertIndividualSlide.java @@ -0,0 +1,66 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertIndividualSlide +{ + //ExStart:ConvertIndividualSlide + public static void main(String[] args) + { + String dataDir = RunExamples.getDataDir_Conversion(); + Presentation presentation = new Presentation(dataDir + "Individual-Slide.pptx"); + try + { + HtmlOptions htmlOptions = new HtmlOptions(); + + htmlOptions.setHtmlFormatter(HtmlFormatter.createCustomFormatter(new CustomFormattingController())); + + NotesCommentsLayoutingOptions notesOptions = new NotesCommentsLayoutingOptions(); + notesOptions.setNotesPosition(NotesPositions.BottomFull); + htmlOptions.setSlidesLayoutOptions(notesOptions); + + // Saving File + for (int i = 0; i < presentation.getSlides().size(); i++) + presentation.save(dataDir + "Individual Slide" + i + 1 + "_out.html", new int[]{i + 1}, SaveFormat.Html, htmlOptions); + } + finally + { + if (presentation != null) presentation.dispose(); + } + } + + public static class CustomFormattingController implements IHtmlFormattingController + { + public void writeDocumentStart(IHtmlGenerator generator, IPresentation presentation) + { + } + + public void writeDocumentEnd(IHtmlGenerator generator, IPresentation presentation) + { + } + + public void writeSlideStart(IHtmlGenerator generator, ISlide slide) + { + generator.addHtml(String.format(SlideHeader, generator.getSlideIndex() + 1)); + } + + public void writeSlideEnd(IHtmlGenerator generator, ISlide slide) + { + generator.addHtml(SlideFooter); + } + + public void writeShapeStart(IHtmlGenerator generator, IShape shape) + { + } + + public void writeShapeEnd(IHtmlGenerator generator, IShape shape) + { + } + + private static String SlideHeader = "
"; + private static String SlideFooter = "
"; + } + //ExEnd:ConvertIndividualSlide +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertNotesSlideView.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertNotesSlideView.java new file mode 100644 index 00000000..b9dfed91 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertNotesSlideView.java @@ -0,0 +1,29 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertNotesSlideView +{ + public static void main(String[] args) + { + //ExStart:ConvertNotesSlideView + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation pres = new Presentation(dataDir + "Convert_Tiff_Default.pptx"); + try + { + // Saving the presentation to TIFF document + pres.save(dataDir + "Tiff_out.tiff", SaveFormat.Tiff); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertNotesSlideView + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertNotesSlideViewToPDF.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertNotesSlideViewToPDF.java new file mode 100644 index 00000000..23069e7b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertNotesSlideViewToPDF.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertNotesSlideViewToPDF +{ + public static void main(String[] args) + { + //ExStart:ConvertNotesSlideViewToPDF + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "NotesFile.pptx"); + try + { + PdfOptions pdfOptions = new PdfOptions(); + NotesCommentsLayoutingOptions options = new NotesCommentsLayoutingOptions(); + options.setNotesPosition(NotesPositions.BottomFull); + pdfOptions.setSlidesLayoutOptions(options); + + // Saving the presentation to PDF notes + presentation.save(dataDir + "Pdf_Notes_out.pdf", SaveFormat.Pdf, pdfOptions); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ConvertNotesSlideViewToPDF + } +} + + + \ No newline at end of file diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertPresentationToPasswordProtectedPDF.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertPresentationToPasswordProtectedPDF.java new file mode 100644 index 00000000..b69da9bd --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertPresentationToPasswordProtectedPDF.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.PdfOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertPresentationToPasswordProtectedPDF +{ + public static void main(String[] args) + { + //ExStart:ConvertPresentationToPasswordProtectedPDF + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "DemoFile.pptx"); + try + { + // Instantiate the PdfOptions class + PdfOptions pdfOptions = new PdfOptions(); + + // Setting PDF password + pdfOptions.setPassword("password"); + + // Save the presentation to password protected PDF + presentation.save(dataDir + "PasswordProtectedPDF_out.pdf", SaveFormat.Pdf, pdfOptions); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ConvertPresentationToPasswordProtectedPDF + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertPresentationToResponsiveHTML.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertPresentationToResponsiveHTML.java new file mode 100644 index 00000000..aa6d33d2 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertPresentationToResponsiveHTML.java @@ -0,0 +1,32 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertPresentationToResponsiveHTML +{ + public static void main(String[] args) + { + //ExStart:ConvertPresentationToResponsiveHTML + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "Convert_HTML.pptx"); + try + { + ResponsiveHtmlController controller = new ResponsiveHtmlController(); + HtmlOptions htmlOptions = new HtmlOptions(); + htmlOptions.setHtmlFormatter(HtmlFormatter.createCustomFormatter(controller)); + + // Saving the presentation to HTML + presentation.save(dataDir + "ConvertPresentationToResponsiveHTML_out.html", SaveFormat.Html, htmlOptions); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ConvertPresentationToResponsiveHTML + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertSlidesToPdfNotes.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertSlidesToPdfNotes.java new file mode 100644 index 00000000..fce9df9b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertSlidesToPdfNotes.java @@ -0,0 +1,51 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertSlidesToPdfNotes +{ + public static void main(String[] args) + { + //ExStart:ConvertSlidesToPdfNotes + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "SelectedSlides.pptx"); + try + { + Presentation auxPresentation = new Presentation(); + try + { + ISlide slide = presentation.getSlides().get_Item(0); + + auxPresentation.getSlides().insertClone(0, slide); + + // Setting Slide Type and Size + //auxPresentation.getSlideSize().setSize(presentation.getSlideSize().getSize().getWidth(), presentation.getSlideSize().getSize().getHeight(),SlideSizeScaleType.EnsureFit); + auxPresentation.getSlideSize().setSize(612F, 792F, SlideSizeScaleType.EnsureFit); + + + PdfOptions pdfOptions = new PdfOptions(); + NotesCommentsLayoutingOptions options = new NotesCommentsLayoutingOptions(); + options.setNotesPosition(NotesPositions.BottomFull); + pdfOptions.setSlidesLayoutOptions(options); + + + auxPresentation.save(dataDir + "PDFnotes_out.pdf", SaveFormat.Pdf, pdfOptions); + } + finally + { + if (auxPresentation != null) auxPresentation.dispose(); + } + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ConvertSlidesToPdfNotes + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertSpecificSlideToPDF.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertSpecificSlideToPDF.java new file mode 100644 index 00000000..7e98817d --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertSpecificSlideToPDF.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertSpecificSlideToPDF +{ + public static void main(String[] args) + { + //ExStart:ConvertSpecificSlideToPDF + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "SelectedSlides.pptx"); + try + { + // Setting array of slides positions + int[] slides = {1, 3}; + + // Save the presentation to PDF + presentation.save(dataDir + "RequiredSelectedSlides_out.pdf", slides, SaveFormat.Pdf); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ConvertSpecificSlideToPDF + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertSvgToEmf.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertSvgToEmf.java new file mode 100644 index 00000000..f0240eb1 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertSvgToEmf.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.ISvgImage; +import com.aspose.slides.SvgImage; +import com.aspose.slides.examples.RunExamples; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class ConvertSvgToEmf +{ + public static void main(String[] args) + { + // The path to the document directory. + String dataDir = RunExamples.getDataDir_Conversion(); + //Out path + String resultPath = RunExamples.getOutPath() + "SvgAsEmf.emf"; + + //ExStart:ConvertSvgToEmf + try { + // Creates the new SVG image + ISvgImage svgImage = new SvgImage(Files.readAllBytes(Paths.get(dataDir + "content.svg"))); + // Saves the SVG image as a metafile + FileOutputStream fileStream = new FileOutputStream(resultPath); + svgImage.writeAsEmf(fileStream); + fileStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + //ExEnd:ConvertSvgToEmf + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToAnimation.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToAnimation.java new file mode 100644 index 00000000..d9a93fd6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToAnimation.java @@ -0,0 +1,47 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import javax.imageio.ImageIO; +import java.io.IOException; + +/* +Aspose.Slides can play presentations and generate a set of frames for an entire animation with a specific frame per second (FPS). +Those frames can then be used to create a video through tools like FFmpeg. + +This Java code demonstrates a presentation to video export operation with frames set at 30FPS +*/ +public class ConvertToAnimation +{ + public static void main(String[] args) + { + //ExStart:ConvertToAnimation + String presentationName = RunExamples.getDataDir_Conversion() + "SimpleAnimations.pptx"; + final String outPath = RunExamples.getOutPath(); + final int FPS = 30; + + Presentation pres = new Presentation(presentationName); + try { + PresentationAnimationsGenerator animationsGenerator = new PresentationAnimationsGenerator(pres); + try { + PresentationPlayer player = new PresentationPlayer(animationsGenerator, 33); + try { + player.setFrameTick(new PresentationPlayer.FrameTick() { + public void invoke(PresentationPlayer sender, FrameTickEventArgs arg) { + arg.getFrame().save(outPath + "frame_" + sender.getFrameIndex() + ".png"); + } + }); + animationsGenerator.run(pres.getSlides()); + } finally { + if (player != null) player.dispose(); + } + } finally { + if (animationsGenerator != null) animationsGenerator.dispose(); + } + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertToAnimation + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToBlackWiteTiff.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToBlackWiteTiff.java new file mode 100644 index 00000000..49cce9b3 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToBlackWiteTiff.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertToBlackWiteTiff +{ + //ExStart:ConvertToBlackWiteTiff + public static void main(String[] args) + { + // Path to source presentation + String presentationName = RunExamples.getDataDir_Conversion() + "SimpleAnimations.pptx"; + // Path to output document + String outFilePath = RunExamples.getOutPath() + "BlackWhite_out.tiff"; + + Presentation presentation = new Presentation(presentationName); + try { + // Instantiate the TiffOptions class + TiffOptions options = new TiffOptions(); + // Set compressio type + options.setCompressionType(TiffCompressionTypes.CCITT4); + // Set convertion mode + options.setBwConversionMode(BlackWhiteConversionMode.Dithering); + + // Save output file + presentation.save(outFilePath, new int[] { 2 }, SaveFormat.Tiff, options); + } finally { + if (presentation != null) presentation.dispose(); + } + } + //ExEnd:ConvertToBlackWiteTiff +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToEmf.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToEmf.java new file mode 100644 index 00000000..d26d1c51 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToEmf.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.ISvgImage; +import com.aspose.slides.Presentation; +import com.aspose.slides.SvgImage; +import com.aspose.slides.examples.RunExamples; + +import java.io.FileOutputStream; +import java.io.IOException; + +public class ConvertToEmf +{ + public static void main(String[] args) + { + // The path to the document directory. + String dataDir = RunExamples.getDataDir_Conversion(); + //Out path + String resultPath = RunExamples.getOutPath() + "Result.emf"; + + //ExStart:ConvertToEmf + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "HelloWorld.pptx"); + try { + FileOutputStream fileStream = new FileOutputStream(resultPath); + // Saves the first slide as a metafille + presentation.getSlides().get_Item(0).writeAsEmf(fileStream); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ConvertToEmf + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToGif.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToGif.java new file mode 100644 index 00000000..190bb580 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToGif.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.presentations.conversion;/* + * Copyright (c) 2009-2021 Aspose Pty Ltd. All Rights Reserved. + */ + +import com.aspose.slides.GifOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + +public class ConvertToGif +{ + //ExStart:ConvertToGif + public static void main(String[] args) + { + // The path to the documents directory + String dataDir = RunExamples.getDataDir_Conversion(); + + // The path to output file + String outPath = RunExamples.getOutPath() + "ConvertToGif.gif"; + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "ConvertToGif.pptx"); + try { + GifOptions gifOptions = new GifOptions(); + gifOptions.setFrameSize(new Dimension(540, 480)); // the size of the resulted GIF + gifOptions.setDefaultDelay(1500); // how long each slide will be showed until it will be changed to the next one + gifOptions.setTransitionFps(60); // increase FPS to better transition animation quality + // Save the presentation to Gif + presentation.save(outPath, SaveFormat.Gif, gifOptions); + } finally { + if (presentation != null) presentation.dispose(); + } + } + //ExEnd:ConvertToGif +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToHandout.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToHandout.java new file mode 100644 index 00000000..b3d6195f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToHandout.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class ConvertToHandout +{ + public static void main(String[] args) + { + // The path to the documents directory + String dataDir = RunExamples.getDataDir_Conversion(); + + // The path to output file + String outFilePath = RunExamples.getOutPath() + "HandoutExample.pdf"; + + //ExStart:ConvertToHandout + Presentation pres = new Presentation(dataDir + "HandoutExample.pptx"); + try { + // Set convertion options + PdfOptions options = new PdfOptions(); + options.setShowHiddenSlides(true); + + // Set Handout Layouting + HandoutLayoutingOptions slidesLayoutOptions = new HandoutLayoutingOptions(); + // Set printing four slides per page in a horizontal sequence + slidesLayoutOptions.setHandout(HandoutType.Handouts4Horizontal); + options.setSlidesLayoutOptions(slidesLayoutOptions); + + // Save result + pres.save(outFilePath, SaveFormat.Pdf, options); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertToHandout + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToHtml5.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToHtml5.java new file mode 100644 index 00000000..cd249766 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToHtml5.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Html5Options; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +/* +This example demonstrates the saving presentation in HTML5 operation. +*/ +public class ConvertToHtml5 +{ + public static void main(String[] args) + { + // The path to the documents directory + String dataDir = RunExamples.getDataDir_Conversion(); + + // The path to output file + String outFilePath = RunExamples.getOutPath() + "Demo.html"; + + //ExStart:ConvertToHtml5 + Presentation pres = new Presentation(dataDir + "Demo.pptx"); + try { + // Export a presentation containing slides transitions, animations, and shapes animations to HTML5 + Html5Options options = new Html5Options(); + options.setAnimateShapes(true); + options.setAnimateTransitions(true); + + // Save presentation + pres.save(outFilePath, SaveFormat.Html5, options); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertToHtml5 + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToHtml5Handout.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToHtml5Handout.java new file mode 100644 index 00000000..f17dfd12 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToHtml5Handout.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.presentations.conversion; + + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +/* +This example shows how to export a presentation in the Handout layout to HTML5 document. +*/ +public class ConvertToHtml5Handout +{ + public static void main(String[] args) + { + // The path to the documents directory + String dataDir = RunExamples.getDataDir_Conversion(); + + // The path to output file + String outFilePath = RunExamples.getOutPath() + "HandoutExample.html"; + + //ExStart:ConvertToHtml5Handout + Presentation pres = new Presentation(dataDir + "HandoutExample.pptx"); + try { + // Set convertion options + HandoutLayoutingOptions handoutLayoutingOptions = new HandoutLayoutingOptions(); + handoutLayoutingOptions.setHandout(HandoutType.Handouts4Horizontal); + + Html5Options options = new Html5Options(); + options.setSlidesLayoutOptions(handoutLayoutingOptions); + + // Save result + pres.save(outFilePath, SaveFormat.Html5, options); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertToHtml5Handout + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToHtml5NotesComments.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToHtml5NotesComments.java new file mode 100644 index 00000000..b9545129 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToHtml5NotesComments.java @@ -0,0 +1,32 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class ConvertToHtml5NotesComments +{ + public static void main(String[] args) + { + // Path to source directory + String dataDir = RunExamples.getDataDir_Conversion(); + String resultPath = RunExamples.getOutPath() + "Html5NotesResult.html"; + + //ExStart:ConvertToHtml5NotesComments + // Instantiate a Presentation object that represents a presentation file + Presentation pres = new Presentation(dataDir + "ConvertWithNote.pptx"); + try { + NotesCommentsLayoutingOptions notesCommentsLayouting = new NotesCommentsLayoutingOptions(); + notesCommentsLayouting.setNotesPosition(NotesPositions.BottomTruncated); + + Html5Options html5Options = new Html5Options(); + html5Options.setOutputPath(RunExamples.getOutPath()); + html5Options.setSlidesLayoutOptions(notesCommentsLayouting); + + // Save a result + pres.save(resultPath, SaveFormat.Html5, html5Options); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertToHtml5NotesComments + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToMarkdown.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToMarkdown.java new file mode 100644 index 00000000..96c1b0a3 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToMarkdown.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.MarkdownExportType; +import com.aspose.slides.MarkdownSaveOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +public class ConvertToMarkdown +{ + public static void main(String[] args) + { + //ExStart:ConvertToMarkdown + // Path to source presentation + String presentationName = RunExamples.getDataDir_Conversion() + "PresentationDemo.pptx"; + + Presentation pres = new Presentation(presentationName); + try { + // Path and folder name for saving markdown data + String outPath = RunExamples.getOutPath(); + + // Create Markdown creation options + MarkdownSaveOptions mdOptions = new MarkdownSaveOptions(); + // Set parameter for render all items (items that are grouped will be rendered together). + mdOptions.setExportType(MarkdownExportType.Visual); + // Set folder name for saving images + mdOptions.setImagesSaveFolderName("md-images"); + // Set path for folder images + mdOptions.setBasePath(outPath); + + // Save presentation in Markdown format + pres.save(outPath + "pres.md", SaveFormat.Md, mdOptions); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertToMarkdown + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToMarkdownOptions.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToMarkdownOptions.java new file mode 100644 index 00000000..ff9f7a67 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToMarkdownOptions.java @@ -0,0 +1,42 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Flavor; +import com.aspose.slides.HandleRepeatedSpaces; +import com.aspose.slides.MarkdownExportType; +import com.aspose.slides.MarkdownSaveOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +/* +This example demonstrates how to save presentation to Markdown format using some convertion options. +*/ +public class ConvertToMarkdownOptions +{ + public static void main(String[] args) + { + // Path to source presentation + String presentationName = RunExamples.getDataDir_Conversion() + "PresentationDemo.pptx"; + + // The path to output file + String outFilePath = RunExamples.getOutPath() + "pres-out.md"; + + //ExStart:ConvertToMarkdownOptions + Presentation pres = new Presentation(presentationName); + try { + MarkdownSaveOptions options = new MarkdownSaveOptions(); + options.setRemoveEmptyLines(true); + options.setHandleRepeatedSpaces(HandleRepeatedSpaces.AlternateSpacesToNbsp); + options.setSlideNumberFormat("## Slide {0} -"); + options.setShowSlideNumber(true); + options.setExportType(MarkdownExportType.TextOnly); + options.setFlavor(Flavor.Default); + + // Save presentation in Markdown format + pres.save(outFilePath, SaveFormat.Md, options); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertToMarkdownOptions + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToPDF.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToPDF.java new file mode 100644 index 00000000..4bb0deba --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToPDF.java @@ -0,0 +1,29 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertToPDF +{ + public static void main(String[] args) + { + //ExStart:ConvertToPDF + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "ConvertToPDF.pptx"); + try + { + // Save the presentation to PDF with default options + presentation.save(dataDir + "output_out.pdf", SaveFormat.Pdf); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ConvertToPDF + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToPDFWithHiddenSlides.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToPDFWithHiddenSlides.java new file mode 100644 index 00000000..8fc62083 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToPDFWithHiddenSlides.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.PdfOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertToPDFWithHiddenSlides +{ + public static void main(String[] args) + { + //ExStart:ConvertToPDFWithHiddenSlides + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + Presentation presentation = new Presentation(dataDir + "HiddingSlides.pptx"); + try + { + // Instantiate the PdfOptions class + PdfOptions pdfOptions = new PdfOptions(); + + // Specify that the generated document should include hidden slides + pdfOptions.setShowHiddenSlides(true); + + // Save the presentation to PDF with specified options + presentation.save(dataDir + "PDFWithHiddenSlides_out.pdf", SaveFormat.Pdf, pdfOptions); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ConvertToPDFWithHiddenSlides + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToPdfCompliance.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToPdfCompliance.java new file mode 100644 index 00000000..bff1d022 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToPdfCompliance.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.PdfCompliance; +import com.aspose.slides.PdfOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +/* +Aspose.Slides supports PDF export to formats 1.6, 1.7 +and operations with A2a, A2b, A2u, A3a and A3b compliance levels: +PdfCompliance.PdfA2a +PdfCompliance.PdfA2b +PdfCompliance.PdfA2u +PdfCompliance.PdfA3a +PdfCompliance.PdfA3b + +This Java code demonstrates an operation where a PDF is saved based on the PdfA2a compliance level +*/ +public class ConvertToPdfCompliance +{ + public static void main(String[] args) + { + //ExStart:ConvertToPdfCompliance + String presentationName = RunExamples.getDataDir_Conversion() + "ConvertToPDF.pptx"; + String outPath = RunExamples.getOutPath() + "ConvertToPDF-Comp.pdf"; + + Presentation presentation = new Presentation(presentationName); + try { + PdfOptions pdfOptions = new PdfOptions(); + pdfOptions.setCompliance(PdfCompliance.PdfA2a); + presentation.save(outPath, SaveFormat.Pdf, pdfOptions); + } finally { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ConvertToPdfCompliance + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToPdfUnsupportedFontStyles.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToPdfUnsupportedFontStyles.java new file mode 100644 index 00000000..b03a1689 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToPdfUnsupportedFontStyles.java @@ -0,0 +1,29 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.PdfOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +public class ConvertToPdfUnsupportedFontStyles +{ + public static void main(String[] args) + { + // The path to output file + String outFilePath = RunExamples.getOutPath() + "UnsupportedFontStyles.pdf"; + + //ExStart:ConvertToPdfUnsupportedFontStyles + // Create a new presentation + Presentation pres = new Presentation(); + try { + PdfOptions pdfOptions = new PdfOptions(); + pdfOptions.setRasterizeUnsupportedFontStyles(true); + + // Save the presentation to PDF + pres.save(outFilePath, SaveFormat.Pdf, pdfOptions); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertToPdfUnsupportedFontStyles + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToXaml.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToXaml.java new file mode 100644 index 00000000..87c8d624 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToXaml.java @@ -0,0 +1,75 @@ +package com.aspose.slides.examples.presentations.conversion;/* + * Copyright (c) 2009-2021 Aspose Pty Ltd. All Rights Reserved. + */ + +import com.aspose.slides.IXamlOutputSaver; +import com.aspose.slides.Presentation; +import com.aspose.slides.XamlOptions; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +public class ConvertToXaml +{ + //ExStart:ConvertToXaml + public static void main(String[] args) + { + // Path to source presentation + String presentationFileName = RunExamples.getDataDir_Conversion() + "XamlEtalon.pptx"; + + Presentation pres = new Presentation(presentationFileName); + try { + // Create convertion options + XamlOptions xamlOptions = new XamlOptions(); + xamlOptions.setExportHiddenSlides(true); + + // Define your own output-saving service + NewXamlSaver newXamlSaver = new NewXamlSaver(); + xamlOptions.setOutputSaver(newXamlSaver); + + // Convert slides + pres.save(xamlOptions); + + // Save XAML files to an output directory + + for (Map.Entry pair : newXamlSaver.getResults().entrySet()) { + FileWriter writer = new FileWriter(RunExamples.getOutPath() + pair.getKey(), true); + writer.append(pair.getValue()); + writer.close(); + } + } catch(IOException e) { + e.printStackTrace(); + } finally { + if (pres != null) pres.dispose(); + } + } + + + /** + * Represents an output saver implementation for transfer data to the external storage. + */ + static class NewXamlSaver implements IXamlOutputSaver + { + private Map m_result = new HashMap(); + + public Map getResults() + { + return m_result; + } + + public void save(String path, byte[] data) + { + String name = new File(path).getName(); + m_result.put(name, new String(data, StandardCharsets.UTF_8)); + } + } + //ExEnd:ConvertToXaml + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToXml.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToXml.java new file mode 100644 index 00000000..3aab8168 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertToXml.java @@ -0,0 +1,24 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +public class ConvertToXml +{ + public static void main(String[] args) { + // The path to output file + String outFilePath = RunExamples.getOutPath() + "Example.xml"; + + //ExStart:ConvertToPdfUnsupportedFontStyles + // Create a new presentation + Presentation pres = new Presentation(); + try { + // Save presentation in XML + pres.save(outFilePath, SaveFormat.Xml); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertToPdfUnsupportedFontStyles + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWholePresentationToHTML.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWholePresentationToHTML.java new file mode 100644 index 00000000..ab80c1aa --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWholePresentationToHTML.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertWholePresentationToHTML +{ + public static void main(String[] args) + { + //ExStart:ConvertWholePresentationToHTML + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "Convert_HTML.pptx"); + try + { + HtmlOptions htmlOpt = new HtmlOptions(); + htmlOpt.setHtmlFormatter(HtmlFormatter.createDocumentFormatter("", false)); + + NotesCommentsLayoutingOptions notesOptions = new NotesCommentsLayoutingOptions(); + notesOptions.setNotesPosition(NotesPositions.BottomFull); + htmlOpt.setSlidesLayoutOptions(notesOptions); + + // Saving the presentation to HTML + presentation.save(dataDir + "ConvertWholePresentationToHTML_out.html", SaveFormat.Html, htmlOpt); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ConvertWholePresentationToHTML + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWholePresentationToHTMLWithMediaFiles.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWholePresentationToHTMLWithMediaFiles.java new file mode 100644 index 00000000..3d6094f5 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWholePresentationToHTMLWithMediaFiles.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertWholePresentationToHTMLWithMediaFiles +{ + public static void main(String[] args) + { + //ExStart:ConvertWholePresentationToHTMLWithMediaFiles + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + String htmlDocumentFileName = "presentationWithVideo.html"; + Presentation pres = new Presentation("presentationWith.pptx"); + try + { + VideoPlayerHtmlController controller = new VideoPlayerHtmlController( + "", htmlDocumentFileName, "http://www.example.com/"); + + HtmlOptions htmlOptions = new HtmlOptions(controller); + SVGOptions svgOptions = new SVGOptions(controller); + + htmlOptions.setHtmlFormatter(HtmlFormatter.createCustomFormatter(controller)); + htmlOptions.setSlideImageFormat(SlideImageFormat.svg(svgOptions)); + + pres.save(htmlDocumentFileName, SaveFormat.Html, htmlOptions); + } + finally + { + if (pres != null) pres.dispose(); + } + } + //ExEnd:ConvertWholePresentationToHTMLWithMediaFiles +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWithCustomSize.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWithCustomSize.java new file mode 100644 index 00000000..9370b2c1 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWithCustomSize.java @@ -0,0 +1,58 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class ConvertWithCustomSize +{ + public static void main(String[] args) + { + //ExStart:ConvertWithCustomSize + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a Presentation file + Presentation pres = new Presentation(dataDir + "Convert_Tiff_Custom.pptx"); + try + { + // Instantiate the TiffOptions class + TiffOptions opts = new TiffOptions(); + + // Setting compression type + opts.setCompressionType(TiffCompressionTypes.Default); + + NotesCommentsLayoutingOptions notesOptions = new NotesCommentsLayoutingOptions(); + notesOptions.setNotesPosition(NotesPositions.BottomFull); + opts.setSlidesLayoutOptions(notesOptions); + // Compression Types + + // Default - Specifies the default compression scheme (LZW). + // None - Specifies no compression. + // CCITT3 + // CCITT4 + // LZW + // RLE + + // Depth depends on the compression type and cannot be set manually. + // Resolution unit is always equal to “2” (dots per inch) + + // Setting image DPI + opts.setDpiX(200); + opts.setDpiY(100); + + // Set Image Size + opts.setImageSize(new Dimension(1728, 1078)); + + // Save the presentation to TIFF with specified image size + pres.save(dataDir + "TiffWithCustomSize_out.tiff", SaveFormat.Tiff, opts); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertWithCustomSize + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWithNoteToTiff.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWithNoteToTiff.java new file mode 100644 index 00000000..70d311fd --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWithNoteToTiff.java @@ -0,0 +1,32 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertWithNoteToTiff +{ + public static void main(String[] args) + { + //ExStart:ConvertWithNoteToTiff + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation pres = new Presentation(dataDir + "ConvertWithNote.pptx"); + try + { + TiffOptions opts = new TiffOptions(); + NotesCommentsLayoutingOptions notesOptions = new NotesCommentsLayoutingOptions(); + notesOptions.setNotesPosition(NotesPositions.BottomFull); + opts.setSlidesLayoutOptions(notesOptions); + // Saving the presentation to TIFF notes + pres.save(dataDir + "TestNotes_out.tiff", SaveFormat.Tiff, opts); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertWithNoteToTiff + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWithXpsOptions.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWithXpsOptions.java new file mode 100644 index 00000000..b7ab18d0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWithXpsOptions.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.XpsOptions; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertWithXpsOptions +{ + public static void main(String[] args) + { + //ExStart:ConvertWithXpsOptions + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation pres = new Presentation(dataDir + "Convert_XPS_Options.pptx"); + try + { + // Instantiate the TiffOptions class + XpsOptions opts = new XpsOptions(); + + // Save MetaFiles as PNG + opts.setSaveMetafilesAsPng(true); + + // Save the presentation to XPS document + pres.save(dataDir + "XPS_With_Options_out.xps", SaveFormat.Xps, opts); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertWithXpsOptions + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWithoutXpsOptions.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWithoutXpsOptions.java new file mode 100644 index 00000000..4e507294 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertWithoutXpsOptions.java @@ -0,0 +1,29 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertWithoutXpsOptions +{ + public static void main(String[] args) + { + //ExStart:ConvertWithoutXpsOptions + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation pres = new Presentation(dataDir + "Convert_XPS.pptx"); + try + { + // Saving the presentation to XPS document + pres.save(dataDir + "XPS_Output_Without_XPSOption_out.xps", SaveFormat.Xps); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertWithoutXpsOptions + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertingPresentationToHTMLWithPreservingOriginalFonts.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertingPresentationToHTMLWithPreservingOriginalFonts.java new file mode 100644 index 00000000..11c8f3ee --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertingPresentationToHTMLWithPreservingOriginalFonts.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertingPresentationToHTMLWithPreservingOriginalFonts +{ + public static void main(String[] args) + { + //ExStart:ConvertingPresentationToHTMLWithPreservingOriginalFonts + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + Presentation pres = new Presentation("input.pptx"); + try + { + // exclude default presentation fonts + String[] fontNameExcludeList = {"Calibri", "Arial"}; + + EmbedAllFontsHtmlController embedFontsController = new EmbedAllFontsHtmlController(fontNameExcludeList); + + HtmlOptions htmlOptionsEmbed = new HtmlOptions(); + htmlOptionsEmbed.setHtmlFormatter(HtmlFormatter.createCustomFormatter(embedFontsController)); + + pres.save("input-PFDinDisplayPro-Regular-installed.html", SaveFormat.Html, htmlOptionsEmbed); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertingPresentationToHTMLWithPreservingOriginalFonts + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertingPresentationToHtmlWithEmbedAllFontsHtmlController.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertingPresentationToHtmlWithEmbedAllFontsHtmlController.java new file mode 100644 index 00000000..431bb8eb --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ConvertingPresentationToHtmlWithEmbedAllFontsHtmlController.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertingPresentationToHtmlWithEmbedAllFontsHtmlController +{ + public static void main(String[] args) + { + String dataDir = RunExamples.getDataDir_Conversion(); + + //ExStart:ConvertingPresentationToHtmlWithEmbedAllFontsHtmlController + Presentation pres = new Presentation(dataDir + "presentation.pptx"); + try + { + // exclude default presentation fonts + String[] fontNameExcludeList = { }; + + LinkAllFontsHtmlController linkcont = new LinkAllFontsHtmlController(fontNameExcludeList, "C:\\Windows\\Fonts\\"); + + HtmlOptions htmlOptionsEmbed = new HtmlOptions(); + htmlOptionsEmbed.setHtmlFormatter(HtmlFormatter.createCustomFormatter(linkcont)); + + pres.save(RunExamples.getOutPath() + "pres.html", SaveFormat.Html, htmlOptionsEmbed); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertingPresentationToHtmlWithEmbedAllFontsHtmlController + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CovertToPDFWithProgressUpdate.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CovertToPDFWithProgressUpdate.java new file mode 100644 index 00000000..6197605d --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CovertToPDFWithProgressUpdate.java @@ -0,0 +1,45 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class CovertToPDFWithProgressUpdate +{ + public static void main(String[] args) + { + + //ExStart:CovertToPDFWithProgressUpdate + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + Presentation presentation = new Presentation(dataDir + "ConvertToPDF.pptx"); + try + { + ISaveOptions saveOptions = new PdfOptions(); + saveOptions.setProgressCallback(new ExportProgressHandler()); + presentation.save(dataDir + "ConvertToPDF.pdf", SaveFormat.Pdf, saveOptions); + } + finally + { + if (presentation != null) presentation.dispose(); + } + + + //ExEnd:CovertToPDFWithProgressUpdate + } +} + +//ExStart:ExportProgressHandler +class ExportProgressHandler implements IProgressCallback +{ + public void reporting(double progressValue) + { + // Use progress percentage value here + long progress = Math.round(progressValue); + System.out.println(progress + "% file converted"); + } +} + +//ExEnd:ExportProgressHandler + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CreateNewPresentation.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CreateNewPresentation.java new file mode 100644 index 00000000..239cfaa9 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CreateNewPresentation.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.ShapeType; +import com.aspose.slides.examples.RunExamples; + + +public class CreateNewPresentation +{ + public static void main(String[] args) + { + //ExStart:CreateNewPresentation + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(); + try + { + // Get the first slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Add an autoshape of type line + slide.getShapes().addAutoShape(ShapeType.Line, 50, 150, 300, 0); + presentation.save(dataDir + "NewPresentation_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:CreateNewPresentation + } +} + + + \ No newline at end of file diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CustomHeaderAndFontsController.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CustomHeaderAndFontsController.java new file mode 100644 index 00000000..ef0dab68 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CustomHeaderAndFontsController.java @@ -0,0 +1,47 @@ +package com.aspose.slides.examples.presentations.conversion; + + +import com.aspose.slides.EmbedAllFontsHtmlController; +import com.aspose.slides.IHtmlGenerator; +import com.aspose.slides.IPresentation; + +//ExStart:CustomHeaderAndFontsController +public class CustomHeaderAndFontsController extends EmbedAllFontsHtmlController +{ + // Custom header template + private static String Header = "\\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + ""; + + + private String m_cssFileName; + + public CustomHeaderAndFontsController(String cssFileName) + { + m_cssFileName = cssFileName; + } + + @Override + public void writeDocumentStart(IHtmlGenerator generator, IPresentation presentation) + { + generator.addHtml(String.format(Header, m_cssFileName)); + writeAllFonts(generator, presentation); + } + + @Override + public void writeAllFonts(IHtmlGenerator generator, IPresentation presentation) + { + generator.addHtml(""); + super.writeAllFonts(generator, presentation); + } +} +//ExEnd:CustomHeaderAndFontsController + + + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CustomOptionsPDFConversion.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CustomOptionsPDFConversion.java new file mode 100644 index 00000000..591f8a55 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CustomOptionsPDFConversion.java @@ -0,0 +1,47 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class CustomOptionsPDFConversion +{ + public static void main(String[] args) + { + //ExStart:CustomOptionsPDFConversion + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation pres = new Presentation(dataDir + "ConvertToPDF.pptx"); + try + { + // Instantiate the PdfOptions class + PdfOptions pdfOptions = new PdfOptions(); + + // Set Jpeg Quality + pdfOptions.setJpegQuality((byte) 90); + + // Define behavior for metafiles + pdfOptions.setSaveMetafilesAsPng(true); + + // Set Text Compression level + pdfOptions.setTextCompression(PdfTextCompression.Flate); + + // Define the PDF standard + pdfOptions.setCompliance(PdfCompliance.Pdf15); + + NotesCommentsLayoutingOptions options = new NotesCommentsLayoutingOptions(); + options.setNotesPosition(NotesPositions.BottomFull); + pdfOptions.setSlidesLayoutOptions(options); + + // Save the presentation to PDF with specified options + pres.save(dataDir + "Custom_Option_Pdf_Conversion_out.pdf", SaveFormat.Pdf, pdfOptions); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:CustomOptionsPDFConversion + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CustomSvgShapeFormattingController.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CustomSvgShapeFormattingController.java new file mode 100644 index 00000000..1a21f2be --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/CustomSvgShapeFormattingController.java @@ -0,0 +1,30 @@ +package com.aspose.slides.examples.presentations.conversion; + + +import com.aspose.slides.IShape; +import com.aspose.slides.ISvgShape; +import com.aspose.slides.ISvgShapeFormattingController; + +//ExStart:CustomSvgShapeFormattingController +public class CustomSvgShapeFormattingController implements ISvgShapeFormattingController + +{ + private int m_shapeIndex; + + public CustomSvgShapeFormattingController() + { + m_shapeIndex = 0; + } + + public void formatShape(ISvgShape svgShape, IShape shape) + { + svgShape.setId(String.format("shape-{0}", m_shapeIndex++)); + } + +} +//ExEnd:CustomSvgShapeFormattingController + + + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportInkExample.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportInkExample.java new file mode 100644 index 00000000..51904fc6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportInkExample.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.PdfOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +public class ExportInkExample +{ + public static void main(String[] args) + { + // The path to the documents directory + String dataDir = RunExamples.getDataDir_Conversion(); + + // The path to output file + String outFilePath = RunExamples.getOutPath() + "HideInkDemo.pdf"; + + //ExStart:ExportInkExample + Presentation pres = new Presentation(dataDir + "InkOptions.pptx"); + try { + PdfOptions options = new PdfOptions(); + // Hide ink objects + options.getInkOptions().setHideInk(true); + // Save result + pres.save(outFilePath, SaveFormat.Pdf, options); + + // Show Ink objects + options.getInkOptions().setHideInk(false); + // Set using ROP operation for rendering brush + options.getInkOptions().setInterpretMaskOpAsOpacity(false); + // Set path to output file + outFilePath = RunExamples.getOutPath() + "ROPInkDemo.pdf"; + // Save result + pres.save(outFilePath, SaveFormat.Pdf, options); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ExportInkExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportMathParagraphToLatex.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportMathParagraphToLatex.java new file mode 100644 index 00000000..8258e1a3 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportMathParagraphToLatex.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; + +public class ExportMathParagraphToLatex +{ + public static void main(String[] args) + { + //ExStart:ExportMathParagraphToLatex + // Create a new presentation + Presentation pres = new Presentation(); + try { + // Add a math shape. + IAutoShape autoShape = pres.getSlides().get_Item(0).getShapes().addMathShape(0, 0, 500, 50); + + // Get a math paragraph. + IMathParagraph mathParagraph = ((MathPortion)autoShape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); + + // Add a formula. + mathParagraph.add(new MathematicalText("a").setSuperscript("2").join("+") + .join(new MathematicalText("b").setSuperscript("2")).join("=") + .join(new MathematicalText("c").setSuperscript("2"))); + + // Get formula string in Latex format. + String latexString = mathParagraph.toLatex(); + + // Output the resulting Latex string to the console. + System.out.println("Latex representation of a math paragraph: \"" + latexString + "\""); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ExportMathParagraphToLatex + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportMathParagraphToMathML.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportMathParagraphToMathML.java new file mode 100644 index 00000000..509d1865 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportMathParagraphToMathML.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; +import java.io.FileOutputStream; +import java.io.IOException; + +public class ExportMathParagraphToMathML { + + public static void main(String[] args) throws IOException + { + //ExStart:ExportMathParagraphToMathML + // The path to the documents directory. + String outSvgFileName = RunExamples.getOutPath() + "mathml.xml"; + + Presentation pres = new Presentation(); + try + { + IAutoShape autoShape = pres.getSlides().get_Item(0).getShapes().addMathShape(0, 0, 500, 50); + IMathParagraph mathParagraph = ((MathPortion)autoShape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); + + mathParagraph.add(new MathematicalText("a").setSuperscript("2").join("+") + .join(new MathematicalText("b").setSuperscript("2")).join("=") + .join(new MathematicalText("c").setSuperscript("2"))); + + FileOutputStream stream = null; + try { + stream = new FileOutputStream(outSvgFileName); + mathParagraph.writeAsMathMl(stream); + } finally { + if (stream != null) stream.close(); + } + } + finally + { + + } + //ExEnd:ExportMathParagraphToMathML + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportMediaFilestohtml.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportMediaFilestohtml.java new file mode 100644 index 00000000..4cbeaaac --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportMediaFilestohtml.java @@ -0,0 +1,42 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ExportMediaFilestohtml +{ + public static void main(String[] args) + { + //ExStart:ExportMediaFilestohtml + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Loading a presentation + Presentation pres = new Presentation(dataDir + "Media File.pptx"); + try + { + String path = dataDir; + String fileName = "ExportMediaFiles_out.html"; + String baseUri = "http://www.example.com/"; + + VideoPlayerHtmlController controller = new VideoPlayerHtmlController(path, fileName, baseUri); + + // Setting HTML options + HtmlOptions htmlOptions = new HtmlOptions(controller); + SVGOptions svgOptions = new SVGOptions(controller); + + htmlOptions.setHtmlFormatter(HtmlFormatter.createCustomFormatter(controller)); + htmlOptions.setSlideImageFormat(SlideImageFormat.svg(svgOptions)); + + // Saving the file + pres.save(path + fileName, SaveFormat.Html, htmlOptions); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ExportMediaFilestohtml + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportOleExample.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportOleExample.java new file mode 100644 index 00000000..5b16e3b9 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportOleExample.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.PdfOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; + +public class ExportOleExample +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // The path to output file. + String outFilePath = RunExamples.getOutPath() + "PresOleExample.pdf"; + + //ExStart:ExportOleExample + Presentation pres = new Presentation(dataDir + "PresOleExample.pptx"); + try { + PdfOptions options = new PdfOptions(); + // Include OLE data into exported PDF. + options.setIncludeOleData(true); + // Save result + pres.save(outFilePath, SaveFormat.Pdf, options); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ExportOleExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportShapeToSVG.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportShapeToSVG.java new file mode 100644 index 00000000..eeedb0ec --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportShapeToSVG.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; + + +public class ExportShapeToSVG +{ + public static void main(String[] args) throws IOException + { + String outSvgFileName = "SingleShape.svg"; + String dataDir = RunExamples.getDataDir_Conversion(); + + //ExStart:ExportShapeToSVG + Presentation pres = new Presentation(dataDir + "TestExportShapeToSvg.pptx"); + try + { + FileOutputStream stream = new FileOutputStream(new File(dataDir + outSvgFileName)); + try + { + pres.getSlides().get_Item(0).getShapes().get_Item(0).writeAsSvg(stream); + + + } + finally + { + if (stream != null) stream.close(); + } + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ExportShapeToSVG + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportToHTMLWithResponsiveLayout.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportToHTMLWithResponsiveLayout.java new file mode 100644 index 00000000..1516dfd5 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ExportToHTMLWithResponsiveLayout.java @@ -0,0 +1,32 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.HtmlOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ExportToHTMLWithResponsiveLayout +{ + public static void main(String[] args) + { + + //ExStart:ExportToHTMLWithResponsiveLayout + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + Presentation presentation = new Presentation(dataDir + "SomePresentation.pptx"); + try + { + HtmlOptions saveOptions = new HtmlOptions(); + saveOptions.setSvgResponsiveLayout(true); + presentation.save(dataDir + "SomePresentation-out.html", SaveFormat.Html, saveOptions); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ExportToHTMLWithResponsiveLayout + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/FodpFormatConvertion.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/FodpFormatConvertion.java new file mode 100644 index 00000000..14d2b022 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/FodpFormatConvertion.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class FodpFormatConvertion +{ + public static void main(String[] args) + { + String dataDir = RunExamples.getDataDir_Conversion(); + String outFodpPath = RunExamples.getOutPath() + "FodpFormatConvertion.fodp"; + String outPptxPath = RunExamples.getOutPath() + "FodpFormatConvertion.pptx"; + + Presentation presentation = new Presentation(dataDir + "Example.fodp"); + try + { + presentation.save(outPptxPath, SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + + Presentation pres = new Presentation(outPptxPath); + try + { + pres.save(outFodpPath, SaveFormat.Fodp); + } + finally + { + if (pres != null) pres.dispose(); + } + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/GeneratingSVGWithCustomShapeIDS.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/GeneratingSVGWithCustomShapeIDS.java new file mode 100644 index 00000000..d11ceb97 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/GeneratingSVGWithCustomShapeIDS.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SVGOptions; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; + + +public class GeneratingSVGWithCustomShapeIDS +{ + public static void main(String[] args) throws IOException + { + //ExStart:GeneratingSVGWithCustomShapeIDS + String dataDir = RunExamples.getDataDir_Conversion(); + Presentation pres = new Presentation(dataDir + "presentation.pptx"); + try + { + FileOutputStream stream = new FileOutputStream(new File(dataDir + "pptxFileName.svg")); + try + { + SVGOptions svgOptions = new SVGOptions(); + svgOptions.setShapeFormattingController(new CustomSvgShapeFormattingController()); + + pres.getSlides().get_Item(0).writeAsSvg(stream, svgOptions); + } + finally + { + if (stream != null) stream.close(); + } + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:GeneratingSVGWithCustomShapeIDS + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ImportHtmlSlideExample.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ImportHtmlSlideExample.java new file mode 100644 index 00000000..9a8cbe94 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ImportHtmlSlideExample.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.FileInputStream; +import java.io.IOException; + +/* +The following code sample demonstrates how to insert HTML content into the presentation slide collection, starting from the empty space on the slide with index equal to 0. +*/ +public class ImportHtmlSlideExample +{ + public static void main(String[] args) + { + // The path to html document + String htmlFileName = RunExamples.getDataDir_Conversion() + "TestHtml.html"; + + // The path to output file + String outFilePath = RunExamples.getOutPath() + "OutputConvertedHtml.pptx"; + + //ExStart:ImportHtmlSlideExample + Presentation presentation = new Presentation(); + try { + FileInputStream inputStream = new FileInputStream(htmlFileName); + presentation.getSlides().insertFromHtml(0, inputStream, true); + inputStream.close(); + + // Save the presentation + presentation.save(outFilePath, SaveFormat.Pptx); + } catch (IOException e){ + e.printStackTrace(); + } finally { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ImportHtmlSlideExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/LinkAllFontsHtmlController.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/LinkAllFontsHtmlController.java new file mode 100644 index 00000000..378b32e8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/LinkAllFontsHtmlController.java @@ -0,0 +1,57 @@ +package com.aspose.slides.examples.presentations.conversion; + + +import com.aspose.slides.EmbedAllFontsHtmlController; +import com.aspose.slides.IFontData; +import com.aspose.slides.IHtmlGenerator; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + + +//ExStart:LinkAllFontsHtmlController +public class LinkAllFontsHtmlController extends EmbedAllFontsHtmlController +{ + private String m_basePath; + + public LinkAllFontsHtmlController(String[] fontNameExcludeList, String basePath) + { + super(fontNameExcludeList); + + m_basePath = basePath; + } + + @Override + public void writeFont( + IHtmlGenerator generator, + IFontData originalFont, + IFontData substitutedFont, + String fontStyle, + String fontWeight, + byte[] fontData) + { + String fontName = substitutedFont == null ? originalFont.getFontName() : substitutedFont.getFontName(); + String path = String.format("{0}.woff", fontName); // some path sanitaze may be needed + try + { + Files.write(Paths.get(m_basePath + File.separator + path), fontData); + } + catch (IOException e) + { + e.printStackTrace(); + } + + generator.addHtml(""); + } + +} +// ExEnd:LinkAllFontsHtmlController + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ODPToPPTX.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ODPToPPTX.java new file mode 100644 index 00000000..0d1ae56a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/ODPToPPTX.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ODPToPPTX +{ + + public static void main(String[] args) + { + + //ExStart:ODPToPPTX + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + + String srcFileName = dataDir + "AccessOpenDoc.odp"; + String destFileName = dataDir + "AccessOpenDoc.pptx"; + //Instantiate a Presentation object that represents a presentation file + Presentation pres = new Presentation(srcFileName); + try + { + //Saving the PPTX presentation to PPTX format + pres.save(destFileName, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ODPToPPTX + + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PPTtoPPTX.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PPTtoPPTX.java new file mode 100644 index 00000000..8e54151c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PPTtoPPTX.java @@ -0,0 +1,29 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class PPTtoPPTX +{ + public static void main(String[] args) + { + //ExStart:PPTtoPPTX + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a PPTX file + Presentation pres = new Presentation(dataDir + "PPTtoPPTX.ppt"); + try + { + // Saving the PPTX presentation to PPTX format + pres.save(dataDir + "PPTtoPPTX_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:PPTtoPPTX + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/Pdf1A_PdfUa_Conformance.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/Pdf1A_PdfUa_Conformance.java new file mode 100644 index 00000000..d6c7d69c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/Pdf1A_PdfUa_Conformance.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.PdfCompliance; +import com.aspose.slides.PdfOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class Pdf1A_PdfUa_Conformance +{ + public static void main(String[] args) + { + String pptxFile = RunExamples.getDataDir_Conversion() + "tagged-pdf-demo.pptx"; + String outPdf1aFile = RunExamples.getOutPath() + "tagged-pdf-demo_1a.pdf"; + String outPdf1bFile = RunExamples.getOutPath() + "tagged-pdf-demo_1b.pdf"; + String outPdfUaFile = RunExamples.getOutPath() + "tagged-pdf-demo_1ua.pdf"; + + Presentation presentation = new Presentation(pptxFile); + try + { + PdfOptions tmp0 = new PdfOptions(); + tmp0.setCompliance(PdfCompliance.PdfA1a); + presentation.save(outPdf1aFile, SaveFormat.Pdf, tmp0); + PdfOptions tmp1 = new PdfOptions(); + tmp1.setCompliance(PdfCompliance.PdfA1b); + + presentation.save(outPdf1bFile, SaveFormat.Pdf, tmp1); + PdfOptions tmp2 = new PdfOptions(); + tmp2.setCompliance(PdfCompliance.PdfUa); + + presentation.save(outPdfUaFile, SaveFormat.Pdf, tmp2); + } + finally + { + if (presentation != null) presentation.dispose(); + } + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PdfImportExample.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PdfImportExample.java new file mode 100644 index 00000000..0ee22e7a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PdfImportExample.java @@ -0,0 +1,25 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class PdfImportExample { + + public static void main(String[] args) + { + //ExStart:PdfImportExample + String pdfFileName = RunExamples.getDataDir_Conversion() + "welcome-to-powerpoint.pdf"; + String resultPath = RunExamples.getOutPath() + "fromPdfDocument.pptx"; + + Presentation pres = new Presentation(); + try { + pres.getSlides().addFromPdf(pdfFileName); + pres.save(resultPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:PdfImportExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PdfImportTableExample.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PdfImportTableExample.java new file mode 100644 index 00000000..06ea41e2 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PdfImportTableExample.java @@ -0,0 +1,39 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.PdfImportOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.io.FileInputStream; +import java.io.IOException; + +public class PdfImportTableExample +{ + public static void main(String[] args) + { + String pdfFileName = RunExamples.getDataDir_Conversion() + "SimpleTableExample.pdf"; + String resultPath = RunExamples.getOutPath() + "SimpleTableExample.pptx"; + + //ExStart:PdfImportTableExample + //Create presentation + Presentation pres = new Presentation(); + try { + PdfImportOptions pdfImportOptions = new PdfImportOptions(); + pdfImportOptions.setDetectTables(true); + + // Open PDF document + FileInputStream stream = new FileInputStream(pdfFileName); + + // Add Slide to presentation besed on PDF data using automatically detection for importing tables + pres.getSlides().addFromPdf(stream, pdfImportOptions); + + // Save result + pres.save(resultPath, SaveFormat.Pptx); + } catch(IOException e) { + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:PdfImportTableExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PresentationToTIFFWithCustomImagePixelFormat.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PresentationToTIFFWithCustomImagePixelFormat.java new file mode 100644 index 00000000..d0f634c8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PresentationToTIFFWithCustomImagePixelFormat.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class PresentationToTIFFWithCustomImagePixelFormat +{ + public static void main(String[] args) + { + //ExStart:PresentationToTIFFWithCustomImagePixelFormat + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a Presentation file + Presentation presentation = new Presentation(dataDir + "DemoFile.pptx"); + try + { + TiffOptions options = new TiffOptions(); + + options.setPixelFormat(ImagePixelFormat.Format8bppIndexed); + NotesCommentsLayoutingOptions notesOptions = new NotesCommentsLayoutingOptions(); + notesOptions.setNotesPosition(NotesPositions.BottomFull); + options.setSlidesLayoutOptions(notesOptions); + + // Save the presentation to TIFF with specified image size + presentation.save(dataDir + "Tiff_With_Custom_Image_Pixel_Format_out.tiff", SaveFormat.Tiff, options); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:PresentationToTIFFWithCustomImagePixelFormat + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PresentationToTIFFWithDefaultSize.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PresentationToTIFFWithDefaultSize.java new file mode 100644 index 00000000..4ac86abb --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/PresentationToTIFFWithDefaultSize.java @@ -0,0 +1,30 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class PresentationToTIFFWithDefaultSize +{ + public static void main(String[] args) + { + //ExStart:PresentationToTIFFWithDefaultSize + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "DemoFile.pptx"); + try + { + // Saving the presentation to TIFF document + presentation.save(dataDir + "Tiffoutput_out.tiff", SaveFormat.Tiff); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:PresentationToTIFFWithDefaultSize + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/RenderingNotesWhileConvertingToHTML.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/RenderingNotesWhileConvertingToHTML.java new file mode 100644 index 00000000..92dfa151 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/RenderingNotesWhileConvertingToHTML.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class RenderingNotesWhileConvertingToHTML +{ + public static void main(String[] args) + { + //ExStart:RenderingNotesWhileConvertingToHTML + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + + Presentation pres = new Presentation(dataDir + "Presentation.pptx"); + try + { + HtmlOptions opt = new HtmlOptions(); + + NotesCommentsLayoutingOptions options = new NotesCommentsLayoutingOptions(); + options.setNotesPosition(NotesPositions.BottomFull); + opt.setSlidesLayoutOptions(options); + + // Saving notes pages + pres.save(dataDir + "Output.html", SaveFormat.Html, opt); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:RenderingNotesWhileConvertingToHTML + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/SavingHTMLAndCSSFileWhenExportingIntoHTML.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/SavingHTMLAndCSSFileWhenExportingIntoHTML.java new file mode 100644 index 00000000..dc3bbe1a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/SavingHTMLAndCSSFileWhenExportingIntoHTML.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.HtmlFormatter; +import com.aspose.slides.HtmlOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SavingHTMLAndCSSFileWhenExportingIntoHTML +{ + public static void main(String[] args) + { + //ExStart:SavingHTMLAndCSSFileWhenExportingIntoHTML + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Conversion(); + Presentation pres = new Presentation("pres.pptx"); + try + { + CustomHeaderAndFontsController htmlController = new CustomHeaderAndFontsController("styles.css"); + HtmlOptions options = new HtmlOptions(); + options.setHtmlFormatter(HtmlFormatter.createCustomFormatter(htmlController)); + + pres.save("pres.html", SaveFormat.Html, options); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SavingHTMLAndCSSFileWhenExportingIntoHTML + } + +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/SvgConversionOptions.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/SvgConversionOptions.java new file mode 100644 index 00000000..f91667a0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/SvgConversionOptions.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2009-2022. Aspose Pty Ltd. All Rights Reserved. + */ + +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.FileOutputStream; +import java.io.IOException; + +public class SvgConversionOptions +{ + + public static void main(String[] args) + { + String presentationName = RunExamples.getDataDir_Conversion() + "SvgShapesConversion.pptx"; + String outPath = RunExamples.getOutPath() + "SvgShapesConversion.svg"; + + //ExStart:SvgConversionOptions + Presentation presentation = new Presentation(presentationName); + try { + // Create new SVG option + SVGOptions svgOptions = new SVGOptions(); + + // Set UseFrameSize property to include frame in a rendering area. + svgOptions.setUseFrameSize(true); + + // Set UseFrameRotation property to exclude rotation of the shape when rendering. + svgOptions.setUseFrameRotation(false); + + // Save a shape to svg using SvgOptions + FileOutputStream stream = new FileOutputStream(outPath); + try { + presentation.getSlides().get_Item(0).getShapes().get_Item(0).writeAsSvg(stream, svgOptions); + } finally { + if (stream != null) stream.close(); + } + } catch(IOException e) { + } finally { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SvgConversionOptions + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/SvgFormattingController.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/SvgFormattingController.java new file mode 100644 index 00000000..caf576d1 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/conversion/SvgFormattingController.java @@ -0,0 +1,67 @@ +package com.aspose.slides.examples.presentations.conversion; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.FileOutputStream; + +public class SvgFormattingController { + + // Code below shows how to use ISvgShapeAndTextFormattingController interface for + // tspan Id attribute manipulation. + + //ExStart:SvgFormattingController + public static void main(String[] args) throws Exception + { + String dataDir = RunExamples.getDataDir_Conversion(); + String pptxFileName = dataDir + "Convert_Svg_Custom.pptx"; + String outSvgFileName = RunExamples.getOutPath() + "Convert_Svg_Custom.svg"; + + Presentation pres = new Presentation(pptxFileName); + try { + SVGOptions svgOptions = new SVGOptions(); + svgOptions.setShapeFormattingController(new CustomSvgShapeFormattingController(0)); + + FileOutputStream fs = new FileOutputStream(outSvgFileName); + try { + pres.getSlides().get_Item(0).writeAsSvg(fs, svgOptions); + } finally { + if (fs != null) fs.close(); + } + } finally { + if (pres != null) pres.dispose(); + } + } + + static class CustomSvgShapeFormattingController implements ISvgShapeAndTextFormattingController + { + private int m_shapeIndex, m_portionIndex, m_tspanIndex; + + public CustomSvgShapeFormattingController(int shapeStartIndex) + { + m_shapeIndex = shapeStartIndex; + m_portionIndex = 0; + } + public void formatShape(ISvgShape svgShape, IShape shape) + { + svgShape.setId(String.format("shape-%d", m_shapeIndex++)); + m_portionIndex = m_tspanIndex = 0; + } + public void formatText(ISvgTSpan svgTSpan, IPortion portion, ITextFrame textFrame) + { + int paragraphIndex = 0; int portionIndex = 0; + for (int i = 0; i < textFrame.getParagraphs().getCount(); i++) + { + portionIndex = textFrame.getParagraphs().get_Item(i).getPortions().indexOf(portion); + if (portionIndex > -1) { paragraphIndex = i; break; } + } + if (m_portionIndex != portionIndex) + { + m_tspanIndex = 0; + m_portionIndex = portionIndex; + } + svgTSpan.setId(String.format("paragraph-%d_portion-%d_%d", paragraphIndex, m_portionIndex, m_tspanIndex++)); + } + } + //ExEnd:SvgFormattingController +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/lowcode/ForEachPortion.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/lowcode/ForEachPortion.java new file mode 100644 index 00000000..3f10abac --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/lowcode/ForEachPortion.java @@ -0,0 +1,27 @@ +package com.aspose.slides.examples.presentations.lowcode; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class ForEachPortion +{ + public static void main(String[] args) + { + String pptxFileName = RunExamples.getDataDir_Slides_Presentations_LowCode() + "ForEachPortion.pptx"; + + //ExStart:ForEachPortion + Presentation pres = new Presentation(pptxFileName); + try { + ForEach.portion(pres, true, new ForEach.ForEachPortionCallback() { + @Override + public void invoke(Portion portion, Paragraph para, BaseSlide slide, int index) { + if (slide instanceof NotesSlide && (portion.getText() != null && !"".equals(portion.getText()))) + System.out.println(portion.getText() + ", index: " + index); + } + }); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ForEachPortion + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/lowcode/RemoveUnusedLayoutMaster.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/lowcode/RemoveUnusedLayoutMaster.java new file mode 100644 index 00000000..b292c66a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/lowcode/RemoveUnusedLayoutMaster.java @@ -0,0 +1,34 @@ + +package com.aspose.slides.examples.presentations.lowcode; + +import com.aspose.slides.Presentation; +import com.aspose.slides.Compress; +import com.aspose.slides.examples.RunExamples; + +public class RemoveUnusedLayoutMaster +{ + + public static void main(String[] args) + { + //ExStart:RemoveUnusedLayoutMaster + + String pptxFileName = RunExamples.getDataDir_Slides_Presentations_LowCode() + "MultipleMaster.pptx"; + + Presentation pres = new Presentation(pptxFileName); + try { + System.out.println("Master slides number in source presentation = " + pres.getMasters().size()); + System.out.println("Layout slides number in source presentation = " + pres.getLayoutSlides().size()); + + Compress.removeUnusedMasterSlides(pres); + Compress.removeUnusedLayoutSlides(pres); + + System.out.println("Master slides number in result presentation = " + pres.getMasters().size()); + System.out.println("Layout slides number in result presentation = " + pres.getLayoutSlides().size()); + } finally { + if (pres != null) pres.dispose(); + } + + //ExEnd:RemoveUnusedLayoutMaster + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/DeleteEmbeddedBinaryObjects.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/DeleteEmbeddedBinaryObjects.java new file mode 100644 index 00000000..6cec9c14 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/DeleteEmbeddedBinaryObjects.java @@ -0,0 +1,69 @@ +package com.aspose.slides.examples.presentations.opening; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; + +public class DeleteEmbeddedBinaryObjects +{ + public static void main(String[] args) + { + String pptxFileName = RunExamples.getDataDir_PresentationOpening() + "OlePptx.pptx"; + String outPath = RunExamples.getOutPath() + "OlePptx-out.pptx"; + //ExStart:ExportOleExample + // Create loading options. + LoadOptions loadOption = new LoadOptions(); + loadOption.setDeleteEmbeddedBinaryObjects(true); + + // Numbers of frames in a presentation. + int emptyOleFrames; + // Number of empty frames in a presentation. + int oleFramesCount; + + Presentation pres = new Presentation(pptxFileName, loadOption); + try { + oleFramesCount = GetOleObjectFrameCount(pres.getSlides()); + System.out.println("Number of OLE frames in source presentation = " + oleFramesCount); + + pres.save(outPath, SaveFormat.Pptx); + Presentation outPres = new Presentation(outPath); + try { + oleFramesCount = GetOleObjectFrameCount(outPres.getSlides()); + System.out.println("Number of OLE frames in resulting presentation = " + oleFramesCount); + } finally { + if (outPres != null) outPres.dispose(); + } + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ExportOleExample + } + + private static int GetOleObjectFrameCount(ISlideCollection slides) + { + int oleFramesCount = 0; + int emptyOleFrames = 0; + + for (ISlide sld : slides) + { + for (IShape shape : sld.getShapes()) + { + if (shape instanceof OleObjectFrame) + { + OleObjectFrame objectFrame = (OleObjectFrame) shape; + + oleFramesCount++; + + byte[] embeddedData = objectFrame.getEmbeddedData().getEmbeddedFileData(); + if (embeddedData == null || embeddedData.length == 0) + emptyOleFrames++; + } + } + } + + System.out.println("Number of empty OLE frames in source presentation = " + emptyOleFrames); + + return oleFramesCount; + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/GetFileFormat.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/GetFileFormat.java new file mode 100644 index 00000000..fc8fe703 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/GetFileFormat.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.presentations.opening; + +import com.aspose.slides.IPresentationInfo; +import com.aspose.slides.LoadFormat; +import com.aspose.slides.PresentationFactory; +import com.aspose.slides.examples.RunExamples; + + +public class GetFileFormat +{ + public static void main(String[] args) + { + //ExStart:GetFileFormat + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationOpening(); + IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo(dataDir + "HelloWorld.pptx"); + switch (info.getLoadFormat()) + { + case LoadFormat.Pptx: + { + break; + } + + case LoadFormat.Unknown: + { + break; + } + } + //ExEnd:GetFileFormat + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/GetPositionCoordinatesofPortion.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/GetPositionCoordinatesofPortion.java new file mode 100644 index 00000000..12ba516a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/GetPositionCoordinatesofPortion.java @@ -0,0 +1,39 @@ +package com.aspose.slides.examples.presentations.opening; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.geom.Point2D; + + +public class GetPositionCoordinatesofPortion +{ + public static void main(String[] args) + { + //ExStart:GetPositionCoordinatesofPortion + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationOpening(); + Presentation presentation = new Presentation(dataDir + "Shapes.pptx"); + try + { + IAutoShape shape = (IAutoShape) presentation.getSlides().get_Item(0).getShapes().get_Item(0); + ITextFrame textFrame = shape.getTextFrame(); + + for (IParagraph paragraph : textFrame.getParagraphs()) + { + for (IPortion portion : paragraph.getPortions()) + { + Point2D.Float point = portion.getCoordinates(); + System.out.println("Corrdinates X =" + point.getX() + " Corrdinates Y =" + point.getY()); + } + } + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:GetPositionCoordinatesofPortion + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/GetRectangularCoordinatesofParagraph.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/GetRectangularCoordinatesofParagraph.java new file mode 100644 index 00000000..62133c46 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/GetRectangularCoordinatesofParagraph.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.presentations.opening; + +import com.aspose.slides.IAutoShape; +import com.aspose.slides.ITextFrame; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.awt.geom.Rectangle2D; + + +public class GetRectangularCoordinatesofParagraph +{ + public static void main(String[] args) + { + //ExStart:GetRectangularCoordinatesofParagraph + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationOpening(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "Shapes.pptx"); + try + { + IAutoShape shape = (IAutoShape) presentation.getSlides().get_Item(0).getShapes().get_Item(0); + ITextFrame textFrame = shape.getTextFrame(); + Rectangle2D.Float rect = (textFrame.getParagraphs().get_Item(0)).getRect(); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:GetRectangularCoordinatesofParagraph + } +} + + + \ No newline at end of file diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/LoadFormatEnumeration.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/LoadFormatEnumeration.java new file mode 100644 index 00000000..c2fe964f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/LoadFormatEnumeration.java @@ -0,0 +1,22 @@ +package com.aspose.slides.examples.presentations.opening; + +import com.aspose.slides.LoadFormat; +import com.aspose.slides.PresentationFactory; +import com.aspose.slides.examples.RunExamples; + + +public class LoadFormatEnumeration +{ + public static void main(String[] args) + { + //ExStart:LoadFormatEnumeration + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationOpening(); + boolean isOldFormat = PresentationFactory.getInstance().getPresentationInfo(dataDir + "presentation.ppt").getLoadFormat() == LoadFormat.Ppt95; + + + } + //ExEnd:LoadFormatEnumeration +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/OpenPasswordPresentation.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/OpenPasswordPresentation.java new file mode 100644 index 00000000..0a7e06b6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/OpenPasswordPresentation.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.presentations.opening; + +import com.aspose.slides.LoadOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class OpenPasswordPresentation +{ + public static void main(String[] args) + { + //ExStart:OpenPasswordPresentation + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationOpening(); + + // creating instance of load options to set the presentation access password + LoadOptions loadOptions = new LoadOptions(); + + // Setting the access password + loadOptions.setPassword("pass"); + + // Opening the presentation file by passing the file path and load options to the constructor of Presentation class + + Presentation pres = new Presentation(dataDir + "OpenPasswordPresentation.pptx", loadOptions); + try + { + // Printing the total number of slides present in the presentation + System.out.println(pres.getSlides().size()); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:OpenPasswordPresentation + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/OpenPresentation.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/OpenPresentation.java new file mode 100644 index 00000000..e735ebd8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/OpenPresentation.java @@ -0,0 +1,28 @@ +package com.aspose.slides.examples.presentations.opening; + +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class OpenPresentation +{ + public static void main(String[] args) + { + //ExStart:OpenPresentation + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationOpening(); + + // Opening the presentation file by passing the file path to the constructor of Presentation class + Presentation pres = new Presentation(dataDir + "OpenPresentation.pptx"); + try + { + // Printing the total number of slides present in the presentation + System.out.println(pres.getSlides().size()); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:OpenPresentation + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/SetAccessPermissionsToPDF.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/SetAccessPermissionsToPDF.java new file mode 100644 index 00000000..6e240721 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/SetAccessPermissionsToPDF.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.presentations.opening; + +import com.aspose.slides.PdfAccessPermissions; +import com.aspose.slides.PdfOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SetAccessPermissionsToPDF +{ + + public static void main(String[] args) + { + + //ExStart:SetAccessPermissionsToPDF + + String dataDir = RunExamples.getDataDir_PresentationOpening(); + + PdfOptions pdfOptions = new PdfOptions(); + pdfOptions.setPassword("my_password"); + pdfOptions.setAccessPermissions(PdfAccessPermissions.PrintDocument | PdfAccessPermissions.HighQualityPrint); + + Presentation presentation = new Presentation(); + try + { + presentation.save(dataDir + "PDFWithPermissions.pdf", SaveFormat.Pdf, pdfOptions); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SetAccessPermissionsToPDF + + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/VerifyingPresentationWithoutloading.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/VerifyingPresentationWithoutloading.java new file mode 100644 index 00000000..273a9b2e --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/opening/VerifyingPresentationWithoutloading.java @@ -0,0 +1,20 @@ +package com.aspose.slides.examples.presentations.opening; + +import com.aspose.slides.PresentationFactory; +import com.aspose.slides.examples.RunExamples; + + +public class VerifyingPresentationWithoutloading +{ + public static void main(String[] args) + { + //ExStart:VerifyingPresentationWithoutloading + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationOpening(); + + int format = PresentationFactory.getInstance().getPresentationInfo(dataDir + "HelloWorld.pptx").getLoadFormat(); + // It will return "LoadFormat.Unknown" if the file is other than presentation formats + //ExEnd:VerifyingPresentationWithoutloading + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/AccessLayoutFormats.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/AccessLayoutFormats.java new file mode 100644 index 00000000..4e44fd1a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/AccessLayoutFormats.java @@ -0,0 +1,51 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AccessLayoutFormats +{ + public static void main(String[] args) + { + //ExStart:AccessLayoutFormats + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationProperties(); + + Presentation pres = new Presentation(dataDir + "pres.pptx"); + try + { + for (ILayoutSlide layoutSlide : pres.getLayoutSlides()) + { + IFillFormat[] fillFormats = new IFillFormat[layoutSlide.getShapes().size()]; + int i = 0; + for (IShape shape : layoutSlide.getShapes()) + { + + fillFormats[i] = shape.getFillFormat(); + + i++; + } + + ILineFormat[] lineFormats = new ILineFormat[layoutSlide.getShapes().size()]; + int j = 0; + for (IShape shape : layoutSlide.getShapes()) + { + + lineFormats[j] = shape.getLineFormat(); + + j++; + } + } + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AccessLayoutFormats + + } + +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/AccessModifyingProperties.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/AccessModifyingProperties.java new file mode 100644 index 00000000..341a2534 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/AccessModifyingProperties.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.IDocumentProperties; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class AccessModifyingProperties +{ + public static void main(String[] args) + { + //ExStart:AccessModifyingProperties + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationProperties(); + + // Instanciate the Presentation class that represents the PPTX + Presentation presentation = new Presentation(dataDir + "AccessModifyingProperties.pptx"); + + // Create a reference to DocumentProperties object associated with Prsentation + IDocumentProperties documentProperties = presentation.getDocumentProperties(); + + // Access and modify custom properties + for (int i = 0; i < documentProperties.getCountOfCustomProperties(); i++) + { + // Display names and values of custom properties + System.out.println("Custom Property Name : " + documentProperties.getCustomPropertyName(i)); + System.out.println("Custom Property Value : " + documentProperties.get_Item(documentProperties.getCustomPropertyName(i))); + + // Modify values of custom properties + documentProperties.set_Item(documentProperties.getCustomPropertyName(i), "New Value " + (i + 1)); + } + + // Save your presentation to a file + presentation.save(dataDir + "CustomDemoModified_out.pptx", SaveFormat.Pptx); + //ExEnd:AccessModifyingProperties + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/AccessOpenDoc.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/AccessOpenDoc.java new file mode 100644 index 00000000..631201b2 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/AccessOpenDoc.java @@ -0,0 +1,23 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class AccessOpenDoc +{ + public static void main(String[] args) + { + //ExStart:AccessOpenDoc + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationProperties(); + + // Open the ODP file + Presentation pres = new Presentation(dataDir + "AccessOpenDoc.odp"); + + // Saving the ODP presentation to PPTX format + pres.save(dataDir + "AccessOpenDoc_out.pptx", SaveFormat.Pptx); + //ExEnd:AccessOpenDoc + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/AddCustomDocumentProperties.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/AddCustomDocumentProperties.java new file mode 100644 index 00000000..83aaeeb2 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/AddCustomDocumentProperties.java @@ -0,0 +1,39 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.IDocumentProperties; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class AddCustomDocumentProperties +{ + public static void main(String[] args) + { + //ExStart:AddCustomDocumentProperties + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationProperties(); + + // Instantiate the Presentation class + Presentation presentation = new Presentation(); + + // Getting Document Properties + IDocumentProperties documentProperties = presentation.getDocumentProperties(); + + // Adding Custom properties + documentProperties.set_Item("New Custom", 12); + documentProperties.set_Item("My Name", "Mudassir"); + documentProperties.set_Item("Custom", 124); + + // Getting property name at particular index + String getPropertyName = documentProperties.getCustomPropertyName(2); + + // Removing selected property + documentProperties.removeCustomProperty(getPropertyName); + + // Saving presentation + presentation.save(dataDir + "CustomDocumentProperties_out.pptx", SaveFormat.Pptx); + //ExEnd:AddCustomDocumentProperties + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/CheckPasswordExample.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/CheckPasswordExample.java new file mode 100644 index 00000000..6d2a6774 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/CheckPasswordExample.java @@ -0,0 +1,29 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.IPresentationInfo; +import com.aspose.slides.PresentationFactory; +import com.aspose.slides.examples.RunExamples; + +public class CheckPasswordExample +{ + // The example below demonstrates how to check a password to open a presentation + + public static void main(String[] args) + { + //ExStart:CheckPasswordExample + + //Path for source presentation + String pptFile = RunExamples.getDataDir_PresentationProperties() + "open_pass1.ppt"; + + // Check the Password via IPresentationInfo Interface + IPresentationInfo presentationInfo = PresentationFactory.getInstance().getPresentationInfo(pptFile); + boolean isPasswordCorrect = presentationInfo.checkPassword("my_password"); + System.out.println("The password \"my_password\" for the presentation is " + isPasswordCorrect); + + isPasswordCorrect = presentationInfo.checkPassword("pass1"); + System.out.println("The password \"pass1\" for the presentation is " + isPasswordCorrect); + + //ExEnd:CheckPasswordExample + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/CheckPresentationProtection.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/CheckPresentationProtection.java new file mode 100644 index 00000000..40f72497 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/CheckPresentationProtection.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.IPresentationInfo; +import com.aspose.slides.NullableBool; +import com.aspose.slides.Presentation; +import com.aspose.slides.PresentationFactory; +import com.aspose.slides.examples.RunExamples; + +public class CheckPresentationProtection +{ + public static void main(String[] args) + { + //Path for source presentation + String pptxFile = RunExamples.getDataDir_PresentationProperties() + "modify_pass2.pptx"; + String pptFile = RunExamples.getDataDir_PresentationProperties() + "open_pass1.ppt"; + + // Check the Write Protection Password via IPresentationInfo Interface + IPresentationInfo presentationInfo = PresentationFactory.getInstance().getPresentationInfo(pptxFile); + boolean isWriteProtectedByPassword = presentationInfo.isWriteProtected() == NullableBool.True && presentationInfo.checkWriteProtection("pass2"); + System.out.println("Is presentation write protected by password = " + isWriteProtectedByPassword); + + // Check the Write Protection Password via IProtectionManager Interface + Presentation presentation = new Presentation(); + try + { + boolean isWriteProtected = presentation.getProtectionManager().checkWriteProtection("pass2"); + System.out.println("Is presentation write protected = " + isWriteProtected); + } + finally + { + if (presentation != null) presentation.dispose(); + } + + // Check Presentation Open Protection via IPresentationInfo Interface + presentationInfo = PresentationFactory.getInstance().getPresentationInfo(pptFile); + if (presentationInfo.isPasswordProtected()) + { + System.out.println("The presentation '" + pptxFile + "' is protected by password to open."); + } + } +} \ No newline at end of file diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/ExtendedPresentationProperties.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/ExtendedPresentationProperties.java new file mode 100644 index 00000000..d00c4e66 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/ExtendedPresentationProperties.java @@ -0,0 +1,70 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.FileOutputStream; +import java.io.IOException; + +public class ExtendedPresentationProperties +{ + public static void main(String[] args) + { + //Path for source presentation + String pptxFile = RunExamples.getDataDir_PresentationProperties() + "ExtendDocumentProperies.pptx"; + //Out path + String resultPath = RunExamples.getOutPath() + "ExtendDocumentProperies-out1.pptx"; + + //ExStart:ExtendedPresentationProperties + Presentation presentation = new Presentation(pptxFile); + try { + IDocumentProperties documentProperties = presentation.getDocumentProperties(); + // Print the read-only properties + System.out.println("Slides: " + documentProperties.getSlides()); + System.out.println("HiddenSlides: " + documentProperties.getHiddenSlides()); + System.out.println("Notes: " + documentProperties.getNotes()); + System.out.println("Paragraphs: " + documentProperties.getParagraphs()); + System.out.println("MultimediaClips: " + documentProperties.getMultimediaClips()); + System.out.println("TitlesOfParts: " + documentProperties.getTitlesOfParts()); + System.out.println("HeadingPairs: "); + IHeadingPair[] headingPairs = documentProperties.getHeadingPairs(); + if (headingPairs.length > 0) + { + for (IHeadingPair headingPair : headingPairs) + System.out.println(headingPair.getName() + " " + headingPair.getCount()); + } + // Change several boolean properties + documentProperties.setScaleCrop(true); + documentProperties.setLinksUpToDate(true); + // Save the presentation with changed properties + presentation.save(resultPath, SaveFormat.Pptx); + + //Use the IPresentationInfo interface to read and change the document properties + System.out.println("\nProperties obtained by IPresentationInfo:\n"); + IPresentationInfo documentInfo = PresentationFactory.getInstance().getPresentationInfo(resultPath); + documentProperties = documentInfo.readDocumentProperties(); + // Print the read-only properties + System.out.println("Slides: " + documentProperties.getSlides()); + System.out.println("HiddenSlides: " + documentProperties.getHiddenSlides()); + System.out.println("Notes: " + documentProperties.getNotes()); + System.out.println("Paragraphs: " + documentProperties.getParagraphs()); + System.out.println("MultimediaClips: " + documentProperties.getMultimediaClips()); + System.out.println("TitlesOfParts: " + documentProperties.getTitlesOfParts()); + System.out.println("HeadingPairs: "); + headingPairs = documentProperties.getHeadingPairs(); + if (headingPairs.length > 0) + { + for (IHeadingPair headingPair : headingPairs) + System.out.println(headingPair.getName() + " " + headingPair.getCount()); + } + // Change several boolean properties + documentProperties.setHyperlinksChanged(true); + // Save the presentation with changed properties + documentInfo.updateDocumentProperties(documentProperties); + documentInfo.writeBindedPresentation(resultPath); + } finally { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ExtendedPresentationProperties + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/GridProperties.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/GridProperties.java new file mode 100644 index 00000000..af72bcea --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/GridProperties.java @@ -0,0 +1,29 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +/* +The following example shows how to set the grid spacing to 72 points (1 inch) and save the PowerPoint presentation. +*/ + +public class GridProperties +{ + public static void main(String[] args) + { + String outFilePath = RunExamples.getOutPath() + "GridProperties-out.pptx"; + + //ExStart:GridProperties + Presentation pres = new Presentation(); + try { + // Set grid spacing + pres.getViewProperties().setGridSpacing(72f); + // Save presentation + pres.save(outFilePath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:GridProperties + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/GuidesProperties.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/GuidesProperties.java new file mode 100644 index 00000000..a5826299 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/GuidesProperties.java @@ -0,0 +1,39 @@ +package com.aspose.slides.examples.presentations.properties; + +/* +This example demonstrates how to add the new vertical and horizontal drawing guides to a PowerPoint presentation. +*/ + +import com.aspose.slides.IDrawingGuidesCollection; +import com.aspose.slides.Orientation; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.awt.geom.Dimension2D; + +public class GuidesProperties +{ + public static void main(String[] args) + { + String outFilePath = RunExamples.getOutPath() + "GuidesProperties-out.pptx"; + + //ExStart:GuidesProperties + Presentation pres = new Presentation(); + try { + // Getting slide size + Dimension2D slideSize = pres.getSlideSize().getSize(); + // Getting the collection of the drawing guides + IDrawingGuidesCollection guides = pres.getViewProperties().getSlideViewProperties().getDrawingGuides(); + // Adding the new vertical drawing guide to the right of the slide center + guides.add(Orientation.Vertical, (float)(slideSize.getWidth() / 2) + 12.5f); + // Adding the new horizontal drawing guide below the slide center + guides.add(Orientation.Horizontal, (float)(slideSize.getHeight() / 2) + 12.5f); + // Save presentation + pres.save(outFilePath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:GuidesProperties + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/PresentationSlideShowSetup.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/PresentationSlideShowSetup.java new file mode 100644 index 00000000..bf4bc8f6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/PresentationSlideShowSetup.java @@ -0,0 +1,46 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + +public class PresentationSlideShowSetup +{ + public static void main(String[] args) + { + String outPptxPath = RunExamples.getOutPath() + "PresentationSlideShowSetup.pptx"; + + //ExStart:PresentationSlideShowSetup + Presentation pres = new Presentation(); + try { + // Gets SlideShow settings + SlideShowSettings slideShow = pres.getSlideShowSettings(); + + // Sets "Using Timing" parameter + slideShow.setUseTimings(false); + + // Sets Pen Color + IColorFormat penColor = (ColorFormat)slideShow.getPenColor(); + penColor.setColor(Color.GREEN); + + // Adds slides for + pres.getSlides().addClone(pres.getSlides().get_Item(0)); + pres.getSlides().addClone(pres.getSlides().get_Item(0)); + pres.getSlides().addClone(pres.getSlides().get_Item(0)); + pres.getSlides().addClone(pres.getSlides().get_Item(0)); + + // Sets Show Slide parameter + SlidesRange slidesRange = new SlidesRange(); + slidesRange.setStart(2); + slidesRange.setEnd(5); + slideShow.setSlides(slidesRange); + + // Save presentation + pres.save(outPptxPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:PresentationSlideShowSetup + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/ReadOnlyRecommended.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/ReadOnlyRecommended.java new file mode 100644 index 00000000..39480491 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/ReadOnlyRecommended.java @@ -0,0 +1,26 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ReadOnlyRecommended +{ + public static void main(String[] args) + { + String outPptxPath = RunExamples.getOutPath() + "ReadOnlyRecommended.pptx"; + + Presentation pres = new Presentation(); + try + { + pres.getProtectionManager().setReadOnlyRecommended(true); + pres.save(outPptxPath, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/RootDirectoryClsId.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/RootDirectoryClsId.java new file mode 100644 index 00000000..0793f1a3 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/RootDirectoryClsId.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.presentations.properties;/* + * Copyright (c) 2009-2021 Aspose Pty Ltd. All Rights Reserved. + */ + +import com.aspose.slides.PptOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.util.UUID; + +public class RootDirectoryClsId +{ + public static void main(String[] args) + { + // Output file name + String resultPath = RunExamples.getOutPath() + "pres.ppt"; + + //ExStart:RootDirectoryClsId + Presentation pres = new Presentation(); + try { + PptOptions pptOptions = new PptOptions(); + + // set CLSID to 'Microsoft Powerpoint.Show.8' + pptOptions.setRootDirectoryClsid(UUID.fromString("64818D10-4F9B-11CF-86EA-00AA00B929E8")); + + // Save presentation + pres.save(resultPath, SaveFormat.Ppt, pptOptions); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:RootDirectoryClsId + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/SlideShowMediaControls.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/SlideShowMediaControls.java new file mode 100644 index 00000000..2815ef78 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/SlideShowMediaControls.java @@ -0,0 +1,30 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.PptOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.util.UUID; + +public class SlideShowMediaControls +{ + public static void main(String[] args) + { + // Path to PPTX document + String outFilePath = RunExamples.getOutPath() + "SlideShowMediaControl.pptx"; + + //ExStart:SlideShowMediaControls + Presentation pres = new Presentation(); + try { + // Еnable media control display in slideshow mode. + pres.getSlideShowSettings().setShowMediaControls(true); + + // Save presentation in PPTX format. + pres.save(outFilePath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:SlideShowMediaControls + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/SupportForInterrupt.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/SupportForInterrupt.java new file mode 100644 index 00000000..5831c015 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/SupportForInterrupt.java @@ -0,0 +1,52 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.InterruptionTokenSource; +import com.aspose.slides.LoadOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SupportForInterrupt +{ + + //ExStart:SupportForInterrupt + public static void main(String[] args) throws InterruptedException + { + + final String[] dataDir = {RunExamples.getDataDir_PresentationProperties()}; + + final InterruptionTokenSource tokenSource = new InterruptionTokenSource(); + + Runnable interruption = new Runnable() + { + public void run() + { + LoadOptions options = new LoadOptions(); + options.setInterruptionToken(tokenSource.getToken()); + Presentation presentation = new Presentation(dataDir[0] + "pres.pptx", options); + try + { + presentation.save(dataDir[0] + "pres.ppt", SaveFormat.Ppt); + } + finally + { + if (presentation != null) presentation.dispose(); + } + } + }; + + Thread thread = new Thread(interruption);// run action in a separate thread + thread.start(); + + Thread.sleep(10000); // some work + + tokenSource.interrupt(); + + } + //ExEnd:SupportForInterrupt + +} + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/UpdatePresentationProperties.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/UpdatePresentationProperties.java new file mode 100644 index 00000000..c5239c61 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/UpdatePresentationProperties.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.IDocumentProperties; +import com.aspose.slides.IPresentationInfo; +import com.aspose.slides.PresentationFactory; +import com.aspose.slides.examples.RunExamples; + + +public class UpdatePresentationProperties +{ + public static void main(String[] args) + { + //ExStart:UpdatePresentationProperties + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationProperties(); + + // read the info of presentation + IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo(dataDir + "ModifyBuiltinProperties1.pptx"); + + // obtain the current properties + IDocumentProperties props = info.readDocumentProperties(); + + // set the new values of Author and Title fields + props.setAuthor("New Author"); + props.setTitle("New Title"); + + // update the presentation with a new values + info.updateDocumentProperties(props); + info.writeBindedPresentation(dataDir + "ModifyBuiltinProperties1.pptx"); + //ExEnd:UpdatePresentationProperties + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/UpdatePresentationPropertiesUsingPropertiesOfAnotherPresentationAsATemplate.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/UpdatePresentationPropertiesUsingPropertiesOfAnotherPresentationAsATemplate.java new file mode 100644 index 00000000..9ed36b80 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/properties/UpdatePresentationPropertiesUsingPropertiesOfAnotherPresentationAsATemplate.java @@ -0,0 +1,43 @@ +package com.aspose.slides.examples.presentations.properties; + +import com.aspose.slides.DocumentProperties; +import com.aspose.slides.IDocumentProperties; +import com.aspose.slides.IPresentationInfo; +import com.aspose.slides.PresentationFactory; +import com.aspose.slides.examples.RunExamples; + + +public class UpdatePresentationPropertiesUsingPropertiesOfAnotherPresentationAsATemplate +{ + //ExStart:UpdatePresPropsUsingPropsOfOtherPresAsATemplate + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationProperties(); + + DocumentProperties template; + IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo(dataDir + "template.pptx"); + template = (DocumentProperties) info.readDocumentProperties(); + + template.setAuthor("Template Author"); + template.setTitle("Template Title"); + template.setCategory("Template Category"); + template.setKeywords("Keyword1, Keyword2, Keyword3"); + template.setCompany("Our Company"); + template.setComments("Created from template"); + template.setContentType("Template Content"); + template.setSubject("Template Subject"); + + updateByTemplate(dataDir + "doc1.pptx", template); + updateByTemplate(dataDir + "doc2.odp", template); + updateByTemplate(dataDir + "doc3.ppt", template); + } + + private static void updateByTemplate(String path, IDocumentProperties template) + { + IPresentationInfo toUpdate = PresentationFactory.getInstance().getPresentationInfo(path); + toUpdate.updateDocumentProperties(template); + toUpdate.writeBindedPresentation(path); + } + //ExEnd:UpdatePresPropsUsingPropsOfOtherPresAsATemplate +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/AddBlobImageToPresentation.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/AddBlobImageToPresentation.java new file mode 100644 index 00000000..2689537c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/AddBlobImageToPresentation.java @@ -0,0 +1,56 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.FileInputStream; + + +public class AddBlobImageToPresentation +{ + public static void main(String[] args) + { + + //ExStart:AddBlobImageToPresentation + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationSaving(); + + String pathToLargeImage = dataDir + "large_image.jpg"; + + // create a new presentation which will contain this image + Presentation pres = new Presentation(); + try + { + // supposed we have the large image file we want to include into the presentation + FileInputStream fip = new FileInputStream(dataDir + "large_image.jpg"); + try + { + // let's add the image to the presentation - we choose KeepLocked behavior, because we not + // have an intent to access the "largeImage.png" file. + IPPImage img = pres.getImages().addImage(fip, LoadingStreamBehavior.KeepLocked); + pres.getSlides().get_Item(0).getShapes().addPictureFrame(ShapeType.Rectangle, 0, 0, 300, 200, img); + + // save the presentation. Despite that the output presentation will be + // large, the memory consumption will be low the whole lifetime of the pres object + pres.save(dataDir + "presentationWithLargeImage.pptx", SaveFormat.Pptx); + } + finally + { + fip.close(); + } + } + catch (java.io.IOException e) + { + e.printStackTrace(); + } + finally + { + pres.dispose(); + } + + //ExEnd:AddBlobImageToPresentation + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/AddImageFromSVGObject.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/AddImageFromSVGObject.java new file mode 100644 index 00000000..d9342b25 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/AddImageFromSVGObject.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + + +public class AddImageFromSVGObject +{ + public static void main(String[] args) throws IOException + { + + //ExStart:AddImageFromSVGObject + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationSaving(); + String svgPath = dataDir + "sample.svg"; + String outPptxPath = dataDir + "presentation.pptx"; + Presentation p = new Presentation(); + try + { + String svgContent = new String(Files.readAllBytes(Paths.get(dataDir + "sample.svg"))); + ISvgImage svgImage = new SvgImage(svgContent); + IPPImage ppImage = p.getImages().addImage(svgImage); + p.getSlides().get_Item(0).getShapes().addPictureFrame(ShapeType.Rectangle, 0, 0, ppImage.getWidth(), ppImage.getHeight(), ppImage); + p.save(dataDir + "presentation.pptx", SaveFormat.Pptx); + } + finally + { + p.dispose(); + } + + //ExEnd:AddImageFromSVGObject + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/AddImageFromSVGObjectFromExternalResource.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/AddImageFromSVGObjectFromExternalResource.java new file mode 100644 index 00000000..9da337f4 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/AddImageFromSVGObjectFromExternalResource.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + + +public class AddImageFromSVGObjectFromExternalResource +{ + public static void main(String[] args) throws IOException + { + + //ExStart:AddImageFromSVGObjectFromExternalResource + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationSaving(); + String outPptxPath = dataDir + "presentation_external.pptx"; + + Presentation p = new Presentation(); + try + { + String svgContent = new String(Files.readAllBytes(Paths.get(dataDir + "image1.svg"))); + ISvgImage svgImage = new SvgImage(svgContent, new ExternalResourceResolver(), dataDir); + IPPImage ppImage = p.getImages().addImage(svgImage); + p.getSlides().get_Item(0).getShapes().addPictureFrame(ShapeType.Rectangle, 0, 0, ppImage.getWidth(), ppImage.getHeight(), ppImage); + p.save(outPptxPath, SaveFormat.Pptx); + } + finally + { + if (p != null) p.dispose(); + } + + //ExEnd:AddImageFromSVGObjectFromExternalResource + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/ConvertSvgImageObjectIntoGroupOfShapes.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/ConvertSvgImageObjectIntoGroupOfShapes.java new file mode 100644 index 00000000..ad128732 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/ConvertSvgImageObjectIntoGroupOfShapes.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConvertSvgImageObjectIntoGroupOfShapes +{ + public static void main(String[] args) + { + + //ExStart:ConvertSvgImageObjectIntoGroupOfShapes + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationSaving(); + + Presentation pres = new Presentation(dataDir + "image.pptx"); + try + { + PictureFrame pFrame = (PictureFrame) pres.getSlides().get_Item(0).getShapes().get_Item(0); + ISvgImage svgImage = pFrame.getPictureFormat().getPicture().getImage().getSvgImage(); + if (svgImage != null) + { + // Convert svg image into group of shapes + IGroupShape groupShape = pres.getSlides().get_Item(0).getShapes(). + addGroupShape(svgImage, pFrame.getFrame().getX(), pFrame.getFrame().getY(), + pFrame.getFrame().getWidth(), pFrame.getFrame().getHeight()); + // remove source svg image from presentation + pres.getSlides().get_Item(0).getShapes().remove(pFrame); + } + pres.save(dataDir + "image_group.pptx", SaveFormat.Pptx); + } + finally + { + pres.dispose(); + } + //ExEnd:ConvertSvgImageObjectIntoGroupOfShapes + } + +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/ImageQualityExample.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/ImageQualityExample.java new file mode 100644 index 00000000..562b62e6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/ImageQualityExample.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.IImage; +import com.aspose.slides.ImageFormat; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.ByteArrayOutputStream; + +public class ImageQualityExample +{ + public static void main(String[] args) + { + //Path for source presentation + String pptxFile = RunExamples.getDataDir_PresentationSaving() + "ImageQuality.pptx"; + //Out path + String imagePath = RunExamples.getOutPath() + "ImageQuality-out.jpg"; + + //ExStart:ImageQualityExample + Presentation presentation = new Presentation(pptxFile); + try { + IImage image = presentation.getImages().get_Item(0).getImage(); + + // Saves the first image to the memory stream in JPEG format with quality 80. + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + image.save(baos, ImageFormat.Jpeg, 100); + + // Saves the first image to the file in JPEG format with high quality. + image.save(imagePath, ImageFormat.Jpeg, 100); + } finally { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ImageQualityExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/JavaScriptLinkExample.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/JavaScriptLinkExample.java new file mode 100644 index 00000000..3cb08094 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/JavaScriptLinkExample.java @@ -0,0 +1,28 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.PptxOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +public class JavaScriptLinkExample +{ + public static void main(String[] args) + { + //Path for source presentation + String pptxFile = RunExamples.getDataDir_PresentationSaving() + "JavaScriptLink.pptx"; + //Out path + String resultPath = RunExamples.getOutPath() + "JavaScriptLink-out.pptx"; + + //ExStart:JavaScriptLinkExample + Presentation pres = new Presentation(pptxFile); + try { + PptxOptions pptxOptions = new PptxOptions(); + pptxOptions.setSkipJavaScriptLinks(true); + pres.save(resultPath, SaveFormat.Pptx, pptxOptions); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:JavaScriptLinkExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/RefreshThumbnailPresentation.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/RefreshThumbnailPresentation.java new file mode 100644 index 00000000..eb8aa90a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/RefreshThumbnailPresentation.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.PptxOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.io.FileOutputStream; +import java.io.IOException; + +public class RefreshThumbnailPresentation +{ + public static void main(String[] args) + { + //Path for source presentation + String pptxFile = RunExamples.getDataDir_PresentationSaving() + "Image.pptx"; + //Out path + String resultPath = RunExamples.getOutPath() + "result_with_old_thumbnail.pptx"; + + //ExStart:RefreshThumbnailPresentation + Presentation pres = new Presentation(pptxFile); + try { + PptxOptions pptxOptions = new PptxOptions(); + pptxOptions.setRefreshThumbnail(false); + //Remove all shapes from the slide + pres.getSlides().get_Item(0).getShapes().clear(); + //Save presentation + pres.save(resultPath, SaveFormat.Pptx, pptxOptions); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:RefreshThumbnailPresentation + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/RemoveWriteProtection.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/RemoveWriteProtection.java new file mode 100644 index 00000000..f5cefed7 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/RemoveWriteProtection.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class RemoveWriteProtection +{ + public static void main(String[] args) + { + //ExStart:RemoveWriteProtection + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationSaving(); + + // Opening the presentation file + Presentation presentation = new Presentation(dataDir + "RemoveWriteProtection.pptx"); + try + { + // Checking if presentation is write protected + if (presentation.getProtectionManager().isWriteProtected()) + // Removing Write protection + presentation.getProtectionManager().removeWriteProtection(); + + // Saving presentation + presentation.save(dataDir + "File_Without_WriteProtection_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:RemoveWriteProtection + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveAsPredefinedViewType.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveAsPredefinedViewType.java new file mode 100644 index 00000000..4070ef0f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveAsPredefinedViewType.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.ViewType; +import com.aspose.slides.examples.RunExamples; + + +public class SaveAsPredefinedViewType +{ + public static void main(String[] args) + { + //ExStart:SaveAsPredefinedViewType + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationSaving(); + + // Opening the presentation file + Presentation presentation = new Presentation(); + try + { + // Setting view type + presentation.getViewProperties().setLastView(ViewType.SlideMasterView); + + // Saving presentation + presentation.save(dataDir + "SetViewType_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SaveAsPredefinedViewType + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveAsReadOnly.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveAsReadOnly.java new file mode 100644 index 00000000..fd202344 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveAsReadOnly.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class SaveAsReadOnly +{ + public static void main(String[] args) + { + //ExStart:SaveAsReadOnly + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationSaving(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate a Presentation object that represents a PPT file + Presentation presentation = new Presentation(); + try + { + //....do some work here..... + + // Setting Write protection Password + presentation.getProtectionManager().setWriteProtection("test"); + + // Save your presentation to a file + presentation.save(dataDir + "WriteProtected_out.pptx", SaveFormat.Pptx); + //ExEnd:SaveAsReadOnly + } + finally + { + if (presentation != null) presentation.dispose(); + } + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveInZip64Mode.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveInZip64Mode.java new file mode 100644 index 00000000..ada6b717 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveInZip64Mode.java @@ -0,0 +1,29 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.PptxOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.Zip64Mode; +import com.aspose.slides.examples.RunExamples; + +public class SaveInZip64Mode +{ + public static void main(String[] args) { + // The path to output file + String outFilePath = RunExamples.getOutPath() + "PresentationZip64.pptx"; + + //ExStart:ConvertToPdfUnsupportedFontStyles + // Create a new presentation + Presentation pres = new Presentation(); + try { + PptxOptions pptxOptions = new PptxOptions(); + pptxOptions.setZip64Mode(Zip64Mode.Always); + + // Save the presentation + pres.save(outFilePath, SaveFormat.Pptx, pptxOptions); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ConvertToPdfUnsupportedFontStyles + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveProperties.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveProperties.java new file mode 100644 index 00000000..cfc64dd0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveProperties.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SaveProperties +{ + public static void main(String[] args) + { + //ExStart:SaveProperties + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationSaving(); + + // Instantiate a Presentation object that represents a PPT file + Presentation presentation = new Presentation(); + try + { + //....do some work here..... + + // Setting access to document properties in password protected mode + presentation.getProtectionManager().setEncryptDocumentProperties(false); + + // Setting Password + presentation.getProtectionManager().encrypt("pass"); + + // Save your presentation to a file + presentation.save(dataDir + "Password Protected Presentation_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SaveProperties + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveToFile.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveToFile.java new file mode 100644 index 00000000..9e7a1067 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveToFile.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class SaveToFile +{ + public static void main(String[] args) + { + //ExStart:SaveToFile + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationSaving(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate a Presentation object that represents a PPT file + Presentation presentation = new Presentation(); + try + { + //...do some work here... + + // Save your presentation to a file + presentation.save(dataDir + "Saved_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SaveToFile + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveToStream.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveToStream.java new file mode 100644 index 00000000..cc20cb7a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveToStream.java @@ -0,0 +1,43 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.IAutoShape; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.ShapeType; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; + + +public class SaveToStream +{ + public static void main(String[] args) throws IOException + { + //ExStart:SaveToStream + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationSaving(); + + // Instantiate a Presentation object that represents a PPT file + Presentation presentation = new Presentation(); + try + { + + IAutoShape shape = presentation.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 200, 200, 200, 200); + + // Add text to shape + shape.getTextFrame().setText("This demo shows how to Create PowerPoint file and save it to Stream."); + + FileOutputStream toStream = new FileOutputStream(new File(dataDir + "Save_As_Stream_out.pptx")); + presentation.save(toStream, SaveFormat.Pptx); + toStream.close(); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SaveToStream + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveWithPassword.java b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveWithPassword.java new file mode 100644 index 00000000..28807db8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/presentations/saving/SaveWithPassword.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.presentations.saving; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class SaveWithPassword +{ + public static void main(String[] args) + { + //ExStart:SaveWithPassword + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_PresentationSaving(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate a Presentation object that represents a PPT file + Presentation pres = new Presentation(); + + //....do some work here..... + + // Setting Password + pres.getProtectionManager().encrypt("pass"); + + // Save your presentation to a file + pres.save(dataDir + "SaveWithPassword_out.pptx", SaveFormat.Pptx); + //ExEnd:SaveWithPassword + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/RenderComments.java b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/RenderComments.java new file mode 100644 index 00000000..53e0690a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/RenderComments.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.rendering.printing; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class RenderComments +{ + public static void main(String[] args) + { + //ExStart:RenderComments + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Rendering(); + String resultPath = RunExamples.getOutPath() + "OutPresBitmap.png"; + + Presentation pres = new Presentation(dataDir + "presentation.pptx"); + + IRenderingOptions renderOptions = new RenderingOptions(); + NotesCommentsLayoutingOptions notesOptions = new NotesCommentsLayoutingOptions(); + notesOptions.setCommentsAreaColor(Color.RED); + notesOptions.setCommentsAreaWidth(200); + notesOptions.setCommentsPosition(CommentsPositions.Right); + notesOptions.setNotesPosition(NotesPositions.BottomTruncated); + renderOptions.setSlidesLayoutOptions(notesOptions); + + try + { + pres.getSlides().get_Item(0).getImage(new Dimension(740, 960)).save(resultPath, ImageFormat.Png); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:RenderComments + } +} + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/RenderOptions.java b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/RenderOptions.java new file mode 100644 index 00000000..1e1b070b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/RenderOptions.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.rendering.printing; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class RenderOptions { + + // This example demonstrates one of the possible use cases of IRenderingOptions interface + //(getting slide thumbnails with different default font and slide's notes shown) + public static void main(String[] args) + { + //ExStart:RenderOptions + // The path to the document. + String presPath = RunExamples.getDataDir_Rendering() + "RenderingOptions.pptx"; + + Presentation pres = new Presentation(presPath); + try { + IRenderingOptions renderingOpts = new RenderingOptions(); + NotesCommentsLayoutingOptions notesOptions = new NotesCommentsLayoutingOptions(); + notesOptions.setNotesPosition(NotesPositions.BottomTruncated); + renderingOpts.setSlidesLayoutOptions(notesOptions); + + pres.getSlides().get_Item(0).getImage(renderingOpts, 4 / 3f, 4 / 3f) + .save(RunExamples.getOutPath() + "RenderingOptions-Slide1-Original.png", ImageFormat.Png); + + renderingOpts.setSlidesLayoutOptions(null); + renderingOpts.setDefaultRegularFont("Arial Black"); + pres.getSlides().get_Item(0).getImage(renderingOpts, 4 / 3f, 4 / 3f) + .save(RunExamples.getOutPath() + "RenderingOptions-Slide1-ArialBlackDefault.png", ImageFormat.Png); + + renderingOpts.setDefaultRegularFont("Arial Narrow"); + pres.getSlides().get_Item(0).getImage(renderingOpts, 4 / 3f, 4 / 3f) + .save(RunExamples.getOutPath() + "RenderingOptions-Slide1-ArialNarrowDefault.png", ImageFormat.Png); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:RenderOptions + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/Rendering3D.java b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/Rendering3D.java new file mode 100644 index 00000000..52355b10 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/Rendering3D.java @@ -0,0 +1,43 @@ +package com.aspose.slides.examples.rendering.printing; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + +public class Rendering3D { + + // This example demonstrates creating and rendering presentation with 3D graphics. + + public static void main(String[] args) + { + //ExStart:RenderComments + String outPptxFile = RunExamples.getOutPath() + "sandbox_3d.pptx"; + String outPngFile = RunExamples.getOutPath() + "sample_3d.png"; + + Presentation pres = new Presentation(); + try + { + IAutoShape shape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 200, 150, 200, 200); + shape.getTextFrame().setText("3D"); + shape.getTextFrame().getParagraphs().get_Item(0).getParagraphFormat().getDefaultPortionFormat().setFontHeight(64); + + shape.getThreeDFormat().getCamera().setCameraType(CameraPresetType.OrthographicFront); + shape.getThreeDFormat().getCamera().setRotation(20, 30, 40); + shape.getThreeDFormat().getLightRig().setLightType(LightRigPresetType.Flat); + shape.getThreeDFormat().getLightRig().setDirection(LightingDirection.Top); + shape.getThreeDFormat().setMaterial(MaterialPresetType.Powder); + shape.getThreeDFormat().setExtrusionHeight(100); + shape.getThreeDFormat().getExtrusionColor().setColor(Color.BLUE); + + pres.getSlides().get_Item(0).getImage(2, 2).save(outPngFile, ImageFormat.Png); + pres.save(outPptxFile, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:RenderComments + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/RenderingEmoji.java b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/RenderingEmoji.java new file mode 100644 index 00000000..50a5ead0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/RenderingEmoji.java @@ -0,0 +1,23 @@ +package com.aspose.slides.examples.rendering.printing; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class RenderingEmoji +{ + //ExStart:RenderingEmoji + public static void main(String[] args) + { + + String dataDir = RunExamples.getDataDir_Rendering(); + + Presentation pres = new Presentation(dataDir + "input.pptx"); + + pres.save(dataDir + "emoji.pdf", SaveFormat.Pdf); + } + +} +//ExEnd:RenderingEmoji + diff --git a/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/SetSlideNumber.java b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/SetSlideNumber.java new file mode 100644 index 00000000..94ef6232 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/SetSlideNumber.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.rendering.printing; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SetSlideNumber +{ + public static void main(String[] args) + { + //ExStart:SetSlideNumber + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Rendering(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "HelloWorld.pptx"); + try + { + // Get the slide number + int firstSlideNumber = presentation.getFirstSlideNumber(); + + // Set the slide number + presentation.setFirstSlideNumber(10); + + presentation.save(dataDir + "Set_Slide_Number_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SetSlideNumber + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/SetZoom.java b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/SetZoom.java new file mode 100644 index 00000000..fc93e894 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/SetZoom.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.rendering.printing; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SetZoom +{ + public static void main(String[] args) + { + //ExStart:SetZoom + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Rendering(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(); + try + { + // Setting View Properties of Presentation + + presentation.getViewProperties().getSlideViewProperties().setScale(100); // Zoom value in percentages for slide view + presentation.getViewProperties().getNotesViewProperties().setScale(100); // Zoom value in percentages for notes view + + presentation.save(dataDir + "Zoom_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SetZoom + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/SupportOfDigitalSignature.java b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/SupportOfDigitalSignature.java new file mode 100644 index 00000000..acf1070c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/rendering/printing/SupportOfDigitalSignature.java @@ -0,0 +1,45 @@ +package com.aspose.slides.examples.rendering.printing; + +import com.aspose.slides.DigitalSignature; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SupportOfDigitalSignature +{ + + public static void main(String[] args) + { + + //ExStart:SupportOfDigitalSignature + + String dataDir = RunExamples.getDataDir_Rendering(); + String outPath = RunExamples.getOutPath(); + + Presentation pres = new Presentation(); + try + { + + DigitalSignature signature = new DigitalSignature(dataDir + "testsignature1.pfx", "testpass1"); + + + signature.setComments("Aspose.Slides digital signing test."); + + + pres.getDigitalSignatures().add(signature); + + + pres.save(outPath + "SomePresentationSigned.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:SupportOfDigitalSignature + + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AccessOLEObjectFrame.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AccessOLEObjectFrame.java new file mode 100644 index 00000000..a7d70424 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AccessOLEObjectFrame.java @@ -0,0 +1,60 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.ISlide; +import com.aspose.slides.OleObjectFrame; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; + + +public class AccessOLEObjectFrame +{ + public static void main(String[] args) throws IOException + { + //ExStart:AccessOLEObjectFrame + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Load the PPTX to Presentation object + Presentation pres = new Presentation(dataDir + "AccessingOLEObjectFrame.pptx"); + try + { + // Access the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Cast the shape to OleObjectFrame + OleObjectFrame oleObjectFrame = (OleObjectFrame) sld.getShapes().get_Item(0); + + // Read the OLE Object and write it to disk + if (oleObjectFrame != null) + { + // Get embedded file data + byte[] data = oleObjectFrame.getEmbeddedData().getEmbeddedFileData(); + + // Get embedded file extention + String fileExtention = oleObjectFrame.getEmbeddedData().getEmbeddedFileExtension(); + + // Create path for saving the extracted file + String extractedPath = dataDir + "excelFromOLE_out" + fileExtention; + + // Save extracted data + FileOutputStream fstr = new FileOutputStream(extractedPath); + try { + fstr.write(data, 0, data.length); + } finally { + fstr.close(); + } + } + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:AccessOLEObjectFrame + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AccessingAltTextinGroupshapes.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AccessingAltTextinGroupshapes.java new file mode 100644 index 00000000..40b141eb --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AccessingAltTextinGroupshapes.java @@ -0,0 +1,44 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AccessingAltTextinGroupshapes +{ + public static void main(String[] args) + { + //ExStart:AccessingAltTextinGroupshapes + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Instantiate Presentation class that represents PPTX file + Presentation pres = new Presentation(dataDir + "AltText.pptx"); + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + for (int i = 0; i < sld.getShapes().size(); i++) + { + // Accessing the shape collection of slides + IShape shape = sld.getShapes().get_Item(i); + + if (shape instanceof GroupShape) + { + // Accessing the group shape. + IGroupShape grphShape = (IGroupShape) shape; + for (int j = 0; j < grphShape.getShapes().size(); j++) + { + IShape shape2 = grphShape.getShapes().get_Item(j); + // Accessing the AltText property + System.out.println(shape2.getAlternativeText()); + } + } + } + //ExEnd:AccessingAltTextinGroupshapes + } +} + + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AddArrowShapedLine.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddArrowShapedLine.java new file mode 100644 index 00000000..10ef13fd --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddArrowShapedLine.java @@ -0,0 +1,58 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class AddArrowShapedLine +{ + public static void main(String[] args) + { + //ExStart:AddArrowShapedLine + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate PresentationEx class that represents the PPTX file + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add an autoshape of type line + IAutoShape shp = sld.getShapes().addAutoShape(ShapeType.Line, 50, 150, 300, 0); + + // Apply some formatting on the line + shp.getLineFormat().setStyle(LineStyle.ThickBetweenThin); + shp.getLineFormat().setWidth(10); + + shp.getLineFormat().setDashStyle(LineDashStyle.DashDot); + + shp.getLineFormat().setBeginArrowheadLength(LineArrowheadLength.Short); + shp.getLineFormat().setBeginArrowheadStyle(LineArrowheadStyle.Oval); + + shp.getLineFormat().setBeginArrowheadLength(LineArrowheadLength.Long); + shp.getLineFormat().setEndArrowheadStyle(LineArrowheadStyle.Triangle); + + shp.getLineFormat().getFillFormat().setFillType(FillType.Solid); + shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.Maroon)); + + //Write the PPTX to Disk + pres.save(dataDir + "LineShape2_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AddArrowShapedLine + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AddArrowShapedLineToSlide.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddArrowShapedLineToSlide.java new file mode 100644 index 00000000..ef2854c7 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddArrowShapedLineToSlide.java @@ -0,0 +1,58 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class AddArrowShapedLineToSlide +{ + public static void main(String[] args) + { + //ExStart:AddArrowShapedLineToSlide + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate PresentationEx class that represents the PPTX file + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add an autoshape of type line + IAutoShape shp = sld.getShapes().addAutoShape(ShapeType.Line, 50, 150, 300, 0); + + // Apply some formatting on the line + shp.getLineFormat().setStyle(LineStyle.ThickBetweenThin); + shp.getLineFormat().setWidth(10); + + shp.getLineFormat().setDashStyle(LineDashStyle.DashDot); + + shp.getLineFormat().setBeginArrowheadLength(LineArrowheadLength.Short); + shp.getLineFormat().setBeginArrowheadStyle(LineArrowheadStyle.Oval); + + shp.getLineFormat().setBeginArrowheadLength(LineArrowheadLength.Long); + shp.getLineFormat().setEndArrowheadStyle(LineArrowheadStyle.Triangle); + + shp.getLineFormat().getFillFormat().setFillType(FillType.Solid); + shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.Maroon)); + + //Write the PPTX to Disk + pres.save(dataDir + "LineShape2_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AddArrowShapedLineToSlide + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AddAudioFrame.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddAudioFrame.java new file mode 100644 index 00000000..63093094 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddAudioFrame.java @@ -0,0 +1,57 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; + + +public class AddAudioFrame +{ + public static void main(String[] args) throws FileNotFoundException + { + //ExStart:AddAudioFrame + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Prseetation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Load the wav sound file to stram + FileInputStream fstr = new FileInputStream(dataDir + "sampleaudio.wav"); + + // Add Audio Frame + IAudioFrame audioFrame = sld.getShapes().addAudioFrameEmbedded(50, 150, 100, 100, fstr); + + // Set Audio to play across the slides + audioFrame.setPlayAcrossSlides(true); + + // Set Audio to automatically rewind to start after playing + audioFrame.setRewindAudio(true); + + // Set Play Mode and Volume of the Audio + audioFrame.setPlayMode(AudioPlayModePreset.Auto); + audioFrame.setVolume(AudioVolumeMode.Loud); + + //Write the PPTX file to disk + pres.save(dataDir + "AudioFrameEmbed_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AddAudioFrame + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AddOLEObjectFrame.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddOLEObjectFrame.java new file mode 100644 index 00000000..cc140f62 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddOLEObjectFrame.java @@ -0,0 +1,63 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; + + +public class AddOLEObjectFrame +{ + public static void main(String[] args) throws IOException + { + //ExStart:AddOLEObjectFrame + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + String outPath = RunExamples.getOutPath(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Presentation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + // Access the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Load an cel file to stream + FileInputStream fs = new FileInputStream(dataDir + "book1.xlsx"); + ByteArrayOutputStream mstream = new ByteArrayOutputStream(); + byte[] buf = new byte[4096]; + + while (true) + { + int bytesRead = fs.read(buf, 0, buf.length); + if (bytesRead <= 0) + break; + mstream.write(buf, 0, bytesRead); + } + // Create data object for embedding + IOleEmbeddedDataInfo dataInfo = new OleEmbeddedDataInfo(mstream.toByteArray(), "xlsx"); + + // Add an Ole Object Frame shape + IOleObjectFrame oleObjectFrame = sld.getShapes().addOleObjectFrame(0, 0, (float)pres.getSlideSize().getSize().getWidth(), + (float)pres.getSlideSize().getSize().getHeight(), dataInfo); + + //Write the PPTX to disk + pres.save(outPath + "OleEmbed_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:AddOLEObjectFrame + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AddPlainLineToSlide.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddPlainLineToSlide.java new file mode 100644 index 00000000..7756bbf5 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddPlainLineToSlide.java @@ -0,0 +1,44 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.ShapeType; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class AddPlainLineToSlide +{ + public static void main(String[] args) + { + //ExStart:AddPlainLineToSlide + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate PresentationEx class that represents the PPTX file + Presentation pres = new Presentation(); + try + { + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add an autoshape of type line + sld.getShapes().addAutoShape(ShapeType.Line, 50, 150, 300, 0); + + //Write the PPTX to Disk + pres.save(dataDir + "LineShape1_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AddPlainLineToSlide + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AddRelativeScaleHeightPictureFrame.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddRelativeScaleHeightPictureFrame.java new file mode 100644 index 00000000..b01cc92f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddRelativeScaleHeightPictureFrame.java @@ -0,0 +1,44 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + + +public class AddRelativeScaleHeightPictureFrame +{ + public static void main(String[] args) + { + //ExStart:AddRelativeScaleHeightPictureFrame + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + String outputDir = RunExamples.getOutPath(); + + // Instantiate presentation object + Presentation presentation = new Presentation(); + try + { + + // Load Image to be added in presentaiton image collection + IImage img = Images.fromFile(dataDir + "aspose-logo.jpg"); + IPPImage image = presentation.getImages().addImage(img); + + // Add picture frame to slide + IPictureFrame pf = presentation.getSlides().get_Item(0).getShapes().addPictureFrame(ShapeType.Rectangle, 50, 50, 100, 100, image); + + // Setting relative scale width and height + pf.setRelativeScaleHeight(0.8f); + pf.setRelativeScaleWidth(1.35f); + + // Save presentation + presentation.save(outputDir + "Adding Picture Frame with Relative Scale_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AddRelativeScaleHeightPictureFrame + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AddStretchOffsetForImageFill.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddStretchOffsetForImageFill.java new file mode 100644 index 00000000..0ebc5c61 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddStretchOffsetForImageFill.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AddStretchOffsetForImageFill +{ + public static void main(String[] args) + { + //ExStart:AddStretchOffsetForImageFill + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + String outputDir = RunExamples.getOutPath(); + + // Instantiate Prseetation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Instantiate the ImageEx class + IImage img = Images.fromFile(dataDir + "aspose-logo.jpg"); + IPPImage imgx = pres.getImages().addImage(img); + + // Add Picture Frame with height and width equivalent of Picture + sld.getShapes().addPictureFrame(ShapeType.Rectangle, 50, 150, imgx.getWidth(), imgx.getHeight(), imgx); + + //Write the PPTX file to disk + pres.save(outputDir + "AddStretchOffsetForImageFill_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AddStretchOffsetForImageFill + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AddVideoFrame.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddVideoFrame.java new file mode 100644 index 00000000..962e6863 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddVideoFrame.java @@ -0,0 +1,46 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class AddVideoFrame +{ + public static void main(String[] args) + { + //ExStart:AddVideoFrame + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate PrseetationEx class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add Video Frame + IVideoFrame vf = sld.getShapes().addVideoFrame(50, 150, 300, 150, dataDir + "video1.avi"); + + // Set Play Mode and Volume of the Video + vf.setPlayMode(VideoPlayModePreset.Auto); + vf.setVolume(AudioVolumeMode.Loud); + + //Write the PPTX file to disk + pres.save(dataDir + "VideoFrame_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AddVideoFrame + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AddVideoFrameFromWebSource.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddVideoFrameFromWebSource.java new file mode 100644 index 00000000..bd8fffcd --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AddVideoFrameFromWebSource.java @@ -0,0 +1,65 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.IVideoFrame; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.VideoPlayModePreset; +import com.aspose.slides.examples.RunExamples; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + + +public class AddVideoFrameFromWebSource +{ + //ExStart:AddVideoFrameFromWebSource + public static void main(String[] args) throws IOException + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + Presentation pres = new Presentation(); + try + { + addVideoFromYouTube(pres, "jfTqRWoYIe8"); + pres.save(dataDir + "AddVideoFrameFromWebSource_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + } + + private static void addVideoFromYouTube(Presentation pres, String videoId) throws IOException + { + //add videoFrame + IVideoFrame videoFrame = pres.getSlides().get_Item(0).getShapes().addVideoFrame(10, 10, 427, 240, "https://www.youtube.com/embed/" + videoId); + videoFrame.setPlayMode(VideoPlayModePreset.Auto); + // https://www.youtube.com/watch?v=jfTqRWoYIe8 + //load thumbnail + String thumbnailUri = "https://www.youtube.com/watch?v=" + videoId; + URL url = new URL(thumbnailUri); + URLConnection connection = url.openConnection(); + connection.setConnectTimeout(5000); + connection.setReadTimeout(10000); + try (InputStream input = connection.getInputStream(); + ByteArrayOutputStream output = new ByteArrayOutputStream()) + { + byte[] buffer = new byte[8192]; + for (int count; (count = input.read(buffer)) > 0; ) + { + output.write(buffer, 0, count); + } + output.toByteArray(); + videoFrame.getPictureFormat().getPicture().setImage(pres.getImages().addImage(output.toByteArray())); + } + } + //ExEnd:AddVideoFrameFromWebSource +} + + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AdjustValueTypeExample.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AdjustValueTypeExample.java new file mode 100644 index 00000000..91a6cef2 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AdjustValueTypeExample.java @@ -0,0 +1,60 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; + +public class AdjustValueTypeExample +{ + public static void main(String[] args) throws IOException + { + //Path for presentation + String presentationName = RunExamples.getDataDir_Shapes() + "PresetGeometry.pptx"; + + // Path to output document + String outFilePath = RunExamples.getOutPath() + "PresetGeometry_out.pptx"; + + //ExStart:AdjustValueTypeExample + Presentation pres = new Presentation(presentationName); + try { + IAutoShape shape = (IAutoShape)pres.getSlides().get_Item(0).getShapes().get_Item(0); + + // Show all adjustment point and its types for a RoundRectangle + System.out.println("Adjustment types for a Rectangle:"); + for (int i=0 ; i < shape.getAdjustments().size(); i++) + { + System.out.println("\tType for point " + i + " is \"" + ShapeAdjustmentType.getName(ShapeAdjustmentType.class, shape.getAdjustments().get_Item(i).getType()) + "\""); + } + // Change value of an adjustment point + if (shape.getAdjustments().get_Item(0).getType() == ShapeAdjustmentType.CornerSize) + { + shape.getAdjustments().get_Item(0).setAngleValue(shape.getAdjustments().get_Item(0).getAngleValue() * 2); + } + + // Show all adjustment point and its types for an RightArrow + IAutoShape shape1 = (IAutoShape)pres.getSlides().get_Item(0).getShapes().get_Item(1); + System.out.println("Adjustment types for an Arrow:"); + for (int i = 0; i < shape1.getAdjustments().size(); i++) + { + System.out.println("\tType for point " + i + " is \"" + ShapeAdjustmentType.getName(ShapeAdjustmentType.class, shape1.getAdjustments().get_Item(i).getType()) + "\""); + } + // Change value of adjustment points + if (shape1.getAdjustments().get_Item(0).getType() == ShapeAdjustmentType.ArrowTailThickness) + { + shape1.getAdjustments().get_Item(0).setAngleValue(shape1.getAdjustments().get_Item(0).getAngleValue() / 3); + } + if (shape1.getAdjustments().get_Item(1).getType() == ShapeAdjustmentType.ArrowheadLength) + { + shape1.getAdjustments().get_Item(1).setAngleValue(shape1.getAdjustments().get_Item(1).getAngleValue() / 2); + } + + // Save the presentation + pres.save(outFilePath, SaveFormat.Pptx); + + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:AdjustValueTypeExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AnimationFloatUpDown.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AnimationFloatUpDown.java new file mode 100644 index 00000000..27536a5c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AnimationFloatUpDown.java @@ -0,0 +1,27 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.EffectType; + + +import java.io.IOException; + +public class AnimationFloatUpDown +{ + public static void main(String[] args) throws IOException + { + //ExStart:AnimationFloatUpDown + int type = EffectType.Descend; + System.out.println(type == EffectType.Descend); // Should return 'true' + System.out.println(type == EffectType.FloatDown); // Should return 'true' + type = EffectType.FloatDown; + System.out.println(type == EffectType.Descend); // Should return 'true' + System.out.println(type == EffectType.FloatDown); // Should return 'true' + type = EffectType.Ascend; + System.out.println(type == EffectType.Ascend); // Should return 'true' + System.out.println(type == EffectType.FloatUp); // Should return 'true' + type = EffectType.FloatUp; + System.out.println(type == EffectType.Ascend); // Should return 'true' + System.out.println(type == EffectType.FloatUp); // Should return 'true' + //ExEnd:AnimationFloatUpDown + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AnimationTargetShapes.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AnimationTargetShapes.java new file mode 100644 index 00000000..1e269410 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AnimationTargetShapes.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.shapes;/* + * Copyright (c) 2009-2021 Aspose Pty Ltd. All Rights Reserved. + */ + +import com.aspose.slides.IEffect; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +public class AnimationTargetShapes +{ + public static void main(String[] args) + { + //ExStart:AnimationTargetShapes + // Path to source presentation + String presentationFileName = RunExamples.getDataDir_Shapes() + "AnimationShapesExample.pptx"; + + Presentation pres = new Presentation(presentationFileName); + try { + for (ISlide slide : pres.getSlides()) + { + for (IEffect effect : slide.getTimeline().getMainSequence()) + { + System.out.println(effect.getType() + " animation effect is set to shape#" + + effect.getTargetShape().getUniqueId() + " on slide#" + slide.getSlideNumber()); + } + } + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:AnimationTargetShapes + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/AnimationsOnShapes.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/AnimationsOnShapes.java new file mode 100644 index 00000000..e069ba55 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/AnimationsOnShapes.java @@ -0,0 +1,67 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.geom.Point2D; +import java.io.File; +import java.lang.reflect.Array; + + +public class AnimationsOnShapes +{ + public static void main(String[] args) + { + //ExStart:AnimationsOnShapes + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate PrseetationEx class that represents the PPTX + Presentation pres = new Presentation(); + try + { + ISlide sld = pres.getSlides().get_Item(0); + + // Now create effect "PathFootball" for existing shape from scratch. + IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 150, 150, 250, 25); + + ashp.addTextFrame("Animated TextBox"); + + // Add PathFootBall animation effect + pres.getSlides().get_Item(0).getTimeline().getMainSequence().addEffect(ashp, EffectType.PathFootball, + EffectSubtype.None, EffectTriggerType.AfterPrevious); + + // Create some kind of "button". + IShape shapeTrigger = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Bevel, 10, 10, 20, 20); + + // Create sequence of effects for this button. + ISequence seqInter = pres.getSlides().get_Item(0).getTimeline().getInteractiveSequences().add(shapeTrigger); + + // Create custom user path. Our object will be moved only after "button" click. + IEffect fxUserPath = seqInter.addEffect(ashp, EffectType.PathUser, EffectSubtype.None, EffectTriggerType.OnClick); + + // Created path is empty so we should add commands for moving. + IMotionEffect motionBhv = ((IMotionEffect) fxUserPath.getBehaviors().get_Item(0)); + + Point2D.Float[] pts = (Point2D.Float[]) Array.newInstance(Point2D.Float.class, 1); + pts[0] = new Point2D.Float(0.076f, 0.59f); + motionBhv.getPath().add(MotionCommandPathType.LineTo, pts, MotionPathPointsType.Auto, true); + pts[0] = new Point2D.Float(-0.076f, -0.59f); + motionBhv.getPath().add(MotionCommandPathType.LineTo, pts, MotionPathPointsType.Auto, false); + motionBhv.getPath().add(MotionCommandPathType.End, null, MotionPathPointsType.Auto, false); + + //Write the presentation as PPTX to disk + pres.save(dataDir + "AnimExample_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AnimationsOnShapes + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/Apply3DRotationEffectOnShape.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/Apply3DRotationEffectOnShape.java new file mode 100644 index 00000000..1e973efb --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/Apply3DRotationEffectOnShape.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class Apply3DRotationEffectOnShape +{ + public static void main(String[] args) + { + //ExStart:Apply3DRotationEffecrOnShapes + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create an instance of Presentation class + Presentation pres = new Presentation(); + IShape autoShape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 30, 30, 200, 200); + + autoShape.getThreeDFormat().setDepth((short) 6); + autoShape.getThreeDFormat().getCamera().setRotation(40, 35, 20); + autoShape.getThreeDFormat().getCamera().setCameraType(CameraPresetType.IsometricLeftUp); + autoShape.getThreeDFormat().getLightRig().setLightType(LightRigPresetType.Balanced); + + autoShape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Line, 30, 300, 200, 200); + autoShape.getThreeDFormat().setDepth((short) 6); + autoShape.getThreeDFormat().getCamera().setRotation(0, 35, 20); + autoShape.getThreeDFormat().getCamera().setCameraType(CameraPresetType.IsometricLeftUp); + autoShape.getThreeDFormat().getLightRig().setLightType(LightRigPresetType.Balanced); + + + pres.save(dataDir + "Rotation_out.pptx", SaveFormat.Pptx); + //ExEnd:Apply3DRotationEffecrOnShapes + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/ApplyBevelEffects.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/ApplyBevelEffects.java new file mode 100644 index 00000000..5723c755 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/ApplyBevelEffects.java @@ -0,0 +1,51 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class ApplyBevelEffects +{ + public static void main(String[] args) + { + //ExStart:ApplyBevelEffects + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create an instance of Presentation class + Presentation pres = new Presentation(); + try + { + ISlide slide = pres.getSlides().get_Item(0); + + // Add a shape on slide + IAutoShape shape = slide.getShapes().addAutoShape(ShapeType.Ellipse, 30, 30, 100, 100); + shape.getFillFormat().setFillType(FillType.Solid); + shape.getFillFormat().getSolidFillColor().setColor(Color.GREEN); + ILineFillFormat format = shape.getLineFormat().getFillFormat(); + format.setFillType(FillType.Solid); + format.getSolidFillColor().setColor(Color.ORANGE); + shape.getLineFormat().setWidth(2.0); + + // Set ThreeDFormat properties of shape + shape.getThreeDFormat().setDepth((short) 4); + shape.getThreeDFormat().getBevelTop().setBevelType(BevelPresetType.Circle); + shape.getThreeDFormat().getBevelTop().setHeight(6); + shape.getThreeDFormat().getBevelTop().setWidth(6); + shape.getThreeDFormat().getCamera().setCameraType(CameraPresetType.OrthographicFront); + shape.getThreeDFormat().getLightRig().setLightType(LightRigPresetType.ThreePt); + shape.getThreeDFormat().getLightRig().setDirection(LightingDirection.Top); + + // Write the presentation as a PPTX file + pres.save(dataDir + "Bavel_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ApplyBevelEffects + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/BrightnessContrastEffectExample.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/BrightnessContrastEffectExample.java new file mode 100644 index 00000000..1dc09ce9 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/BrightnessContrastEffectExample.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class BrightnessContrastEffectExample +{ + public static void main(String[] args) + { + // Path to source presentation + String presentationName = RunExamples.getDataDir_Shapes() + "BrightnessContrast.pptx"; + + //ExStart:BrightnessContrastEffectExample + Presentation presentation = new Presentation(presentationName); + try { + // Get slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Get picture frame + IPictureFrame pictureFrame = (IPictureFrame)(slide.getShapes().get_Item(0)); + + // Get image transform operations + IImageTransformOperationCollection imageTransform = pictureFrame.getPictureFormat().getPicture().getImageTransform(); + for (IImageTransformOperation effect : imageTransform) + { + if (effect instanceof IBrightnessContrast) + { + // Get brightness and contrast values + IBrightnessContrast brightnessContrast = (IBrightnessContrast)effect; + IBrightnessContrastEffectiveData brightnessContrastData = brightnessContrast.getEffective(); + + System.out.println("Brightness value = " + brightnessContrastData.getBrightness()); + System.out.println("Contrast value = " + brightnessContrastData.getContrast()); + } + } + } finally { + if (presentation != null) presentation.dispose(); + } + //ExEnd:BrightnessContrastEffectExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/ChangeOLEObjectData.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/ChangeOLEObjectData.java new file mode 100644 index 00000000..f141f7c6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/ChangeOLEObjectData.java @@ -0,0 +1,83 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.cells.OoxmlSaveOptions; +import com.aspose.cells.Workbook; +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; + + +public class ChangeOLEObjectData +{ + public static void main(String[] args) throws Exception + { + //ExStart:ChangeOLEObjectData + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + Presentation pres = new Presentation(dataDir + "ChangeOLEObjectData.pptx"); + try + { + ISlide slide = pres.getSlides().get_Item(0); + + OleObjectFrame ole = null; + + // Traversing all shapes for Ole frame + for (IShape shape : slide.getShapes()) + { + if (shape instanceof OleObjectFrame) + { + ole = (OleObjectFrame) shape; + } + } + + if (ole != null) + { + ByteArrayInputStream msln = new ByteArrayInputStream(ole.getEmbeddedData().getEmbeddedFileData()); + try + { + // Reading object data in Workbook + Workbook Wb = new Workbook(msln); + + ByteArrayOutputStream msout = new ByteArrayOutputStream(); + try + { + // Modifying the workbook data + Wb.getWorksheets().get(0).getCells().get(0, 4).putValue("E"); + Wb.getWorksheets().get(0).getCells().get(1, 4).putValue(12); + Wb.getWorksheets().get(0).getCells().get(2, 4).putValue(14); + Wb.getWorksheets().get(0).getCells().get(3, 4).putValue(15); + + OoxmlSaveOptions so1 = + new OoxmlSaveOptions(com.aspose.cells.SaveFormat.XLSX); + + Wb.save(msout, so1); + + // Changing Ole frame object data + IOleEmbeddedDataInfo newData = new OleEmbeddedDataInfo(msout.toByteArray(), + ole.getEmbeddedData().getEmbeddedFileExtension()); + ole.setEmbeddedData(newData); + } + finally + { + if (msout != null) msout.close(); + } + } + finally + { + if (msln != null) msln.close(); + } + } + + pres.save(dataDir + "OleEdit_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:ChangeOLEObjectData + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/ChangeShapeOrder.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/ChangeShapeOrder.java new file mode 100644 index 00000000..651ec7f7 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/ChangeShapeOrder.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ChangeShapeOrder +{ + public static void main(String[] args) + { + //ExStart:ChangeShapeOrder + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + Presentation presentation1 = new Presentation(dataDir + "HelloWorld.pptx"); + try + { + ISlide slide = presentation1.getSlides().get_Item(0); + IAutoShape shp3 = slide.getShapes().addAutoShape(ShapeType.Rectangle, 200, 365, 400, 150); + shp3.getFillFormat().setFillType(FillType.NoFill); + shp3.addTextFrame(" "); + + ITextFrame txtFrame = shp3.getTextFrame(); + IParagraph para = txtFrame.getParagraphs().get_Item(0); + IPortion portion = para.getPortions().get_Item(0); + portion.setText("Watermark Text Watermark Text Watermark Text"); + shp3 = slide.getShapes().addAutoShape(ShapeType.Triangle, 200, 365, 400, 150); + slide.getShapes().reorder(2, shp3); + presentation1.save(dataDir + "Reshape_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation1 != null) presentation1.dispose(); + } + //ExEnd:ChangeShapeOrder + } +} + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/CloneShapes.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/CloneShapes.java new file mode 100644 index 00000000..9f25d52e --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/CloneShapes.java @@ -0,0 +1,44 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class CloneShapes +{ + public static void main(String[] args) + { + //ExStart:CloneShapes + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Instantiate Presentation class + Presentation srcPres = new Presentation(dataDir + "Source Frame.pptx"); + try + { + IShapeCollection sourceShapes = srcPres.getSlides().get_Item(0).getShapes(); + ILayoutSlide blankLayout = srcPres.getMasters().get_Item(0).getLayoutSlides().getByType(SlideLayoutType.Blank); + ISlide destSlide = srcPres.getSlides().addEmptySlide(blankLayout); + IShapeCollection destShapes = destSlide.getShapes(); + destShapes.addClone(sourceShapes.get_Item(1), 50, 150 + sourceShapes.get_Item(0).getHeight()); + destShapes.addClone(sourceShapes.get_Item(2)); + destShapes.insertClone(0, sourceShapes.get_Item(0), 50, 150); + + // Write the PPTX file to disk + srcPres.save(dataDir + "CloneShape_out.pptx", SaveFormat.Pptx); + + //ExEnd:CloneShapes + } + finally + { + if (srcPres != null) srcPres.dispose(); + } + + } +} + + + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/CompressImageExample.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/CompressImageExample.java new file mode 100644 index 00000000..57c3e8d0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/CompressImageExample.java @@ -0,0 +1,52 @@ +package com.aspose.slides.examples.shapes; + + +import com.aspose.slides.IPictureFrame; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; +import java.io.IOException; + +public class CompressImageExample +{ + + public static void main(String[] args) throws IOException + { + // Path to source presentation + String presentationName = RunExamples.getDataDir_Shapes() + "CroppedImage.pptx"; + // Path to output document + String outFilePath = RunExamples.getOutPath() + "CompressImage-out.pptx"; + + //ExStart:CompressImageExample + Presentation pres = new Presentation(presentationName); + try { + ISlide slide = pres.getSlides().get_Item(0); + // Get the PictureFrame from the slide + IPictureFrame picFrame = (IPictureFrame) slide.getShapes().get_Item(0); + // Compress the image with a target resolution of 150 DPI (Web resolution) and remove cropped areas + boolean result = picFrame.getPictureFormat().compressImage(true, 150f); + // Check the result of the compression + if (result) + { + System.out.println("Image successfully compressed."); + } + else + { + System.out.println("Image compression failed or no changes were necessary."); + } + // Save result + pres.save(outFilePath, SaveFormat.Pptx); + + // Check size + System.out.println("Source presentation length = " + new File(presentationName).length()); + System.out.println("Resulting presentation length = " + new File(outFilePath).length()); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:CompressImageExample + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/ConnectShapeUsingConnectionSite.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/ConnectShapeUsingConnectionSite.java new file mode 100644 index 00000000..d53c2dd8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/ConnectShapeUsingConnectionSite.java @@ -0,0 +1,56 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConnectShapeUsingConnectionSite +{ + public static void main(String[] args) + { + //ExStart:ConnectShapeUsingConnectionSite + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Instantiate Presentation class that represents the PPTX file + Presentation presentation = new Presentation(); + try + { + // Accessing shapes collection for selected slide + IShapeCollection shapes = presentation.getSlides().get_Item(0).getShapes(); + + // Adding connector shape to slide shape collection + IConnector connector = shapes.addConnector(ShapeType.BentConnector3, 0, 0, 10, 10); + + // Add autoshape Ellipse + IAutoShape ellipse = shapes.addAutoShape(ShapeType.Ellipse, 0, 100, 100, 100); + + // Add autoshape Rectangle + IAutoShape rectangle = shapes.addAutoShape(ShapeType.Rectangle, 100, 200, 100, 100); + + // Joining Shapes to connectors + connector.setStartShapeConnectedTo(ellipse); + connector.setEndShapeConnectedTo(rectangle); + + // Setting the desired connection site index of Ellipse shape for connector to get connected + + long wantedIndex = 6; + + // Checking if desired index is less than maximum site index count + if (ellipse.getConnectionSiteCount() > (wantedIndex & 0xFFFFFFFFL)) + { + // Setting the desired connection site for connector on Ellipse + connector.setStartShapeConnectionSiteIndex(wantedIndex); + } + + // Save presentation + presentation.save(dataDir + "Connecting_Shape_on_desired_connection_site_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ConnectShapeUsingConnectionSite + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/ConnectShapesUsingConnectors.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/ConnectShapesUsingConnectors.java new file mode 100644 index 00000000..a6fa6e0b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/ConnectShapesUsingConnectors.java @@ -0,0 +1,48 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConnectShapesUsingConnectors +{ + public static void main(String[] args) + { + //ExStart:ConnectShapesUsingConnectors + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Instantiate Presentation class that represents the PPTX file + Presentation input = new Presentation(); + try + { + // Accessing shapes collection for selected slide + IShapeCollection shapes = input.getSlides().get_Item(0).getShapes(); + + // Add autoshape Ellipse + IAutoShape ellipse = shapes.addAutoShape(ShapeType.Ellipse, 0, 100, 100, 100); + + // Add autoshape Rectangle + IAutoShape rectangle = shapes.addAutoShape(ShapeType.Rectangle, 100, 300, 100, 100); + + // Adding connector shape to slide shape collection + IConnector connector = shapes.addConnector(ShapeType.BentConnector2, 0, 0, 10, 10); + + // Joining Shapes to connectors + connector.setStartShapeConnectedTo(ellipse); + connector.setEndShapeConnectedTo(rectangle); + + // Call reroute to set the automatic shortest path between shapes + connector.reroute(); + + // Saving presenation + input.save(dataDir + "Connecting shapes using connectors_out.pptx", SaveFormat.Pptx); + } + finally + { + if (input != null) input.dispose(); + } + //ExEnd:ConnectShapesUsingConnectors + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/ConnectorLineAngle.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/ConnectorLineAngle.java new file mode 100644 index 00000000..9ec5e291 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/ConnectorLineAngle.java @@ -0,0 +1,52 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ConnectorLineAngle +{ + //ExStart:ConnectorLineAngle + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + Presentation pres = new Presentation(dataDir + "ConnectorLineAngle.pptx"); + Slide slide = (Slide) pres.getSlides().get_Item(0); + Shape shape; + for (int i = 0; i < slide.getShapes().size(); i++) + { + double dir = 0.0; + shape = (Shape) slide.getShapes().get_Item(i); + if (shape instanceof AutoShape) + { + AutoShape ashp = (AutoShape) shape; + if (ashp.getShapeType() == ShapeType.Line) + { + dir = getDirection(ashp.getWidth(), ashp.getHeight(), ashp.getFrame().getFlipH() != 0, ashp.getFrame().getFlipV() != 0); + } + } else if (shape instanceof Connector) + { + Connector ashp = (Connector) shape; + dir = getDirection(ashp.getWidth(), ashp.getHeight(), ashp.getFrame().getFlipH() != 0, ashp.getFrame().getFlipV() != 0); + } + + System.out.println(dir); + } + + } + + public static double getDirection(float w, float h, boolean flipH, boolean flipV) + { + float endLineX = w * (flipH ? -1 : 1); + float endLineY = h * (flipV ? -1 : 1); + float endYAxisX = 0; + float endYAxisY = h; + double angle = (Math.atan2(endYAxisY, endYAxisX) - Math.atan2(endLineY, endLineX)); + if (angle < 0) angle += 2 * Math.PI; + return angle * 180.0 / Math.PI; + } + //ExEnd:ConnectorLineAngle +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateBoundsShapeThumbnail.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateBoundsShapeThumbnail.java new file mode 100644 index 00000000..ddb9f769 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateBoundsShapeThumbnail.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.IImage; +import com.aspose.slides.Presentation; +import com.aspose.slides.ShapeThumbnailBounds; +import com.aspose.slides.examples.RunExamples; + + + +public class CreateBoundsShapeThumbnail +{ + public static void main(String[] args) + { + //ExStart:CreateBoundsShapeThumbnail + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Instantiate a Presentation class that represents the presentation file + Presentation presentation = new Presentation(dataDir + "HelloWorld.pptx"); + try + { + // Create a Appearance bound shape image + IImage img = presentation.getSlides().get_Item(0).getShapes().get_Item(0).getImage(ShapeThumbnailBounds.Appearance, 1, 1); + + // Save the image to disk in PNG format + img.save(dataDir + "Shape_thumbnail_Bound_Shape_out.png"); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:CreateBoundsShapeThumbnail + } +} + + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateGroupShape.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateGroupShape.java new file mode 100644 index 00000000..19a08c99 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateGroupShape.java @@ -0,0 +1,50 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class CreateGroupShape +{ + public static void main(String[] args) + { + //ExStart:CreateGroupShape + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Instantiate Prseetation class + Presentation pres = new Presentation(); + try + { + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Accessing the shape collection of slides + IShapeCollection slideShapes = sld.getShapes(); + + // Adding a group shape to the slide + IGroupShape groupShape = slideShapes.addGroupShape(); + + // Adding shapes inside added group shape + groupShape.getShapes().addAutoShape(ShapeType.Rectangle, 300, 100, 100, 100); + groupShape.getShapes().addAutoShape(ShapeType.Rectangle, 500, 100, 100, 100); + groupShape.getShapes().addAutoShape(ShapeType.Rectangle, 300, 300, 100, 100); + groupShape.getShapes().addAutoShape(ShapeType.Rectangle, 500, 300, 100, 100); + + // Adding group shape frame + groupShape.setFrame(new ShapeFrame(100, 300, 500, 40, NullableBool.False, NullableBool.False, 0)); + + // Write the PPTX file to disk + pres.save(dataDir + "GroupShape_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:CreateGroupShape + } +} + + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateScalingFactorThumbnail.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateScalingFactorThumbnail.java new file mode 100644 index 00000000..a0e4ada5 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateScalingFactorThumbnail.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.IImage; +import com.aspose.slides.ImageFormat; +import com.aspose.slides.Presentation; +import com.aspose.slides.ShapeThumbnailBounds; +import com.aspose.slides.examples.RunExamples; + + +public class CreateScalingFactorThumbnail +{ + public static void main(String[] args) + { + //ExStart:CreateScalingFactorThumbnail + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Instantiate a Presentation class that represents the presentation file + Presentation p = new Presentation(dataDir + "HelloWorld.pptx"); + try + { + // Create a full scale image + IImage img = p.getSlides().get_Item(0).getShapes().get_Item(0).getImage(ShapeThumbnailBounds.Shape, 1, 1); + + // Save the image to disk in PNG format + img.save(dataDir + "Scaling Factor Thumbnail_out.png", ImageFormat.Png); + } + finally + { + if (p != null) p.dispose(); + } + //ExEnd:CreateScalingFactorThumbnail + } +} + + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateSectionZoom.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateSectionZoom.java new file mode 100644 index 00000000..e73a6c2a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateSectionZoom.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2009-2021. Aspose Pty Ltd. All Rights Reserved. + */ + +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + +public class CreateSectionZoom { + + public static void main(String[] args) + { + // Output file name + String resultPath = RunExamples.getOutPath() + "SectionZoomPresentation.pptx"; + + //ExStart:CreateSectionZoom + Presentation pres = new Presentation(); + try { + //Adds a new slide to the presentation + ISlide slide = pres.getSlides().addEmptySlide(pres.getSlides().get_Item(0).getLayoutSlide()); + slide.getBackground().getFillFormat().setFillType(FillType.Solid); + slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.YELLOW); + slide.getBackground().setType(BackgroundType.OwnBackground); + + // Adds a new Section to the presentation + pres.getSections().addSection("Section 1", slide); + + // Adds a SectionZoomFrame object + ISectionZoomFrame sectionZoomFrame = pres.getSlides().get_Item(0).getShapes().addSectionZoomFrame(20, 20, 300, 200, pres.getSections().get_Item(1)); + + // Saves the presentation + pres.save(resultPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:CreateSectionZoom + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateShapeThumbnail.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateShapeThumbnail.java new file mode 100644 index 00000000..a686518c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateShapeThumbnail.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.IImage; +import com.aspose.slides.ImageFormat; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + + +public class CreateShapeThumbnail +{ + public static void main(String[] args) + { + //ExStart:CreateShapeThumbnail + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Instantiate a Presentation class that represents the presentation file + Presentation presentation = new Presentation(dataDir + "HelloWorld.pptx"); + try + { + // Create a full scale image + IImage img = presentation.getSlides().get_Item(0).getShapes().get_Item(0).getImage(); + // Save the image to disk in PNG format + img.save(dataDir + "Shape_thumbnail_out.png", ImageFormat.Png); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:CreateShapeThumbnail + } +} + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateSmartArtChildNoteThumbnail.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateSmartArtChildNoteThumbnail.java new file mode 100644 index 00000000..79b24a71 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateSmartArtChildNoteThumbnail.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class CreateSmartArtChildNoteThumbnail +{ + public static void main(String[] args) + { + //ExStart:CreateSmartArtChildNoteThumbnail + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Instantiate Presentation class that represents the PPTX file + Presentation pres = new Presentation(); + + // Add SmartArt + ISmartArt smart = pres.getSlides().get_Item(0).getShapes().addSmartArt(10, 10, 400, 300, SmartArtLayoutType.BasicCycle); + + // Obtain the reference of a node by using its Index + ISmartArtNode node = smart.getNodes().get_Item(1); + + // Get thumbnail + IImage img = node.getShapes().get_Item(0).getImage(); + + // Save thumbnail + img.save(dataDir + "SmartArt_ChildNote_Thumbnail_out.jpeg", ImageFormat.Jpeg); + //ExEnd:CreateSmartArtChildNoteThumbnail + } +} + + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateSummaryZoom.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateSummaryZoom.java new file mode 100644 index 00000000..9196e7f1 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateSummaryZoom.java @@ -0,0 +1,66 @@ +package com.aspose.slides.examples.shapes;/* + * Copyright (c) 2009-2021 Aspose Pty Ltd. All Rights Reserved. + */ + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + +public class CreateSummaryZoom +{ + public static void main(String[] args) + { + // Output file name + String resultPath = RunExamples.getOutPath() + "SummaryZoomPresentation.pptx"; + + //ExStart:CreateSummaryZoom + Presentation pres = new Presentation(); + try { + //Adds a new slide to the presentation + ISlide slide = pres.getSlides().addEmptySlide(pres.getSlides().get_Item(0).getLayoutSlide()); + slide.getBackground().getFillFormat().setFillType(FillType.Solid); + slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.GRAY); + slide.getBackground().setType(BackgroundType.OwnBackground); + + // Adds a new section to the presentation + pres.getSections().addSection("Section 1", slide); + + //Adds a new slide to the presentation + slide = pres.getSlides().addEmptySlide(pres.getSlides().get_Item(0).getLayoutSlide()); + slide.getBackground().getFillFormat().setFillType(FillType.Solid); + slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN); + slide.getBackground().setType(BackgroundType.OwnBackground); + + // Adds a new section to the presentation + pres.getSections().addSection("Section 2", slide); + + //Adds a new slide to the presentation + slide = pres.getSlides().addEmptySlide(pres.getSlides().get_Item(0).getLayoutSlide()); + slide.getBackground().getFillFormat().setFillType(FillType.Solid); + slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.MAGENTA); + slide.getBackground().setType(BackgroundType.OwnBackground); + + // Adds a new section to the presentation + pres.getSections().addSection("Section 3", slide); + + //Adds a new slide to the presentation + slide = pres.getSlides().addEmptySlide(pres.getSlides().get_Item(0).getLayoutSlide()); + slide.getBackground().getFillFormat().setFillType(FillType.Solid); + slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.GREEN); + slide.getBackground().setType(BackgroundType.OwnBackground); + + // Adds a new section to the presentation + pres.getSections().addSection("Section 4", slide); + + // Adds a SummaryZoomFrame object + ISummaryZoomFrame summaryZoomFrame = pres.getSlides().get_Item(0).getShapes().addSummaryZoomFrame(150, 50, 300, 200); + + // Saves the presentation + pres.save(resultPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:CreateSummaryZoom + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateZoomFrame.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateZoomFrame.java new file mode 100644 index 00000000..3b4b5726 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/CreateZoomFrame.java @@ -0,0 +1,70 @@ +package com.aspose.slides.examples.shapes;/* + * Copyright (c) 2009-2021 Aspose Pty Ltd. All Rights Reserved. + */ + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class CreateZoomFrame +{ + public static void main(String[] args) + { + // Output file name + String resultPath = RunExamples.getOutPath() + "ZoomFramePresentation.pptx"; + + // Path to source image + String imagePath = RunExamples.getDataDir_Shapes() + "aspose-logo.jpg"; + + Presentation pres = new Presentation(); + try { + //Add new slides to the presentation + ISlide slide2 = pres.getSlides().addEmptySlide(pres.getSlides().get_Item(0).getLayoutSlide()); + ISlide slide3 = pres.getSlides().addEmptySlide(pres.getSlides().get_Item(0).getLayoutSlide()); + + // Create a background for the second slide + slide2.getBackground().setType(BackgroundType.OwnBackground); + slide2.getBackground().getFillFormat().setFillType(FillType.Solid); + slide2.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN); + + // Create a text box for the second slide + IAutoShape autoshape = slide2.getShapes().addAutoShape(ShapeType.Rectangle, 100, 200, 500, 200); + autoshape.getTextFrame().setText("Second Slide"); + + // Create a background for the third slide + slide3.getBackground().setType(BackgroundType.OwnBackground); + slide3.getBackground().getFillFormat().setFillType(FillType.Solid); + slide3.getBackground().getFillFormat().getSolidFillColor().setColor(Color.DARK_GRAY); + + // Create a text box for the third slide + autoshape = slide3.getShapes().addAutoShape(ShapeType.Rectangle, 100, 200, 500, 200); + autoshape.getTextFrame().setText("Trird Slide"); + + // Add ZoomFrame objects with slide preview + IZoomFrame zoomFrame1 = pres.getSlides().get_Item(0).getShapes().addZoomFrame(20, 20, 250, 200, slide2); + + // Add ZoomFrame objects with custom image + // Create a new image for the zoom object + IPPImage image = pres.getImages().addImage(Images.fromFile(imagePath)); + IZoomFrame zoomFrame2 = pres.getSlides().get_Item(0).getShapes().addZoomFrame(200, 250, 250, 100, slide3, image); + + // Set a zoom frame format for the zoomFrame2 object + zoomFrame2.getLineFormat().setWidth(5); + zoomFrame2.getLineFormat().getFillFormat().setFillType(FillType.Solid); + zoomFrame2.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.MAGENTA); + zoomFrame2.getLineFormat().setDashStyle(LineDashStyle.DashDot); + + // Do not show background for zoomFrame1 object + zoomFrame1.setShowBackground(false); + + // Save the presentation + pres.save(resultPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/DeletePictureCroppedAreasExample.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/DeletePictureCroppedAreasExample.java new file mode 100644 index 00000000..19149275 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/DeletePictureCroppedAreasExample.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + +public class DeletePictureCroppedAreasExample +{ + public static void main(String[] args) + { + // Path to source presentation + String presentationName = RunExamples.getDataDir_Shapes() + "CroppedImage.pptx"; + // Path to output document + String outFilePath = RunExamples.getOutPath() + "CroppedImage-out.pptx"; + + //ExStart:DeletePictureCroppedAreasExample + Presentation pres = new Presentation(presentationName); + try { + // Gets the first slide + ISlide slide = pres.getSlides().get_Item(0); + + // Gets the PictureFrame + IPictureFrame picFrame = (IPictureFrame)slide.getShapes().get_Item(0); + + // Deletes cropped areas of the PictureFrame image + IPPImage croppedImage = picFrame.getPictureFormat().deletePictureCroppedAreas(); + + // Save result + pres.save(outFilePath, SaveFormat.Pptx); + + // Check size + System.out.println(String.format("Source presentation length\t = %d", new File(presentationName).length())); + System.out.println(String.format("Resulting presentation length\t = %d", new File(outFilePath).length())); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:DeletePictureCroppedAreasExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/DuotoneEffectsPVI.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/DuotoneEffectsPVI.java new file mode 100644 index 00000000..b602530c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/DuotoneEffectsPVI.java @@ -0,0 +1,51 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +/* +This code demonstrates an operation where we added a picture for a slide background, added Duotone effect with styled colors, +and then we got the effective duotone colors with which the background will be rendered. +*/ +public class DuotoneEffectsPVI +{ + public static void main(String[] args) + { + //ExStart:DuotoneEffectsPVI + Presentation presentation = new Presentation(); + try { + // Add image to presentation + IPPImage backgroundImage = presentation.getImages().addImage(Images.fromFile(RunExamples.getDataDir_Shapes() + "aspose-logo.jpg")); + + // Set background in first slide + presentation.getSlides().get_Item(0).getBackground().setType(BackgroundType.OwnBackground); + presentation.getSlides().get_Item(0).getBackground().getFillFormat().setFillType(FillType.Picture); + presentation.getSlides().get_Item(0).getBackground().getFillFormat().getPictureFillFormat(). + getPicture().setImage(backgroundImage); + + // Add Duotone effect to background + IDuotone duotone = presentation.getSlides().get_Item(0).getBackground().getFillFormat(). + getPictureFillFormat().getPicture().getImageTransform().addDuotoneEffect(); + + // Set Doutone properties + duotone.getColor1().setColorType(ColorType.Scheme); + duotone.getColor1().setSchemeColor(SchemeColor.Accent1); + duotone.getColor2().setColorType(ColorType.Scheme); + duotone.getColor2().setSchemeColor(SchemeColor.Dark2); + + // Get Effective values of the Duotone effect + IDuotoneEffectiveData duotoneEffective = duotone.getEffective(); + + // Show effective values + System.out.println("Duotone effective color1: " + duotoneEffective.getColor1()); + System.out.println("Duotone effective color2: " + duotoneEffective.getColor2()); + } finally { + if (presentation != null) presentation.dispose(); + } + //ExEnd:DuotoneEffectsPVI + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/EmbeddedVideoFrame.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/EmbeddedVideoFrame.java new file mode 100644 index 00000000..c84634f9 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/EmbeddedVideoFrame.java @@ -0,0 +1,55 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; + + +public class EmbeddedVideoFrame +{ + public static void main(String[] args) throws FileNotFoundException + { + //ExStart:EmbeddedVideoFrame + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + String videoDir = RunExamples.getDataDir_Video(); + String resultPath = RunExamples.getOutPath() + "VideoFrame_out.pptx"; + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + // Instantiate Presentation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Embedd vide inside presentation + IVideo vid = pres.getVideos().addVideo(new FileInputStream(videoDir + "Wildlife.mp4"), LoadingStreamBehavior.ReadStreamAndRelease); + + // Add Video Frame + IVideoFrame vf = sld.getShapes().addVideoFrame(50, 150, 300, 350, vid); + + // Set video to Video Frame + vf.setEmbeddedVideo(vid); + + // Set Play Mode and Volume of the Video + vf.setPlayMode(VideoPlayModePreset.Auto); + vf.setVolume(AudioVolumeMode.Loud); + + // Write the PPTX file to disk + pres.save(resultPath, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:EmbeddedVideoFrame + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/ExtractEmbeddedFileDataFromOLEObject.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/ExtractEmbeddedFileDataFromOLEObject.java new file mode 100644 index 00000000..25d9e359 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/ExtractEmbeddedFileDataFromOLEObject.java @@ -0,0 +1,54 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.IShape; +import com.aspose.slides.ISlide; +import com.aspose.slides.OleObjectFrame; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.FileOutputStream; +import java.io.IOException; + + +public class ExtractEmbeddedFileDataFromOLEObject +{ + public static void main(String[] args) throws IOException + { + + //ExStart:ExtractEmbeddedFileDataFromOLEObject + + // The documents directory path. + String dataDir = RunExamples.getDataDir_Shapes(); + + String pptxFileName = dataDir + "TestOlePresentation.pptx"; + Presentation pres = new Presentation(pptxFileName); + try + { + int objectnum = 0; + for (ISlide sld : pres.getSlides()) + { + for (IShape shape : sld.getShapes()) + { + if (shape instanceof OleObjectFrame) + { + objectnum++; + OleObjectFrame oleFrame = (OleObjectFrame) shape; + byte[] data = oleFrame.getEmbeddedData().getEmbeddedFileData(); + String fileExtention = oleFrame.getEmbeddedData().getEmbeddedFileExtension(); + String extractedPath = dataDir + "ExtractedObject_out" + objectnum + fileExtention; + FileOutputStream fs = new FileOutputStream(extractedPath); + fs.write(data, 0, data.length); + } + } + } + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:ExtractEmbeddedFileDataFromOLEObject + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/FillShapesGradient.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/FillShapesGradient.java new file mode 100644 index 00000000..26146a4f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/FillShapesGradient.java @@ -0,0 +1,54 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class FillShapesGradient +{ + public static void main(String[] args) + { + //ExStart:FillShapesGradient + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Prseetation class that represents the PPTX// Instantiate Prseetation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add autoshape of ellipse type + IShape shp = sld.getShapes().addAutoShape(ShapeType.Ellipse, 50, 150, 75, 150); + + // Apply some gradiant formatting to ellipse shape + shp.getFillFormat().setFillType(FillType.Gradient); + shp.getFillFormat().getGradientFormat().setGradientShape(GradientShape.Linear); + + // Set the Gradient Direction + shp.getFillFormat().getGradientFormat().setGradientDirection(GradientDirection.FromCorner2); + + // Add two Gradiant Stops + shp.getFillFormat().getGradientFormat().getGradientStops().add((float) 1.0, new Color(PresetColor.Purple)); + shp.getFillFormat().getGradientFormat().getGradientStops().add((float) 0, Color.RED); + + //Write the PPTX file to disk + pres.save(dataDir + "EllipseShpGrad_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:FillShapesGradient + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/FillShapesPattern.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/FillShapesPattern.java new file mode 100644 index 00000000..a4edf83a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/FillShapesPattern.java @@ -0,0 +1,53 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class FillShapesPattern +{ + public static void main(String[] args) + { + //ExStart:FillShapesPattern + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Prseetation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add autoshape of rectangle type + IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 75, 150); + + // Set the fill type to Pattern + shp.getFillFormat().setFillType(FillType.Pattern); + + // Set the pattern style + shp.getFillFormat().getPatternFormat().setPatternStyle(PatternStyle.Trellis); + + // Set the pattern back and fore colors + shp.getFillFormat().getPatternFormat().getBackColor().setColor(Color.LIGHT_GRAY); + shp.getFillFormat().getPatternFormat().getForeColor().setColor(Color.YELLOW); + + //Write the PPTX file to disk + pres.save(dataDir + "RectShpPatt_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:FillShapesPattern + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/FillShapesPicture.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/FillShapesPicture.java new file mode 100644 index 00000000..919d4ebf --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/FillShapesPicture.java @@ -0,0 +1,48 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class FillShapesPicture +{ + public static void main(String[] args) + { + //ExStart:FillShapesPicture + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + String outputDir = RunExamples.getOutPath(); + + // Instantiate PrseetationEx class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add autoshape of rectangle type + IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 75, 150); + + + // Set the fill type to Picture + shp.getFillFormat().setFillType(FillType.Picture); + + // Set the picture fill mode + shp.getFillFormat().getPictureFillFormat().setPictureFillMode(PictureFillMode.Tile); + + // Set the picture + IImage img = Images.fromFile(dataDir + "Tulips.jpg"); + IPPImage imgx = pres.getImages().addImage(img); + shp.getFillFormat().getPictureFillFormat().getPicture().setImage(imgx); + + //Write the PPTX file to disk + pres.save(outputDir + "RectShpPic_out.pptx", SaveFormat.Pptx); + //ExEnd:FillShapesPicture + } + finally + { + if (pres != null) pres.dispose(); + } + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/FillShapeswithSolidColor.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/FillShapeswithSolidColor.java new file mode 100644 index 00000000..c6694073 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/FillShapeswithSolidColor.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class FillShapeswithSolidColor +{ + public static void main(String[] args) + { + //ExStart:FillShapeswithSolidColor + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + + // Get the first slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Add autoshape of rectangle type + IShape shape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 75, 150); + + // Set the fill type to Solid + shape.getFillFormat().setFillType(FillType.Solid); + + // Set the color of the rectangle + shape.getFillFormat().getSolidFillColor().setColor(Color.YELLOW); + + //Write the PPTX file to disk + presentation.save(dataDir + "RectShpSolid_out.pptx", SaveFormat.Pptx); + //ExEnd:FillShapeswithSolidColor + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/FindShapeInSlide.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/FindShapeInSlide.java new file mode 100644 index 00000000..c5e9389b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/FindShapeInSlide.java @@ -0,0 +1,59 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.IShape; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class FindShapeInSlide +{ + //ExStart:FindShapeInSlide + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate a Presentation class that represents the presentation file + Presentation p = new Presentation(dataDir + "FindingShapeInSlide.pptx"); + try + { + + ISlide slide = p.getSlides().get_Item(0); + // Alternative text of the shape to be found + IShape shape = findShape(slide, "Shape1"); + if (shape != null) + { + System.out.println("Shape Name: " + shape.getName()); + } + } + finally + { + if (p != null) p.dispose(); + } + } + + // Method implementation to find a shape in a slide using its alternative text + public static IShape findShape(ISlide slide, String alttext) + { + // Iterating through all shapes inside the slide + for (int i = 0; i < slide.getShapes().size(); i++) + { + // If the alternative text of the slide matches with the required one then + // Return the shape + if (slide.getShapes().get_Item(i).getAlternativeText().compareTo(alttext) == 0) + return slide.getShapes().get_Item(i); + } + return null; + } + //ExEnd:FindShapeInSlide +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/FormatJoinStyles.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/FormatJoinStyles.java new file mode 100644 index 00000000..9d0ccff4 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/FormatJoinStyles.java @@ -0,0 +1,77 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class FormatJoinStyles +{ + public static void main(String[] args) + { + //ExStart:FormatJoinStyles + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Prseetation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add three autoshapes of rectangle type + IShape shp1 = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 100, 150, 75); + IShape shp2 = sld.getShapes().addAutoShape(ShapeType.Rectangle, 300, 100, 150, 75); + IShape shp3 = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 250, 150, 75); + + // Set the fill color of the rectangle shape + shp1.getFillFormat().setFillType(FillType.Solid); + shp1.getFillFormat().getSolidFillColor().setColor(Color.BLACK); + shp2.getFillFormat().setFillType(FillType.Solid); + shp2.getFillFormat().getSolidFillColor().setColor(Color.BLACK); + shp3.getFillFormat().setFillType(FillType.Solid); + shp3.getFillFormat().getSolidFillColor().setColor(Color.BLACK); + + // Set the line width + shp1.getLineFormat().setWidth(15); + shp2.getLineFormat().setWidth(15); + shp3.getLineFormat().setWidth(15); + + // Set the color of the line of rectangle + shp1.getLineFormat().getFillFormat().setFillType(FillType.Solid); + shp1.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); + shp2.getLineFormat().getFillFormat().setFillType(FillType.Solid); + shp2.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); + shp3.getLineFormat().getFillFormat().setFillType(FillType.Solid); + shp3.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); + + // Set the Join Style + shp1.getLineFormat().setJoinStyle(LineJoinStyle.Miter); + shp2.getLineFormat().setJoinStyle(LineJoinStyle.Bevel); + shp3.getLineFormat().setJoinStyle(LineJoinStyle.Round); + + // Add text to each rectangle + ((IAutoShape) shp1).getTextFrame().setText("This is Miter Join Style"); + ((IAutoShape) shp2).getTextFrame().setText("This is Bevel Join Style"); + ((IAutoShape) shp3).getTextFrame().setText("This is Round Join Style"); + + //Write the PPTX file to disk + pres.save(dataDir + "RectShpLnJoin_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:FormatJoinStyles + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/FormatLines.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/FormatLines.java new file mode 100644 index 00000000..a538407c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/FormatLines.java @@ -0,0 +1,56 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class FormatLines +{ + public static void main(String[] args) + { + //ExStart:FormatLines + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Prseetation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add autoshape of rectangle type + IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 150, 75); + + // Set the fill color of the rectangle shape + shp.getFillFormat().setFillType(FillType.Solid); + shp.getFillFormat().getSolidFillColor().setColor(Color.WHITE); + + // Apply some formatting on the line of the rectangle + shp.getLineFormat().setStyle(LineStyle.ThickThin); + shp.getLineFormat().setWidth(7); + shp.getLineFormat().setDashStyle(LineDashStyle.Dash); + + // Set the color of the line of rectangle + shp.getLineFormat().getFillFormat().setFillType(FillType.Solid); + shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); + + //Write the PPTX file to disk + pres.save(dataDir + "RectShpLn_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:FormatLines + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/FormattedEllipse.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/FormattedEllipse.java new file mode 100644 index 00000000..8948db34 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/FormattedEllipse.java @@ -0,0 +1,52 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class FormattedEllipse +{ + public static void main(String[] args) + { + //ExStart:FormattedEllipse + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Prseetation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add autoshape of ellipse type + IShape shp = sld.getShapes().addAutoShape(ShapeType.Ellipse, 50, 150, 150, 50); + + // Apply some formatting to ellipse shape + shp.getFillFormat().setFillType(FillType.Solid); + shp.getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.Chocolate)); + + // Apply some formatting to the line of Ellipse + shp.getLineFormat().getFillFormat().setFillType(FillType.Solid); + shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); + shp.getLineFormat().setWidth(5); + + //Write the PPTX file to disk + pres.save(dataDir + "EllipseShp2_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:FormattedEllipse + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/FormattedRectangle.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/FormattedRectangle.java new file mode 100644 index 00000000..af4a3f5e --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/FormattedRectangle.java @@ -0,0 +1,52 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class FormattedRectangle +{ + public static void main(String[] args) + { + //ExStart:FormattedRectangle + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Prseetation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add autoshape of rectangle type + IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 150, 50); + + // Apply some formatting to rectangle shape + shp.getFillFormat().setFillType(FillType.Solid); + shp.getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.Chocolate)); + + // Apply some formatting to the line of rectangle + shp.getLineFormat().getFillFormat().setFillType(FillType.Solid); + shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); + shp.getLineFormat().setWidth(5); + + //Write the PPTX file to disk + pres.save(dataDir + "RectShp2_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:FormattedRectangle + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/GeometryShapeAddSegment.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/GeometryShapeAddSegment.java new file mode 100644 index 00000000..c940cf97 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/GeometryShapeAddSegment.java @@ -0,0 +1,42 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class GeometryShapeAddSegment { + + public static void main(String[] args) throws Exception + { + //ExStart:GeometryShapeAddSegment + + // Output file name + String resultPath = RunExamples.getOutPath() + "GeometryShapeAddSegment.pptx"; + + Presentation pres = new Presentation(); + try + { + // Create new shape + GeometryShape shape = (GeometryShape)pres.getSlides().get_Item(0). + getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 200, 100); + // Get geometry path of the shape + IGeometryPath geometryPath = shape.getGeometryPaths()[0]; + + // Add two lines to geometry path + geometryPath.lineTo(100, 50, 1); + geometryPath.lineTo(100, 50, 4); + + // Assign edited geometry path to the shape + shape.setGeometryPath(geometryPath); + + // Save the presentation + pres.save(resultPath, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:GeometryShapeAddSegment + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/GeometryShapeCompositeObjects.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/GeometryShapeCompositeObjects.java new file mode 100644 index 00000000..c7ab8a2a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/GeometryShapeCompositeObjects.java @@ -0,0 +1,52 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class GeometryShapeCompositeObjects { + + public static void main(String[] args) throws Exception + { + //ExStart:GeometryShapeCompositeObjects + + // Output file name + String resultPath = RunExamples.getOutPath() + "GeometryShapeCompositeObjects.pptx"; + + Presentation pres = new Presentation(); + try + { + // Create new shape + GeometryShape shape = (GeometryShape)pres.getSlides().get_Item(0). + getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 200, 100); + + // Create first geometry path + GeometryPath geometryPath0 = new GeometryPath(); + geometryPath0.moveTo(0, 0); + geometryPath0.lineTo(shape.getWidth(), 0); + geometryPath0.lineTo(shape.getWidth(), shape.getHeight() / 3); + geometryPath0.lineTo(0, shape.getHeight() / 3); + geometryPath0.closeFigure(); + + // Create second geometry path + GeometryPath geometryPath1 = new GeometryPath(); + geometryPath1.moveTo(0, shape.getHeight() / 3 * 2); + geometryPath1.lineTo(shape.getWidth(), shape.getHeight() / 3 * 2); + geometryPath1.lineTo(shape.getWidth(), shape.getHeight()); + geometryPath1.lineTo(0, shape.getHeight()); + geometryPath1.closeFigure(); + + // Set shape geometry as composition of two geometry path + shape.setGeometryPaths(new GeometryPath[] { geometryPath0, geometryPath1 }); + + // Save the presentation + pres.save(resultPath, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:GeometryShapeCompositeObjects + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/GeometryShapeCreatesCustomGeometry.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/GeometryShapeCreatesCustomGeometry.java new file mode 100644 index 00000000..8c0047a6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/GeometryShapeCreatesCustomGeometry.java @@ -0,0 +1,82 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; +import java.awt.geom.Point2D; +import java.util.ArrayList; +import java.util.List; + +public class GeometryShapeCreatesCustomGeometry { + + public static void main(String[] args) throws Exception + { + //ExStart:GeometryShapeCreatesCustomGeometry + + // Output file name + String resultPath = RunExamples.getOutPath() + "GeometryShapeCreatesCustomGeometry.pptx"; + + float R = 100, r = 50; // Outer and inner star radius + + // Create star geometry path + GeometryPath starPath = createStarGeometry(R, r); + + Presentation pres = new Presentation(); + try + { + // Create new shape + GeometryShape shape = (GeometryShape)pres.getSlides().get_Item(0). + getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, R * 2, R * 2); + + // Set new geometry path to the shape + shape.setGeometryPath(starPath); + + // Save the presentation + pres.save(resultPath, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:GeometryShapeCreatesCustomGeometry + + } + + /// + /// Creates star geometry path. + /// + /// Outet radius of a star figure. + /// inner radius of a star figure. + /// Geometry Path + private static GeometryPath createStarGeometry(float outerRadius, float innerRadiusr) + { + GeometryPath starPath = new GeometryPath(); + List points = new ArrayList(); + + int step = 72; + + for (int angle = -90; angle < 270; angle += step) + { + double radians = angle * (Math.PI / 180f); + double x = outerRadius * Math.cos(radians); + double y = outerRadius * Math.sin(radians); + points.add(new Point2D.Float((float)x + outerRadius, (float)y + outerRadius)); + + radians = Math.PI * (angle + step / 2) / 180.0; + x = innerRadiusr * Math.cos(radians); + y = innerRadiusr * Math.sin(radians); + points.add(new Point2D.Float((float)x + outerRadius, (float)y + outerRadius)); + } + + starPath.moveTo(points.get(0)); + + for (int i = 1; i < points.size(); i++) + { + starPath.lineTo(points.get(i)); + } + + starPath.closeFigure(); + + return starPath; + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/GeometryShapeRemoveSegment.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/GeometryShapeRemoveSegment.java new file mode 100644 index 00000000..5c1b6d34 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/GeometryShapeRemoveSegment.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class GeometryShapeRemoveSegment { + + public static void main(String[] args) throws Exception { + //ExStart:GeometryShapeAddSegment + + // Output file name + String resultPath = RunExamples.getOutPath() + "GeometryShapeRemoveSegment.pptx"; + + Presentation pres = new Presentation(); + try + { + // Create new shape + GeometryShape shape = (GeometryShape)pres.getSlides().get_Item(0). + getShapes().addAutoShape(ShapeType.Heart, 100, 100, 300, 300); + + // Get geometry path of the shape + IGeometryPath path = shape.getGeometryPaths()[0]; + + // remove segment + path.removeAt(2); + + // set new geometry path + shape.setGeometryPath(path); + + // Save the presentation + pres.save(resultPath, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:GeometryShapeAddSegment + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/GetCameraEffectiveData.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/GetCameraEffectiveData.java new file mode 100644 index 00000000..8774c398 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/GetCameraEffectiveData.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.IThreeDFormatEffectiveData; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class GetCameraEffectiveData +{ + public static void main(String[] args) + { + + //ExStart:GetCameraEffectiveData + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + Presentation pres = new Presentation(dataDir + "Presentation1.pptx"); + try + { + IThreeDFormatEffectiveData threeDEffectiveData = pres.getSlides().get_Item(0).getShapes().get_Item(0).getThreeDFormat().getEffective(); + + System.out.println("= Effective camera properties ="); + System.out.println("Type: " + threeDEffectiveData.getCamera().getCameraType()); + System.out.println("Field of view: " + threeDEffectiveData.getCamera().getFieldOfViewAngle()); + System.out.println("Zoom: " + threeDEffectiveData.getCamera().getZoom()); + + + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:GetCameraEffectiveData + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/GetLightRigEffectiveData.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/GetLightRigEffectiveData.java new file mode 100644 index 00000000..272e7691 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/GetLightRigEffectiveData.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.IThreeDFormatEffectiveData; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class GetLightRigEffectiveData +{ + public static void main(String[] args) + { + + //ExStart:GetLightRigEffectiveData + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + Presentation pres = new Presentation(dataDir + "Presentation1.pptx"); + try + { + IThreeDFormatEffectiveData threeDEffectiveData = pres.getSlides().get_Item(0).getShapes().get_Item(0).getThreeDFormat().getEffective(); + + System.out.println("= Effective light rig properties ="); + System.out.println("Type: " + threeDEffectiveData.getLightRig().getLightType()); + System.out.println("Direction: " + threeDEffectiveData.getLightRig().getDirection()); + + + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:GetLightRigEffectiveData + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/GetShapeBevelEffectiveData.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/GetShapeBevelEffectiveData.java new file mode 100644 index 00000000..cb216271 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/GetShapeBevelEffectiveData.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.IThreeDFormatEffectiveData; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class GetShapeBevelEffectiveData +{ + public static void main(String[] args) + { + + //ExStart:GetShapeBevelEffectiveData + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + Presentation pres = new Presentation(dataDir + "Presentation1.pptx"); + try + { + IThreeDFormatEffectiveData threeDEffectiveData = pres.getSlides().get_Item(0).getShapes().get_Item(0).getThreeDFormat().getEffective(); + + System.out.println("= Effective shape's top face relief properties ="); + System.out.println("Type: " + threeDEffectiveData.getBevelTop().getBevelType()); + System.out.println("Width: " + threeDEffectiveData.getBevelTop().getWidth()); + System.out.println("Height: " + threeDEffectiveData.getBevelTop().getHeight()); + + + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:GetShapeBevelEffectiveData + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/Hidingshapes.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/Hidingshapes.java new file mode 100644 index 00000000..08d33087 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/Hidingshapes.java @@ -0,0 +1,42 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class Hidingshapes +{ + public static void main(String[] args) + { + //ExStart:Hidingshapes + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Instantiate Presentation class that represents the PPTX + Presentation pres = new Presentation(); + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add autoshape of rectangle type + IShape shp1 = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 40, 150, 50); + IShape shp2 = sld.getShapes().addAutoShape(ShapeType.Moon, 160, 40, 150, 50); + String alttext = "User Defined"; + int iCount = sld.getShapes().size(); + for (int i = 0; i < iCount; i++) + { + AutoShape ashp = (AutoShape) sld.getShapes().get_Item(i); + if (ashp.getAlternativeText().equals(alttext)) + { + ashp.setHidden(true); + } + } + + // Save presentation to disk + pres.save(dataDir + "Hiding_Shapes_out.pptx", SaveFormat.Pptx); + //ExEnd:Hidingshapes + } +} + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/ImageAsEMF.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/ImageAsEMF.java new file mode 100644 index 00000000..30f68630 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/ImageAsEMF.java @@ -0,0 +1,48 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.cells.*; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.nio.file.Files; +import java.nio.file.Paths; + + +public class ImageAsEMF +{ + public static void main(String[] args) throws Exception + { + String dataDir = RunExamples.getDataDir_Shapes(); + //ExStart:ImageAsEMF + Workbook book = new Workbook(dataDir + "chart.xlsx"); + Worksheet sheet = book.getWorksheets().get(0); + ImageOrPrintOptions options = new ImageOrPrintOptions(); + options.setHorizontalResolution(200); + options.setVerticalResolution(200); + options.setImageType(ImageType.EMF); + + //Save the workbook to stream + SheetRender sr = new SheetRender(sheet, options); + Presentation pres = new Presentation(); + pres.getSlides().removeAt(0); + + String EmfSheetName = ""; + for (int j = 0; j < sr.getPageCount(); j++) + { + + EmfSheetName = dataDir + "test" + sheet.getName() + " Page" + (j + 1) + ".out.emf"; + sr.toImage(j, EmfSheetName); + + byte[] bytes = Files.readAllBytes(Paths.get(EmfSheetName)); + IPPImage emfImage = pres.getImages().addImage(bytes); + ISlide slide = pres.getSlides().addEmptySlide(pres.getLayoutSlides().getByType(SlideLayoutType.Blank)); + IShape m = slide.getShapes().addPictureFrame(ShapeType.Rectangle, 0, 0, (float) pres.getSlideSize().getSize().getWidth(), (float) pres.getSlideSize().getSize().getHeight(), emfImage); + } + + pres.save(dataDir + "Saved.pptx", SaveFormat.Pptx); + + //ExEnd:ImageAsEMF + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/InkEffectsExample.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/InkEffectsExample.java new file mode 100644 index 00000000..503750a5 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/InkEffectsExample.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class InkEffectsExample +{ + public static void main(String[] args) + { + // The path to the documents directory + String dataDir = RunExamples.getDataDir_Shapes(); + + // The path to output file + String outFilePath = RunExamples.getOutPath() + "InkEffects.png"; + + //ExStart:InkEffectsExample + Presentation pres = new Presentation(dataDir + "InkEffects.pptx"); + try { + // Get Ink object + Ink ink = (Ink) pres.getSlides().get_Item(0).getShapes().get_Item(0); + IInkBrush brush = ink.getTraces()[0].getBrush(); + + // Show InkEffects of the brush + System.out.println("InkEffects = " + InkEffectType.getName(InkEffectType.class, brush.getInkEffect())); + + // Set image for InkEffects + IImage image = Images.fromFile(dataDir + "Effect.png"); + Ink.getInkEffectImages().addItem(brush.getInkEffect(), image); + + // Save result + pres.getSlides().get_Item(0).getImage(2f, 2f).save(outFilePath, ImageFormat.Png); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:InkEffectsExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/InkManagementExample.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/InkManagementExample.java new file mode 100644 index 00000000..0069add3 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/InkManagementExample.java @@ -0,0 +1,43 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.IInk; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; +import java.awt.*; + +public class InkManagementExample +{ + //ExStart:InkManagementExample + public static void main(String[] args) + { + // Path to source presentation + String presentationName = RunExamples.getDataDir_Shapes() + "SimpleInk.pptx"; + // Path to output document + String outFilePath = RunExamples.getOutPath() + "SimpleInk_out.pptx"; + + Presentation presentation = new Presentation(presentationName); + try { + // Get Ink shape + IInk inkShape = (IInk)presentation.getSlides().get_Item(0).getShapes().get_Item(0); + + if (inkShape != null) + { + System.out.println("Width of the Ink shape = " + inkShape.getWidth()); + System.out.println("Height of the Ink shape = " + inkShape.getHeight()); + System.out.println("Brush height of the trace = " + inkShape.getTraces()[0].getBrush().getSize().getWidth()); + System.out.println("Brush color of the trace = " + inkShape.getTraces()[0].getBrush().getColor()); + + // Change color and size of the brush + inkShape.getTraces()[0].getBrush().setColor(Color.RED); + inkShape.getTraces()[0].getBrush().setSize(new Dimension(10, 5)); + } + + // Save presentation + presentation.save(outFilePath, SaveFormat.Pptx); + } finally { + if (presentation != null) presentation.dispose(); + } + } + //ExEnd:InkManagementExample +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/InterlopShapeID.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/InterlopShapeID.java new file mode 100644 index 00000000..e384fed9 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/InterlopShapeID.java @@ -0,0 +1,30 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class InterlopShapeID +{ + //ExStart:InterlopShapeID + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + Presentation presentation = new Presentation("Presentation.pptx"); + try + { + // Getting unique shape identifier in slide scope + long officeInteropShapeId = presentation.getSlides().get_Item(0).getShapes().get_Item(0).getOfficeInteropShapeId(); + + + } + finally + { + if (presentation != null) presentation.dispose(); + } + } + //ExEnd:InterlopShapeID +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/IsTextShape.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/IsTextShape.java new file mode 100644 index 00000000..263b9daf --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/IsTextShape.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2009-2022. Aspose Pty Ltd. All Rights Reserved. + */ + +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class IsTextShape +{ + public static void main(String[] args) + { + //ExStart:IsTextShape + String presentationPath = RunExamples.getDataDir_Shapes() + "CheckTextShapes.pptx"; + + Presentation pres = new Presentation(presentationPath); + try { + for (IShape shape : pres.getSlides().get_Item(0).getShapes()) + { + if (shape instanceof AutoShape) + { + AutoShape autoShape = (AutoShape)shape; + System.out.println(autoShape.isTextBox() ? "shape is text box" : "shape is not text box"); + } + } + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:IsTextShape + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/MathPhantomExample.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/MathPhantomExample.java new file mode 100644 index 00000000..629d61dd --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/MathPhantomExample.java @@ -0,0 +1,71 @@ +package com.aspose.slides.examples.shapes; + + +import com.aspose.slides.Collections.Generic.List; +import com.aspose.slides.IAutoShape; +import com.aspose.slides.IMathBlock; +import com.aspose.slides.IMathElement; +import com.aspose.slides.IMathParagraph; +import com.aspose.slides.MathArray; +import com.aspose.slides.MathDelimiter; +import com.aspose.slides.MathFraction; +import com.aspose.slides.MathPhantom; +import com.aspose.slides.MathPortion; +import com.aspose.slides.MathematicalText; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +/* +The example shows how to use the MathPhantom that represent a phantom math object (). +Phantom math object affects the layout of its child element without necessarily displaying it. +A phantom can hide its base expression while preserving its width, height, or depth - useful for aligning formulas +or reserving space. Visibility and geometry behavior are controlled by properties such as Show, ZeroWid, ZeroAsc, ZeroDesc, +nd Transp. +*/ +public class MathPhantomExample +{ + public static void main(String[] args) + { + //Path for output presentation + String outPptxFile = RunExamples.getOutPath() + "MathPhantom_out.pptx"; + + //ExStart:MathPhantomExample + Presentation pres = new Presentation(); + try { + IAutoShape autoShape = pres.getSlides().get_Item(0).getShapes().addMathShape(0, 0, 500, 50); + IMathParagraph mathParagraph = + ((MathPortion)autoShape.getTextFrame().getParagraphs().get_Item(0) + .getPortions().get_Item(0)).getMathParagraph(); + + MathematicalText eq1 = new MathematicalText("eq1"); + MathematicalText eq2 = new MathematicalText("eq2"); + // Create phantom math object + MathPhantom phant = new MathPhantom(new MathFraction( + new MathematicalText("1"), new MathematicalText("2"))); + phant.setShow(false); + phant.setZeroAsc(true); + MathematicalText first = new MathematicalText(" (1)"); + MathematicalText sect = new MathematicalText(" (2)"); + IMathBlock second = new MathematicalText().join(phant).join(sect); + List list1 = new List(); + list1.add(first); + list1.add(second); + MathArray nums = new MathArray(list1); + List list2 = new List(); + list2.add(eq1); + list2.add(eq2); + MathDelimiter eqs = new MathDelimiter(new MathArray(list2)); + eqs.setBeginningCharacter('{'); + eqs.setEndingCharacter('\0'); + IMathBlock wholeBlock = new MathematicalText().join(eqs).join(" ").join(nums); + mathParagraph.add(wholeBlock); + + pres.save(outPptxFile, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:MathPhantomExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/MathShape_GetChildren.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/MathShape_GetChildren.java new file mode 100644 index 00000000..cc5030d8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/MathShape_GetChildren.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2009-2021. Aspose Pty Ltd. All Rights Reserved. + */ + +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class MathShape_GetChildren +{ + //ExStart:MathShape_GetChildren + public static void main(String[] args) + { + //Path for output presentation + String outPptxFile = RunExamples.getOutPath() + "MathShape_GetChildren_out.pptx"; + + Presentation pres = new Presentation(); + try + { + // Get first slide + ISlide slide = pres.getSlides().get_Item(0); + + // Create MathShape in the first slide + IAutoShape mathShape = slide.getShapes().addMathShape(10, 10, 500, 500); + // Create MathParagraph + IMathParagraph mathParagraph = ((MathPortion)mathShape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); + + // Create MathBlock + IMathBlock mathBlock = new MathBlock(new MathematicalText("F").join("+").join(new MathematicalText("1").divide("y")).underbar()); + + // Add MathBlock to the MathParagraph + mathParagraph.add(mathBlock); + + // Print all elements of the mathBlock + forEachMathElement(mathBlock); + + pres.save(outPptxFile, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + } + + private static void forEachMathElement(IMathElement root) + { + for (IMathElement child : root.getChildren()) + { + System.out.println(child.getClass().getCanonicalName() + (child instanceof MathematicalText ? " : " +((MathematicalText)child).getValue() : "")); + + //recursive + forEachMathElement(child); + } + } + //ExEnd:MathShape_GetChildren +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/MathematicalShape.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/MathematicalShape.java new file mode 100644 index 00000000..6d154035 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/MathematicalShape.java @@ -0,0 +1,46 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class MathematicalShape +{ + public static void main(String[] args) + { + //Path for output presentation + String outPptxFile = RunExamples.getOutPath() + "MathematicalShape_out.pptx"; + + //ExStart:MathematicalShape + Presentation pres = new Presentation(); + try + { + // Create a new AutoShape of the type Rectangle to host mathematical content inside and adds it to the end of the collection. + IAutoShape mathShape = pres.getSlides().get_Item(0).getShapes().addMathShape(10, 10, 100, 25); + + // Cteate mathematical paragraph that is a container for mathematical blocks. + IMathParagraph mathParagraph = ((MathPortion) mathShape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)).getMathParagraph(); + + // Create mathematical expression as an instance of mathematical text that contained within a MathParagraph. + IMathBlock mathBlock = new MathematicalText("c") + .setSuperscript("2") + .join("=") + .join(new MathematicalText("a") + .setSuperscript("2")) + .join("+") + .join(new MathematicalText("b") + .setSuperscript("2")); + + // Add mathematical expression to the mathematical paragraph. + mathParagraph.add(mathBlock); + + pres.save(outPptxFile, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:MathematicalShape + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/PictureFrameFormatting.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/PictureFrameFormatting.java new file mode 100644 index 00000000..ffb4253f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/PictureFrameFormatting.java @@ -0,0 +1,48 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class PictureFrameFormatting +{ + public static void main(String[] args) + { + //ExStart:PictureFrameFormatting + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + String outputDir = RunExamples.getOutPath(); + + // Instantiate Presentation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Instantiate the ImageEx class + IImage img = Images.fromFile(dataDir + "aspose-logo.jpg"); + IPPImage imgx = pres.getImages().addImage(img); + + // Add Picture Frame with height and width equivalent of Picture + IPictureFrame pf = sld.getShapes().addPictureFrame(ShapeType.Rectangle, 50, 150, imgx.getWidth(), imgx.getHeight(), imgx); + + // Apply some formatting to PictureFrameEx + pf.getLineFormat().getFillFormat().setFillType(FillType.Solid); + pf.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); + pf.getLineFormat().setWidth(20); + pf.setRotation(45); + + //Write the PPTX file to disk + pres.save(outputDir + "RectPicFrameFormat_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:PictureFrameFormatting + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/PictureFrameIsCameoExample.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/PictureFrameIsCameoExample.java new file mode 100644 index 00000000..8e4cbd5b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/PictureFrameIsCameoExample.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.PictureFrame; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class PictureFrameIsCameoExample +{ + public static void main(String[] args) + { + // Path to source presentation + String presentationName = RunExamples.getDataDir_Shapes() + "PresCameo.pptx"; + + //ExStart:PictureFrameIsCameoExample + Presentation pres = new Presentation(presentationName); + try { + // Check if first picture frame is Cameo + PictureFrame shape = (PictureFrame) pres.getSlides().get_Item(0).getShapes().get_Item(0); + if (shape != null) + { + System.out.println("First picture is Cameo: " + shape.isCameo()); + } + + // Check if third picture frame is Cameo + shape = (PictureFrame) pres.getSlides().get_Item(0).getShapes().get_Item(2); + if (shape != null) + { + System.out.println("Third picture is Cameo: " + shape.isCameo()); + } + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:PictureFrameIsCameoExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/RemoveShape.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/RemoveShape.java new file mode 100644 index 00000000..4e20e9bf --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/RemoveShape.java @@ -0,0 +1,48 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class RemoveShape +{ + public static void main(String[] args) + { + //ExStart:RemoveShape + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create Presentation object + Presentation pres = new Presentation(); + try + { + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add autoshape of rectangle type + IShape shp1 = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 40, 150, 50); + IShape shp2 = sld.getShapes().addAutoShape(ShapeType.Moon, 160, 40, 150, 50); + String alttext = "User Defined"; + int iCount = sld.getShapes().size(); + for (int i = 0; i < iCount; i++) + { + AutoShape ashp = (AutoShape) sld.getShapes().get_Item(0); + if (ashp.getAlternativeText().equals(alttext)) + { + sld.getShapes().remove(ashp); + } + } + + // Save presentation to disk + pres.save(dataDir + "RemoveShape_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:RemoveShape + } +} + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/RotatingShapes.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/RotatingShapes.java new file mode 100644 index 00000000..905d6545 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/RotatingShapes.java @@ -0,0 +1,45 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class RotatingShapes +{ + public static void main(String[] args) + { + //ExStart:RotatingShapes + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate PrseetationEx class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add autoshape of rectangle type + IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 75, 150); + + // Rotate the shape to 90 degree + shp.setRotation(90); + + // Write the PPTX file to disk + pres.save(dataDir + "RectShpRot_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:RotatingShapes + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/SetAlternativeText.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/SetAlternativeText.java new file mode 100644 index 00000000..3efe61fb --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/SetAlternativeText.java @@ -0,0 +1,46 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class SetAlternativeText +{ + public static void main(String[] args) + { + //ExStart:SetAlternativeText + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Instantiate Presentation class that represents the PPTX + Presentation pres = new Presentation(); + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add autoshape of rectangle type + IShape shp1 = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 40, 150, 50); + IShape shp2 = sld.getShapes().addAutoShape(ShapeType.Moon, 160, 40, 150, 50); + shp2.getFillFormat().setFillType(FillType.Solid); + shp2.getFillFormat().getSolidFillColor().setColor(Color.GRAY); + + for (int i = 0; i < sld.getShapes().size(); i++) + { + AutoShape shape = (AutoShape) sld.getShapes().get_Item(i); + if (shape != null) + { + AutoShape ashp = shape; + ashp.setAlternativeText("User Defined"); + } + } + + // Save presentation to disk + pres.save(dataDir + "Set_AlternativeText_out.pptx", SaveFormat.Pptx); + //ExEnd:SetAlternativeText + } +} + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/SetFileTypeForAnEmbeddingObject.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/SetFileTypeForAnEmbeddingObject.java new file mode 100644 index 00000000..a84ac313 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/SetFileTypeForAnEmbeddingObject.java @@ -0,0 +1,46 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + + +public class SetFileTypeForAnEmbeddingObject +{ + public static void main(String[] args) throws IOException + { + + //ExStart:SetFileTypeForAnEmbeddingObject + + Presentation pres = new Presentation(); + try + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Add known Ole objects + byte[] fileBytes = Files.readAllBytes(Paths.get(dataDir + "test.zip")); + + // Create Ole embedded file info + IOleEmbeddedDataInfo dataInfo = new OleEmbeddedDataInfo(fileBytes, "zip"); + + // Create OLE object + IOleObjectFrame oleFrame = pres.getSlides().get_Item(0).getShapes().addOleObjectFrame(150, 20, 50, 50, dataInfo); + oleFrame.setObjectIcon(true); + + + pres.save(dataDir + "SetFileTypeForAnEmbeddingObject.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:SetFileTypeForAnEmbeddingObject + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/SetVideoTrimFromEnd.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/SetVideoTrimFromEnd.java new file mode 100644 index 00000000..58eb2b81 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/SetVideoTrimFromEnd.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class SetVideoTrimFromEnd +{ + public static void main(String[] args) + { + // Path to source presentation + String videoFileName = RunExamples.getDataDir_Shapes() + "Wildlife.mp4"; + + Presentation pres = new Presentation(); + try { + ISlide slide = pres.getSlides().get_Item(0); + IVideo video = pres.getVideos().addVideo(Files.readAllBytes(Paths.get(videoFileName))); + IVideoFrame videoFrame = slide.getShapes().addVideoFrame(0, 0, 200, 200, video); + + // sets the trimming start time to 12sec + videoFrame.setTrimFromStart(12000f); + + // sets the triming end time to 16sec + videoFrame.setTrimFromEnd(14000f); + + // Save presentation + pres.save(RunExamples.getOutPath() + "VideoTrimming-out.pptx", SaveFormat.Pptx); + } catch(IOException e) { + } finally { + if (pres != null) pres.dispose(); + } + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/ShapeIsDecorativePropertyExample.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/ShapeIsDecorativePropertyExample.java new file mode 100644 index 00000000..a7ca3404 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/ShapeIsDecorativePropertyExample.java @@ -0,0 +1,32 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.IShape; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.ShapeType; +import com.aspose.slides.examples.RunExamples; + +public class ShapeIsDecorativePropertyExample +{ + public static void main(String[] args) + { + // Path to output document + String outFilePath = RunExamples.getOutPath() + "DecorativeDemo.pptx"; + + //ExStart:ShapeIsDecorativePropertyExample + Presentation pres = new Presentation(); + try { + // Create new shape + IShape shape1 = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 10, 10, 100, 100); + + // Set shape as “decorative” object + shape1.setDecorative(true); + + // Save result + pres.save(outFilePath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ShapeIsDecorativePropertyExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/ShapesAlignment.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/ShapesAlignment.java new file mode 100644 index 00000000..9b8f4058 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/ShapesAlignment.java @@ -0,0 +1,54 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class ShapesAlignment +{ + public static void main(String[] args) + { + //Path for output presentation + String outpptxFile = RunExamples.getOutPath() + "ShapesAlignment_out.pptx"; + + Presentation pres = new Presentation(); + try + { + ISlide slide = pres.getSlides().get_Item(0); + // Create some shapes + slide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 100, 100); + slide.getShapes().addAutoShape(ShapeType.Rectangle, 200, 200, 100, 100); + slide.getShapes().addAutoShape(ShapeType.Rectangle, 300, 300, 100, 100); + // Aligning all shapes within IBaseSlide. + SlideUtil.alignShapes(ShapesAlignmentType.AlignBottom, true, pres.getSlides().get_Item(0)); + + slide = pres.getSlides().addEmptySlide(slide.getLayoutSlide()); + // Add group shape + IGroupShape groupShape = slide.getShapes().addGroupShape(); + // Create some shapes to the group shape + groupShape.getShapes().addAutoShape(ShapeType.Rectangle, 350, 50, 50, 50); + groupShape.getShapes().addAutoShape(ShapeType.Rectangle, 450, 150, 50, 50); + groupShape.getShapes().addAutoShape(ShapeType.Rectangle, 550, 250, 50, 50); + groupShape.getShapes().addAutoShape(ShapeType.Rectangle, 650, 350, 50, 50); + // Aligning all shapes within IGroupShape. + SlideUtil.alignShapes(ShapesAlignmentType.AlignLeft, false, groupShape); + + slide = pres.getSlides().addEmptySlide(slide.getLayoutSlide()); + // Add group shape + groupShape = slide.getShapes().addGroupShape(); + // Create some shapes to the group shape + groupShape.getShapes().addAutoShape(ShapeType.Rectangle, 350, 50, 50, 50); + groupShape.getShapes().addAutoShape(ShapeType.Rectangle, 450, 150, 50, 50); + groupShape.getShapes().addAutoShape(ShapeType.Rectangle, 550, 250, 50, 50); + groupShape.getShapes().addAutoShape(ShapeType.Rectangle, 650, 350, 50, 50); + // Aligning shapes with specified indexes within IGroupShape. + SlideUtil.alignShapes(ShapesAlignmentType.AlignLeft, false, groupShape, new int[] { 0, 2 }); + + // Save presentation + pres.save(outpptxFile, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + } +} \ No newline at end of file diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/SimpleEllipse.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/SimpleEllipse.java new file mode 100644 index 00000000..afefd48f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/SimpleEllipse.java @@ -0,0 +1,45 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.ShapeType; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class SimpleEllipse +{ + public static void main(String[] args) + { + //ExStart:SimpleEllipse + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Prseetation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add autoshape of ellipse type + sld.getShapes().addAutoShape(ShapeType.Ellipse, 50, 150, 150, 50); + + //Write the PPTX file to disk + pres.save(dataDir + "EllipseShp1_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SimpleEllipse + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/SimpleRectangle.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/SimpleRectangle.java new file mode 100644 index 00000000..5c98b5dd --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/SimpleRectangle.java @@ -0,0 +1,45 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.ShapeType; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class SimpleRectangle +{ + public static void main(String[] args) + { + //ExStart:SimpleRectangle + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Prseetation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add autoshape of rectangle type + sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 150, 50); + + //Write the PPTX file to disk + pres.save(dataDir + "RectShp1_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SimpleRectangle + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/SketchedShapes.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/SketchedShapes.java new file mode 100644 index 00000000..c1186310 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/SketchedShapes.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.shapes; + + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SketchedShapes { + + public static void main(String[] args) + { + //ExStart:SketchedShapes + //Path for output presentation + String outPptxFile = RunExamples.getOutPath() + "SketchedShapes_out.pptx"; + String outPngFile = RunExamples.getOutPath() + "SketchedShapes_out.png"; + + Presentation pres = new Presentation(); + try + { + + IAutoShape shape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 20, 20, 300, 150); + shape.getFillFormat().setFillType(FillType.NoFill); + + // Transform shape to sketch of a freehand style + shape.getLineFormat().getSketchFormat().setSketchType(LineSketchType.Scribble); + + pres.getSlides().get_Item(0).getImage(4/3f, 4/3f).save(outPngFile, ImageFormat.Png); + pres.save(outPptxFile, SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SketchedShapes + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/StretchOffsetLeftForPictureFrame.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/StretchOffsetLeftForPictureFrame.java new file mode 100644 index 00000000..d7cc47a8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/StretchOffsetLeftForPictureFrame.java @@ -0,0 +1,57 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class StretchOffsetLeftForPictureFrame +{ + public static void main(String[] args) + { + //ExStart:StretchOffsetLeftForPictureFrame + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + String outputDir = RunExamples.getOutPath(); + + // Instantiate Prseetation class that represents the PPTX + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide slide = pres.getSlides().get_Item(0); + + // Instantiate the ImageEx class + IImage img = Images.fromFile(dataDir + "aspose-logo.jpg"); + IPPImage imgEx = pres.getImages().addImage(img); + + // Add an AutoShape of Rectangle type + IAutoShape aShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 300, 300); + + // Set shape's fill type + aShape.getFillFormat().setFillType(FillType.Picture); + + // Set shape's picture fill mode + aShape.getFillFormat().getPictureFillFormat().setPictureFillMode(PictureFillMode.Stretch); + + // Set image to fill the shape + aShape.getFillFormat().getPictureFillFormat().getPicture().setImage(imgEx); + + // Specify image offsets from the corresponding edge of the shape's bounding box + aShape.getFillFormat().getPictureFillFormat().setStretchOffsetLeft(25); + aShape.getFillFormat().getPictureFillFormat().setStretchOffsetRight(25); + aShape.getFillFormat().getPictureFillFormat().setStretchOffsetTop(-20); + aShape.getFillFormat().getPictureFillFormat().setStretchOffsetBottom(-10); + + + //Write the PPTX file to disk + pres.save(outputDir + "StretchOffsetLeftForPictureFrame_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:StretchOffsetLeftForPictureFrame + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/SubstitutePictureTitleOfOLEObjectFrame.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/SubstitutePictureTitleOfOLEObjectFrame.java new file mode 100644 index 00000000..3330431b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/SubstitutePictureTitleOfOLEObjectFrame.java @@ -0,0 +1,49 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + + +public class SubstitutePictureTitleOfOLEObjectFrame +{ + public static void main(String[] args) throws IOException + { + + //ExStart:SubstitutePictureTitleOfOLEObjectFrame + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + String oleSourceFile = dataDir + "ExcelObject.xlsx"; + String oleIconFile = dataDir + "Image.png"; + + Presentation pres = new Presentation(); + try + { + ISlide slide = pres.getSlides().get_Item(0); + + // Add Ole objects + byte[] allbytes = Files.readAllBytes(Paths.get(dataDir + "book1.xlsx")); + IOleEmbeddedDataInfo dataInfo = new OleEmbeddedDataInfo(allbytes, "xlsx"); + IOleObjectFrame oof = slide.getShapes().addOleObjectFrame(20, 20, 50, 50, dataInfo); + oof.setObjectIcon(true); + + // Add image object + byte[] imgBuf = Files.readAllBytes(Paths.get(dataDir + "aspose-logo.jpg")); + IPPImage image = pres.getImages().addImage(imgBuf); + + oof.getSubstitutePictureFormat().getPicture().setImage(image); + + // Set caption to OLE icon + oof.setSubstitutePictureTitle("Caption example"); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SubstitutePictureTitleOfOLEObjectFrame + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/shapes/TilePictureFillFormatExample.java b/Examples/src/main/java/com/aspose/slides/examples/shapes/TilePictureFillFormatExample.java new file mode 100644 index 00000000..0f0917e3 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/shapes/TilePictureFillFormatExample.java @@ -0,0 +1,53 @@ +package com.aspose.slides.examples.shapes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class TilePictureFillFormatExample +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Shapes(); + + // The path to output file + String outFilePath = RunExamples.getOutPath() + "ImageTileExample.pptx"; + + //ExStart:TilePictureFillFormatExample + Presentation pres = new Presentation(); + try { + ISlide firstSlide = pres.getSlides().get_Item(0); + + IPPImage ppImage; + + IImage newImage = Images.fromFile(dataDir + "image.png"); + ppImage = pres.getImages().addImage(newImage); + newImage.dispose(); + + // Adds the new Rectangle shape + IAutoShape newShape = firstSlide.getShapes().addAutoShape(ShapeType.Rectangle, 0, 0, 350, 350); + + // Sets the fill type of the new shape to Picture + newShape.getFillFormat().setFillType(FillType.Picture); + + // Sets the shape's fill image + IPictureFillFormat pictureFillFormat = newShape.getFillFormat().getPictureFillFormat(); + pictureFillFormat.getPicture().setImage(ppImage); + + // Sets the picture fill mode to Tile and changes the properties + pictureFillFormat.setPictureFillMode(PictureFillMode.Tile); + pictureFillFormat.setTileOffsetX(-275); + pictureFillFormat.setTileOffsetY(-247); + pictureFillFormat.setTileScaleX(120); + pictureFillFormat.setTileScaleY(120); + pictureFillFormat.setTileAlignment(RectangleAlignment.BottomRight); + pictureFillFormat.setTileFlip(TileFlip.FlipBoth); + + pres.save(outFilePath, SaveFormat.Pptx); + } finally { + if (pres != null) + pres.dispose(); + } + //ExEnd:TilePictureFillFormatExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/ISectionCollection.java b/Examples/src/main/java/com/aspose/slides/examples/slides/ISectionCollection.java new file mode 100644 index 00000000..137e52f0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/ISectionCollection.java @@ -0,0 +1,29 @@ +package com.aspose.slides.examples.slides; + +import com.aspose.slides.ISection; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ISectionCollection +{ + public static void main(String[] args) + { + //ExStart:ISectionCollection + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + Presentation pres = new Presentation(dataDir + "Presentation1.pptx"); + ISection section = pres.getSections().get_Item(2); + pres.getSections().reorderSectionWithSlides(section, 0); + pres.getSections().removeSectionWithSlides(pres.getSections().get_Item(0)); + pres.getSections().appendEmptySection("Last empty section"); + pres.getSections().addSection("First empty", pres.getSlides().get_Item(0)); + pres.getSections().get_Item(0).setName("New section name"); + pres.save(dataDir + "resultsection1.pptx", SaveFormat.Pptx); + } + + //ExEnd:ISectionCollection +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/RemoveSlideUsingReference.java b/Examples/src/main/java/com/aspose/slides/examples/slides/RemoveSlideUsingReference.java new file mode 100644 index 00000000..9dbcee6c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/RemoveSlideUsingReference.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.slides; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class RemoveSlideUsingReference +{ + public static void main(String[] args) + { + //ExStart:RemoveSlideUsingReference + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Instantiate a Presentation object that represents a presentation file + Presentation pres = new Presentation(dataDir + "RemoveSlideUsingReference.pptx"); + try + { + + // Accessing a slide using its index in the slides collection + ISlide slide = pres.getSlides().get_Item(0); + + // Removing a slide using its reference + pres.getSlides().remove(slide); + + //Writing the presentation file + pres.save(dataDir + "modified_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:RemoveSlideUsingReference + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/background/GetBackgroundEffectiveValues.java b/Examples/src/main/java/com/aspose/slides/examples/slides/background/GetBackgroundEffectiveValues.java new file mode 100644 index 00000000..04d44958 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/background/GetBackgroundEffectiveValues.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.slides.background; + +import com.aspose.slides.FillType; +import com.aspose.slides.IBackgroundEffectiveData; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class GetBackgroundEffectiveValues +{ + + public static void main(String[] args) + { + //ExStart:GetBackgroundEffectiveValues + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Background(); + + // Instantiate the Presentation class that represents the presentation file + Presentation pres = new Presentation(dataDir + "SamplePresentation.pptx"); + try + { + IBackgroundEffectiveData effBackground = pres.getSlides().get_Item(0).getBackground().getEffective(); + + if (effBackground.getFillFormat().getFillType() == FillType.Solid) + System.out.println("Fill color: " + effBackground.getFillFormat().getSolidFillColor()); + else + System.out.println("Fill type: " + effBackground.getFillFormat().getFillType()); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:GetBackgroundEffectiveValues + } + +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/background/SetBackgroundToGradient.java b/Examples/src/main/java/com/aspose/slides/examples/slides/background/SetBackgroundToGradient.java new file mode 100644 index 00000000..72a94dc6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/background/SetBackgroundToGradient.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.slides.background; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetBackgroundToGradient +{ + public static void main(String[] args) + { + //ExStart:SetBackgroundToGradient + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Background(); + + // Instantiate the Presentation class that represents the presentation file + Presentation pres = new Presentation(dataDir + "SetBackgroundToGradient.pptx"); + try + { + + // Apply Gradiant effect to the Background + pres.getSlides().get_Item(0).getBackground().setType(BackgroundType.OwnBackground); + pres.getSlides().get_Item(0).getBackground().getFillFormat().setFillType(FillType.Gradient); + pres.getSlides().get_Item(0).getBackground().getFillFormat().getGradientFormat().setTileFlip(TileFlip.FlipBoth); + + //Write the presentation to disk + pres.save(dataDir + "ContentBG_Grad_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SetBackgroundToGradient + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/background/SetImageAsBackground.java b/Examples/src/main/java/com/aspose/slides/examples/slides/background/SetImageAsBackground.java new file mode 100644 index 00000000..6ee7c46e --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/background/SetImageAsBackground.java @@ -0,0 +1,42 @@ +package com.aspose.slides.examples.slides.background; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetImageAsBackground +{ + public static void main(String[] args) + { + //ExStart:SetImageAsBackground + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Background(); + String outputDir = RunExamples.getOutPath(); + + // Instantiate the Presentation class that represents the presentation file + Presentation pres = new Presentation(dataDir + "SetImageAsBackground.pptx"); + try + { + + // Set the background with Image + pres.getSlides().get_Item(0).getBackground().setType(BackgroundType.OwnBackground); + pres.getSlides().get_Item(0).getBackground().getFillFormat().setFillType(FillType.Picture); + pres.getSlides().get_Item(0).getBackground().getFillFormat().getPictureFillFormat().setPictureFillMode(PictureFillMode.Stretch); + + // Set the picture + IImage img = Images.fromFile(dataDir + "Tulips.jpg"); + // Add image to presentation's images collection + IPPImage imgx = pres.getImages().addImage(img); + + pres.getSlides().get_Item(0).getBackground().getFillFormat().getPictureFillFormat().getPicture().setImage(imgx); + + // Write the presentation to disk + pres.save(outputDir + "ContentBG_Img_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SetImageAsBackground + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/background/SetSlideBackgroundMaster.java b/Examples/src/main/java/com/aspose/slides/examples/slides/background/SetSlideBackgroundMaster.java new file mode 100644 index 00000000..086f16cd --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/background/SetSlideBackgroundMaster.java @@ -0,0 +1,46 @@ +package com.aspose.slides.examples.slides.background; + +import com.aspose.slides.BackgroundType; +import com.aspose.slides.FillType; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class SetSlideBackgroundMaster +{ + public static void main(String[] args) + { + //ExStart:SetSlideBackgroundMaster + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Background(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate the Presentation class that represents the presentation file + Presentation pres = new Presentation(); + try + { + + // Set the background color of the Master ISlide to Forest Green + pres.getMasters().get_Item(0).getBackground().setType(BackgroundType.OwnBackground); + pres.getMasters().get_Item(0).getBackground().getFillFormat().setFillType(FillType.Solid); + pres.getMasters().get_Item(0).getBackground().getFillFormat().getSolidFillColor().setColor(Color.GREEN); + + // Write the presentation to disk + pres.save(dataDir + "SetSlideBackgroundMaster_out.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SetSlideBackgroundMaster + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/background/SetSlideBackgroundNormal.java b/Examples/src/main/java/com/aspose/slides/examples/slides/background/SetSlideBackgroundNormal.java new file mode 100644 index 00000000..ee80e5e2 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/background/SetSlideBackgroundNormal.java @@ -0,0 +1,43 @@ +package com.aspose.slides.examples.slides.background; + +import com.aspose.slides.BackgroundType; +import com.aspose.slides.FillType; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class SetSlideBackgroundNormal +{ + public static void main(String[] args) + { + //ExStart:SetSlideBackgroundNormal + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Background(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate the Presentation class that represents the presentation file + Presentation pres = new Presentation(); + try + { + + // Set the background color of the first ISlide to Blue + pres.getSlides().get_Item(0).getBackground().setType(BackgroundType.OwnBackground); + pres.getSlides().get_Item(0).getBackground().getFillFormat().setFillType(FillType.Solid); + pres.getSlides().get_Item(0).getBackground().getFillFormat().getSolidFillColor().setColor(Color.BLUE); + pres.save(dataDir + "ContentBG_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SetSlideBackgroundNormal + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/comments/AccessSlideComments.java b/Examples/src/main/java/com/aspose/slides/examples/slides/comments/AccessSlideComments.java new file mode 100644 index 00000000..5d21e1f6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/comments/AccessSlideComments.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.slides.comments; + +import com.aspose.slides.IComment; +import com.aspose.slides.ICommentAuthor; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class AccessSlideComments +{ + public static void main(String[] args) + { + //ExStart:AccessSlideComments + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Comments(); + + // Instantiate Presentation class + Presentation presentation = new Presentation(dataDir + "Comments1.pptx"); + try + { + for (ICommentAuthor commentAuthor : presentation.getCommentAuthors()) + { + ICommentAuthor author = commentAuthor; + for (IComment comment1 : author.getComments()) + { + IComment comment = comment1; + System.out.println("ISlide :" + comment.getSlide().getSlideNumber() + " has comment: " + comment.getText() + " with Author: " + comment.getAuthor().getName() + " posted on time :" + comment.getCreatedTime() + "\n"); + } + } + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AccessSlideComments + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/comments/AddParentComments.java b/Examples/src/main/java/com/aspose/slides/examples/slides/comments/AddParentComments.java new file mode 100644 index 00000000..2c73814e --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/comments/AddParentComments.java @@ -0,0 +1,75 @@ +package com.aspose.slides.examples.slides.comments; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.geom.Point2D; +import java.util.Date; + + +public class AddParentComments +{ + public static void main(String[] args) + { + + //ExStart:AddParentComments + // The path to the output directory. + String outPptxFile = RunExamples.getOutPath(); + + Presentation pres = new Presentation(); + try + { + // Add comment + ICommentAuthor author1 = pres.getCommentAuthors().addAuthor("Author_1", "A.A."); + IComment comment1 = author1.getComments().addComment("comment1", pres.getSlides().get_Item(0), new Point2D.Float(10, 10), new Date()); + + // Add reply for comment1 + ICommentAuthor author2 = pres.getCommentAuthors().addAuthor("Autror_2", "B.B."); + IComment reply1 = author2.getComments().addComment("reply 1 for comment 1", pres.getSlides().get_Item(0), new Point2D.Float(10, 10), new Date()); + reply1.setParentComment(comment1); + + // Add reply for comment1 + IComment reply2 = author2.getComments().addComment("reply 2 for comment 1", pres.getSlides().get_Item(0), new Point2D.Float(10, 10), new Date()); + reply2.setParentComment(comment1); + + // Add reply to reply + IComment subReply = author1.getComments().addComment("subreply 3 for reply 2", pres.getSlides().get_Item(0), new Point2D.Float(10, 10), new Date()); + subReply.setParentComment(reply2); + + IComment comment2 = author2.getComments().addComment("comment 2", pres.getSlides().get_Item(0), new Point2D.Float(10, 10), new Date()); + IComment comment3 = author2.getComments().addComment("comment 3", pres.getSlides().get_Item(0), new Point2D.Float(10, 10), new Date()); + + IComment reply3 = author1.getComments().addComment("reply 4 for comment 3", pres.getSlides().get_Item(0), new Point2D.Float(10, 10), new Date()); + reply3.setParentComment(comment3); + + // Display hierarchy on console + ISlide slide = pres.getSlides().get_Item(0); + IComment[] comments = slide.getSlideComments(null); + for (int i = 0; i < comments.length; i++) + { + IComment comment = comments[i]; + while (comment.getParentComment() != null) + { + System.out.print("\t"); + comment = comment.getParentComment(); + } + + System.out.print(String.format("{0} : {1}", comments[i].getAuthor().getName(), comments[i].getText())); + System.out.println(); + } + + pres.save(outPptxFile + "parent_comment.pptx", SaveFormat.Pptx); + + // Remove comment1 and all its replies + comment1.remove(); + + pres.save(outPptxFile + "remove_comment.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AddParentComments + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/comments/AddSlideComments.java b/Examples/src/main/java/com/aspose/slides/examples/slides/comments/AddSlideComments.java new file mode 100644 index 00000000..7f9038d0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/comments/AddSlideComments.java @@ -0,0 +1,63 @@ +package com.aspose.slides.examples.slides.comments; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.geom.Point2D; +import java.util.Date; + + +public class AddSlideComments +{ + public static void main(String[] args) + { + //ExStart:AddSlideComments + // The path to the output file. + String outPptxFile = RunExamples.getOutPath() + "Comments_out.pptx"; + + // Instantiate Presentation class + Presentation presentation = new Presentation(); + try + { + // Adding Empty slide + presentation.getSlides().addEmptySlide(presentation.getLayoutSlides().get_Item(0)); + + // Adding Author + ICommentAuthor author = presentation.getCommentAuthors().addAuthor("Jawad", "MF"); + + // Position of comments + Point2D.Float point = new Point2D.Float(); + point.x = 0.2f; + point.y = 0.2f; + + // Adding slide comment for an author on slide 1 + author.getComments().addComment("Hello Jawad, this is slide comment", presentation.getSlides().get_Item(0), (Point2D.Float) point.clone(), new Date()); + + // Adding slide comment for an author on slide 1 + author.getComments().addComment("Hello Jawad, this is second slide comment", presentation.getSlides().get_Item(1), (Point2D.Float) point.clone(), new Date()); + + // Accessing ISlide 1 + ISlide slide = presentation.getSlides().get_Item(0); + + // if null is passed as an argument then it will bring comments from all authors on selected slide + IComment[] Comments = slide.getSlideComments(author); + + // Accessin the comment at index 0 for slide 1 + String str = Comments[0].getText(); + + presentation.save(outPptxFile + "Comments_out.pptx", SaveFormat.Pptx); + + if (Comments.length > 0) + { + // Select comments collection of Author at index 0 + ICommentCollection commentCollection = Comments[0].getAuthor().getComments(); + String Comment = commentCollection.get_Item(0).getText(); + } + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AddSlideComments + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/comments/ModernComments.java b/Examples/src/main/java/com/aspose/slides/examples/slides/comments/ModernComments.java new file mode 100644 index 00000000..f68db186 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/comments/ModernComments.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2009-2021. Aspose Pty Ltd. All Rights Reserved. + */ + +package com.aspose.slides.examples.slides.comments; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; +import java.awt.geom.Point2D; +import java.util.Date; + +public class ModernComments +{ + public static void main(String[] args) + { + //ExStart:ModernComments + // The path to the output file. + String outPptxFile = RunExamples.getOutPath() + "ModernComments_out.pptx"; + + // Instantiate Presentation class + Presentation pres = new Presentation(); + try + { + // Add author + ICommentAuthor newAuthor = pres.getCommentAuthors().addAuthor("Some Author", "SA"); + + // Add comment + IModernComment modernComment = newAuthor.getComments().addModernComment("This is a modern comment", pres.getSlides().get_Item(0), null, new Point2D.Float(100, 100), new Date()); + + // Save presentation + pres.save(outPptxFile, SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ModernComments + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AccessSlidebyID.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AccessSlidebyID.java new file mode 100644 index 00000000..11a94f81 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AccessSlidebyID.java @@ -0,0 +1,27 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.IBaseSlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class AccessSlidebyID +{ + public static void main(String[] args) + { + //ExStart:AccessSlidebyID + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(dataDir + "AccessSlides.pptx"); + + // Getting Slide ID + + long id = presentation.getSlides().get_Item(0).getSlideId(); + + // Accessing Slide by ID + IBaseSlide slide = presentation.getSlideById(id); + //ExEnd:AccessSlidebyID + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AccessSlidebyIndex.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AccessSlidebyIndex.java new file mode 100644 index 00000000..eafd57c6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AccessSlidebyIndex.java @@ -0,0 +1,23 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class AccessSlidebyIndex +{ + public static void main(String[] args) + { + //ExStart:AccessSlidebyIndex + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(dataDir + "AccessSlides.pptx"); + + // Obtain a slide's reference by its index + ISlide slide = presentation.getSlides().get_Item(0); + //ExEnd:AccessSlidebyIndex + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AccessSlides.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AccessSlides.java new file mode 100644 index 00000000..3ff3ad35 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AccessSlides.java @@ -0,0 +1,30 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class AccessSlides +{ + public static void main(String[] args) + { + //ExStart:AccessSlides + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Instantiate a Presentation object that represents a presentation file + Presentation pres = new Presentation(dataDir + "AccessSlides.pptx"); + try + { + // Accessing a slide using its slide index + ISlide slide = pres.getSlides().get_Item(0); + System.out.println("Slide Number: " + slide.getSlideNumber()); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AccessSlides + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AddNotesSlideWithNotesStyle.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AddNotesSlideWithNotesStyle.java new file mode 100644 index 00000000..df7a3ca8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AddNotesSlideWithNotesStyle.java @@ -0,0 +1,51 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class AddNotesSlideWithNotesStyle +{ + public static void main(String[] args) + { + //ExStart:AddNotesSlideWithNotesStyle + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Presentation class that represents the presentation file + Presentation presentation = new Presentation(dataDir + "AccessSlides.pptx"); + try + { + IMasterNotesSlide notesMaster = presentation.getMasterNotesSlideManager().getMasterNotesSlide(); + + if (notesMaster != null) + { + // Get MasterNotesSlide text style + ITextStyle notesStyle = notesMaster.getNotesStyle(); + + //Set symbol bullet for the first level paragraphs + IParagraphFormat paragraphFormat = notesStyle.getLevel(0); + paragraphFormat.getBullet().setType(BulletType.Symbol); + } + + // Save the PPTX file to the Disk + presentation.save(dataDir + "AddNotesSlideWithNotesStyle_out.pptx", SaveFormat.Pptx); + + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AddNotesSlideWithNotesStyle + } +} + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AddSlides.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AddSlides.java new file mode 100644 index 00000000..64136aef --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/AddSlides.java @@ -0,0 +1,48 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.ISlideCollection; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class AddSlides +{ + public static void main(String[] args) + { + //ExStart:AddSlides + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Presentation class that represents the presentation file + Presentation pres = new Presentation(); + try + { + // Instantiate SlideCollection calss + ISlideCollection slds = pres.getSlides(); + + for (int i = 0; i < pres.getLayoutSlides().size(); i++) + { + // Add an empty slide to the Slides collection + slds.addEmptySlide(pres.getLayoutSlides().get_Item(i)); + + } + + // Save the PPTX file to the Disk + pres.save(dataDir + "EmptySlide_out.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AddSlides + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/ChangePosition.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/ChangePosition.java new file mode 100644 index 00000000..7883078d --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/ChangePosition.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ChangePosition +{ + public static void main(String[] args) + { + //ExStart:ChangePosition + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Instantiate Presentation class to load the source presentation file + Presentation pres = new Presentation(dataDir + "ChangePosition.pptx"); + try + { + // Get the slide whose position is to be changed + ISlide sld = pres.getSlides().get_Item(0); + + // Set the new position for the slide + sld.setSlideNumber(2); + + // Write the presentation to disk + pres.save(dataDir + "Aspose_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ChangePosition + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneAnotherPresentationAtSpecifiedPosition.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneAnotherPresentationAtSpecifiedPosition.java new file mode 100644 index 00000000..426b1a39 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneAnotherPresentationAtSpecifiedPosition.java @@ -0,0 +1,45 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.ISlideCollection; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class CloneAnotherPresentationAtSpecifiedPosition +{ + public static void main(String[] args) + { + //ExStart:CloneAnotherPresentationAtSpecifiedPosition + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Instantiate Presentation class to load the source presentation file + Presentation sourcePresentation = new Presentation(dataDir + "AccessSlides.pptx"); + try + { + // Instantiate Presentation class for destination presentation (where slide is to be cloned) + Presentation destPres = new Presentation(); + try + { + // Clone the desired slide from the source presentation to the end of the collection of slides in destination presentation + ISlideCollection slideCollection = destPres.getSlides(); + + // Clone the desired slide from the source presentation to the specified position in destination presentation + slideCollection.insertClone(1, sourcePresentation.getSlides().get_Item(1)); + + // Write the destination presentation to disk + destPres.save(dataDir + "CloneAnotherPresentationAtSpecifiedPosition_out.pptx", SaveFormat.Pptx); + } + finally + { + if (destPres != null) destPres.dispose(); + } + } + finally + { + if (sourcePresentation != null) sourcePresentation.dispose(); + } + //ExEnd:CloneAnotherPresentationAtSpecifiedPosition + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneAtEndOfAnother.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneAtEndOfAnother.java new file mode 100644 index 00000000..79899f9d --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneAtEndOfAnother.java @@ -0,0 +1,44 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.ISlideCollection; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class CloneAtEndOfAnother +{ + public static void main(String[] args) + { + //ExStart:CloneAtEndOfAnother + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Instantiate Presentation class to load the source presentation file + Presentation srcPres = new Presentation(dataDir + "CloneAtEndOfAnother.pptx"); + try + { + // Instantiate Presentation class for destination PPTX (where slide is to be cloned) + Presentation destPres = new Presentation(); + try + { + // Clone the desired slide from the source presentation to the end of the collection of slides in destination presentation + ISlideCollection slds = destPres.getSlides(); + + slds.addClone(srcPres.getSlides().get_Item(0)); + + // Write the destination presentation to disk + destPres.save(dataDir + "Aspose2_out.pptx", SaveFormat.Pptx); + } + finally + { + if (destPres != null) destPres.dispose(); + } + } + finally + { + if (srcPres != null) srcPres.dispose(); + } + //ExEnd:CloneAtEndOfAnother + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneAtEndOfAnotherSpecificPosition.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneAtEndOfAnotherSpecificPosition.java new file mode 100644 index 00000000..0984ebf4 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneAtEndOfAnotherSpecificPosition.java @@ -0,0 +1,45 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.ISlideCollection; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class CloneAtEndOfAnotherSpecificPosition +{ + public static void main(String[] args) + { + //ExStart:CloneAtEndOfAnotherSpecificPosition + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Instantiate Presentation class to load the source presentation file + Presentation srcPres = new Presentation(dataDir + "CloneAtEndOfAnotherSpecificPosition.pptx"); + try + { + // Instantiate Presentation class for destination presentation (where slide is to be cloned) + Presentation destPres = new Presentation(); + try + { + // Clone the desired slide from the source presentation to the end of the collection of slides in destination presentation + ISlideCollection slds = destPres.getSlides(); + + // Clone the desired slide from the source presentation to the specified position in destination presentation + slds.insertClone(1, srcPres.getSlides().get_Item(1)); + + // Write the destination presentation to disk + destPres.save(dataDir + "Aspose1_out.pptx", SaveFormat.Pptx); + } + finally + { + if (destPres != null) destPres.dispose(); + } + } + finally + { + if (srcPres != null) srcPres.dispose(); + } + //ExEnd:CloneAtEndOfAnotherSpecificPosition + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneSlideIntoSpecifiedSection.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneSlideIntoSpecifiedSection.java new file mode 100644 index 00000000..e40eb046 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneSlideIntoSpecifiedSection.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class CloneSlideIntoSpecifiedSection +{ + public static void main(String[] args) + { + + //ExStart:CloneSlideIntoSpecifiedSection + + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + IPresentation presentation = new Presentation(); + try + { + + presentation.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 200, 50, 300, 100); + presentation.getSections().addSection("Section 1", presentation.getSlides().get_Item(0)); + + ISection section2 = presentation.getSections().appendEmptySection("Section 2"); + + presentation.getSlides().addClone(presentation.getSlides().get_Item(0), section2); + + + presentation.save(dataDir + "CloneSlideIntoSpecifiedSection.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:CloneSlideIntoSpecifiedSection + + } + + +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneToAnotherPresentationWithMaster.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneToAnotherPresentationWithMaster.java new file mode 100644 index 00000000..b77c8ca2 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneToAnotherPresentationWithMaster.java @@ -0,0 +1,60 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class CloneToAnotherPresentationWithMaster +{ + public static void main(String[] args) + { + //ExStart:CloneToAnotherPresentationWithMaster + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Instantiate Presentation class to load the source presentation file + + Presentation srcPres = new Presentation(dataDir + "CloneToAnotherPresentationWithMaster.pptx"); + try + { + // Instantiate Presentation class for destination presentation (where slide is to be cloned) + Presentation destPres = new Presentation(); + try + { + + // Instantiate ISlide from the collection of slides in source presentation along with + // Master slide + ISlide SourceSlide = srcPres.getSlides().get_Item(0); + IMasterSlide SourceMaster = SourceSlide.getLayoutSlide().getMasterSlide(); + + // Clone the desired master slide from the source presentation to the collection of masters in the + // Destination presentation + IMasterSlideCollection masters = destPres.getMasters(); + IMasterSlide DestMaster = SourceSlide.getLayoutSlide().getMasterSlide(); + + // Clone the desired master slide from the source presentation to the collection of masters in the + // Destination presentation + IMasterSlide iSlide = masters.addClone(SourceMaster); + + // Clone the desired slide from the source presentation with the desired master to the end of the + // Collection of slides in the destination presentation + ISlideCollection slds = destPres.getSlides(); + slds.addClone(SourceSlide, iSlide, true); + + // Clone the desired master slide from the source presentation to the collection of masters in the // Destination presentation + // Save the destination presentation to disk + destPres.save(dataDir + "CloneToAnotherPresentationWithMaster_out.pptx", SaveFormat.Pptx); + + } + finally + { + if (destPres != null) destPres.dispose(); + } + } + finally + { + if (srcPres != null) srcPres.dispose(); + } + //ExEnd:CloneToAnotherPresentationWithMaster + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneWithInSamePresentation.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneWithInSamePresentation.java new file mode 100644 index 00000000..f575daa8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneWithInSamePresentation.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.ISlideCollection; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class CloneWithInSamePresentation +{ + public static void main(String[] args) + { + //ExStart:CloneWithInSamePresentation + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Instantiate Presentation class that represents a presentation file + Presentation pres = new Presentation(dataDir + "CloneWithInSamePresentation.pptx"); + try + { + + // Clone the desired slide to the end of the collection of slides in the same presentation + ISlideCollection slds = pres.getSlides(); + + // Clone the desired slide to the specified index in the same presentation + slds.insertClone(2, pres.getSlides().get_Item(1)); + + // Write the modified presentation to disk + pres.save(dataDir + "Aspose_CloneWithInSamePresentation_out.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:CloneWithInSamePresentation + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneWithinSamePresentationToEnd.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneWithinSamePresentationToEnd.java new file mode 100644 index 00000000..01922ccf --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CloneWithinSamePresentationToEnd.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.ISlideCollection; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class CloneWithinSamePresentationToEnd +{ + public static void main(String[] args) + { + //ExStart:CloneWithinSamePresentationToEnd + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Instantiate Presentation class that represents a presentation file + Presentation pres = new Presentation(dataDir + "CloneWithinSamePresentationToEnd.pptx"); + try + { + + // Clone the desired slide to the end of the collection of slides in the same presentation + ISlideCollection slds = pres.getSlides(); + + slds.addClone(pres.getSlides().get_Item(0)); + + // Write the modified presentation to disk + pres.save(dataDir + "Aspose_CloneWithinSamePresentationToEnd_out.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:CloneWithinSamePresentationToEnd + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CreateSlidesSVGImage.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CreateSlidesSVGImage.java new file mode 100644 index 00000000..06ab46e5 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/CreateSlidesSVGImage.java @@ -0,0 +1,55 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.ByteArrayOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; + + +public class CreateSlidesSVGImage +{ + public static void main(String[] args) throws IOException + { + //ExStart:CreateSlidesSVGImage + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + String outPath = RunExamples.getOutPath(); + + // Instantiate a Presentation class that represents the presentation file + + Presentation pres = new Presentation(dataDir + "CreateSlidesSVGImage.pptx"); + try + { + + // Access the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Create a memory stream object + ByteArrayOutputStream svgStream = new ByteArrayOutputStream(); + + // Generate SVG image of slide and save in memory stream + sld.writeAsSvg(svgStream); + + // Save memory stream to file + FileOutputStream fileStream = new FileOutputStream(outPath + "Aspose_out.svg"); + try + { + svgStream.writeTo(fileStream); + + } + finally + { + if (fileStream != null) fileStream.close(); + } + svgStream.close(); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:CreateSlidesSVGImage + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/crud/RemoveSlideUsingIndex.java b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/RemoveSlideUsingIndex.java new file mode 100644 index 00000000..759c244d --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/crud/RemoveSlideUsingIndex.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.slides.crud; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class RemoveSlideUsingIndex +{ + public static void main(String[] args) + { + //ExStart:RemoveSlideUsingIndex + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_CRUD(); + + // Instantiate a Presentation object that represents a presentation file + Presentation pres = new Presentation(dataDir + "RemoveSlideUsingIndex.pptx"); + try + { + + // Removing a slide using its slide index + pres.getSlides().removeAt(0); + + // Writing the presentation file + pres.save(dataDir + "modified_out.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:RemoveSlideUsingIndex + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/AddHyperlink.java b/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/AddHyperlink.java new file mode 100644 index 00000000..0864b4fa --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/AddHyperlink.java @@ -0,0 +1,31 @@ +package com.aspose.slides.examples.slides.hyperlinks; + +import com.aspose.slides.*; + + +public class AddHyperlink +{ + public static void main(String[] args) + { + + //ExStart:AddHyperlink + + Presentation presentation = new Presentation(); + try + { + IAutoShape shape1 = presentation.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 600, 50, false); + shape1.addTextFrame("Aspose: File Format APIs"); + shape1.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().setHyperlinkClick(new Hyperlink("https://www.aspose.com/")); + shape1.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getHyperlinkClick().setTooltip("More than 70% Fortune 100 companies trust Aspose APIs"); + shape1.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().setFontHeight(32); + + presentation.save("presentation-out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AddHyperlink + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/ExternalUrlOriginal.java b/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/ExternalUrlOriginal.java new file mode 100644 index 00000000..df659a89 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/ExternalUrlOriginal.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.slides.hyperlinks; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class ExternalUrlOriginal +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Hyperlink(); + + //ExStart:ExternalUrlOriginal + + // Instantiate Presentation class + Presentation presentation = new Presentation(dataDir + "ExternalUrlOriginal.pptx"); + try { + IPortion portion = ((AutoShape)presentation.getSlides().get_Item(0) + .getShapes().get_Item(1)).getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0); + + // Shows fake hyperlink + System.out.println("Fake External Hyperlink : " + portion.getPortionFormat().getHyperlinkClick().getExternalUrl()); + + // Shows real hyperlink + System.out.println("Real External Hyperlink : " + portion.getPortionFormat().getHyperlinkClick().getExternalUrlOriginal()); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ExternalUrlOriginal + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/MacroHyperLink.java b/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/MacroHyperLink.java new file mode 100644 index 00000000..b4c3a070 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/MacroHyperLink.java @@ -0,0 +1,25 @@ +package com.aspose.slides.examples.slides.hyperlinks;/* + * Copyright (c) 2009-2021 Aspose Pty Ltd. All Rights Reserved. + */ + +import com.aspose.slides.IAutoShape; +import com.aspose.slides.Presentation; +import com.aspose.slides.ShapeType; + +public class MacroHyperLink +{ + public static void main(String[] args) + { + String macroName = "TestMacro"; + Presentation pres = new Presentation(); + try { + IAutoShape shape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.BlankButton, 20, 20, 80, 30); + shape.getHyperlinkManager().setMacroHyperlinkClick(macroName); + + System.out.println("External URL is " + shape.getHyperlinkClick().getExternalUrl()); + System.out.println("Shape action type is " + shape.getHyperlinkClick().getActionType()); + } finally { + if (pres != null) pres.dispose(); + } + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/MutableHyperlink.java b/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/MutableHyperlink.java new file mode 100644 index 00000000..38327315 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/MutableHyperlink.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.slides.hyperlinks; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class MutableHyperlink +{ + + public static void main(String[] args) + { + + //ExStart:MutableHyperlink + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Hyperlink(); + + Presentation presentation = new Presentation(); + try + { + + IAutoShape shape1 = presentation.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 600, 50, false); + shape1.addTextFrame("Aspose: File Format APIs"); + shape1.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().setHyperlinkClick(new Hyperlink("https://www.aspose.com/")); + shape1.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getHyperlinkClick().setTooltip("More than 70% Fortune 100 companies trust Aspose APIs"); + shape1.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().setFontHeight(32); + + presentation.save(dataDir + "presentation-out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:MutableHyperlink + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/RemoveHyperlinks.java b/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/RemoveHyperlinks.java new file mode 100644 index 00000000..d6992c25 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/RemoveHyperlinks.java @@ -0,0 +1,32 @@ +package com.aspose.slides.examples.slides.hyperlinks; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class RemoveHyperlinks +{ + public static void main(String[] args) + { + //ExStart:RemoveHyperlinks + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Hyperlink(); + + // Instantiate Presentation class + Presentation presentation = new Presentation(dataDir + "Hyperlink.pptx"); + try + { + // Removing the hyperlinks from presentation + presentation.getHyperlinkQueries().removeAllHyperlinks(); + + //Writing the presentation as a PPTX file + presentation.save(dataDir + "RemovedHyperlink_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:RemoveHyperlinks + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/SetHyperLinkColor.java b/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/SetHyperLinkColor.java new file mode 100644 index 00000000..02b8c654 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/hyperlinks/SetHyperLinkColor.java @@ -0,0 +1,39 @@ +package com.aspose.slides.examples.slides.hyperlinks; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class SetHyperLinkColor +{ + public static void main(String[] args) + { + + //ExStart:SetHyperLinkColor + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Hyperlink(); + Presentation presentation = new Presentation(); + try + { + IAutoShape shape1 = presentation.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 450, 50, false); + shape1.addTextFrame("This is a sample of colored hyperlink."); + shape1.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().setHyperlinkClick(new Hyperlink("https://www.aspose.com/")); + shape1.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getHyperlinkClick().setColorSource(HyperlinkColorSource.PortionFormat); + shape1.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().setFillType(FillType.Solid); + shape1.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.RED); + IAutoShape shape2 = presentation.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 100, 200, 450, 50, false); + shape2.addTextFrame("This is a sample of usual hyperlink."); + shape2.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().setHyperlinkClick(new Hyperlink("https://www.aspose.com/")); + + presentation.save(dataDir + "presentation-out-hyperlink.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SetHyperLinkColor + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/layout/AddLayoutSlides.java b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/AddLayoutSlides.java new file mode 100644 index 00000000..0e6b78f9 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/AddLayoutSlides.java @@ -0,0 +1,80 @@ +package com.aspose.slides.examples.slides.layout; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AddLayoutSlides +{ + public static void main(String[] args) + { + //ExStart:AddLayoutSlides + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Layout(); + + // Instantiate Presentation class that represents the presentation file + Presentation presentation = new Presentation(dataDir + "AccessSlides.pptx"); + try + { + // Try to search by layout slide type + IMasterLayoutSlideCollection layoutSlides = presentation.getMasters().get_Item(0).getLayoutSlides(); + ILayoutSlide layoutSlide = null; + + if (layoutSlides.getByType(SlideLayoutType.TitleAndObject) != null) + layoutSlide = layoutSlides.getByType(SlideLayoutType.TitleAndObject); + else + layoutSlide = layoutSlides.getByType(SlideLayoutType.Title); + + if (layoutSlide == null) + { + // The situation when a presentation doesn't contain some type of layouts. + // presentation File only contains Blank and Custom layout types. + // But layout slides with Custom types has different slide names, + // like "Title", "Title and Content", etc. And it is possible to use these + // names for layout slide selection. + // Also it is possible to use the set of placeholder shape types. For example, + // Title slide should have only Title pleceholder type, etc. + for (ILayoutSlide titleAndObjectLayoutSlide : (Iterable) layoutSlides) + { + if ("Title and Object".equals(titleAndObjectLayoutSlide.getName())) + { + layoutSlide = titleAndObjectLayoutSlide; + break; + } + } + + if (layoutSlide == null) + { + for (ILayoutSlide titleLayoutSlide : (Iterable) layoutSlides) + { + if ("Title".equals(titleLayoutSlide.getName())) + { + layoutSlide = titleLayoutSlide; + break; + } + } + + if (layoutSlide == null) + { + layoutSlide = layoutSlides.getByType(SlideLayoutType.Blank); + if (layoutSlide == null) + { + layoutSlide = layoutSlides.add(SlideLayoutType.TitleAndObject, "Title and Object"); + } + } + } + } + + // Adding empty slide with added layout slide + presentation.getSlides().insertEmptySlide(0, layoutSlide); + + // Save presentation + presentation.save(dataDir + "AddLayoutSlides_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AddLayoutSlides + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/layout/CheckSlidesComparison.java b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/CheckSlidesComparison.java new file mode 100644 index 00000000..64b0a99f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/CheckSlidesComparison.java @@ -0,0 +1,42 @@ +package com.aspose.slides.examples.slides.layout; + +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class CheckSlidesComparison +{ + public static void main(String[] args) + { + //ExStart:CheckSlidesComparison + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Layout(); + Presentation presentation1 = new Presentation(dataDir + "AccessSlides.pptx"); + try + { + Presentation presentation2 = new Presentation(dataDir + "HelloWorld.pptx"); + try + { + for (int i = 0; i < presentation1.getMasters().size(); i++) + { + for (int j = 0; j < presentation2.getMasters().size(); j++) + { + if (presentation1.getMasters().get_Item(i).equals(presentation2.getMasters().get_Item(j))) ; + System.out.println(String.format("SomePresentation1 MasterSlide#{0} is equal to SomePresentation2 MasterSlide#{1}", i, j)); + } + + + } + } + finally + { + if (presentation2 != null) presentation2.dispose(); + } + } + finally + { + if (presentation1 != null) presentation1.dispose(); + } + //ExEnd:CheckSlidesComparison + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/layout/GetBasePlacehorderExample.java b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/GetBasePlacehorderExample.java new file mode 100644 index 00000000..3ec73b3c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/GetBasePlacehorderExample.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.slides.layout; + +import com.aspose.slides.IEffect; +import com.aspose.slides.IShape; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +public class GetBasePlacehorderExample +{ + public static void main(String[] args) + { + //ExStart:GetBasePlacehorderExample + String presentationName = RunExamples.getDataDir_Slides_Presentations_Layout() + "placeholder.pptx"; + + Presentation presentation = new Presentation(presentationName); + try { + ISlide slide = presentation.getSlides().get_Item(0); + IShape shape = slide.getShapes().get_Item(0); + IEffect[] shapeEffects = slide.getLayoutSlide().getTimeline().getMainSequence().getEffectsByShape(shape); + System.out.println("Shape effects count = " + shapeEffects.length); + + IShape layoutShape = shape.getBasePlaceholder(); + IEffect[] layoutShapeEffects = slide.getLayoutSlide().getTimeline().getMainSequence().getEffectsByShape(layoutShape); + System.out.println("Layout shape effects count = " + layoutShapeEffects.length); + + IShape masterShape = layoutShape.getBasePlaceholder(); + IEffect[] masterShapeEffects = slide.getLayoutSlide().getMasterSlide().getTimeline().getMainSequence().getEffectsByShape(masterShape); + System.out.println("Master shape effects count = " + masterShapeEffects.length); + } finally { + if (presentation != null) presentation.dispose(); + } + //ExEnd:GetBasePlacehorderExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/layout/HeaderFooterManager.java b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/HeaderFooterManager.java new file mode 100644 index 00000000..c04f5cde --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/HeaderFooterManager.java @@ -0,0 +1,45 @@ +package com.aspose.slides.examples.slides.layout; + +import com.aspose.slides.IBaseSlideHeaderFooterManager; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class HeaderFooterManager +{ + public static void main(String[] args) + { + //ExStart:HeaderFooterManager + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Layout(); + Presentation presentation = new Presentation(dataDir + "presentation.ppt"); + try + { + IBaseSlideHeaderFooterManager headerFooterManager = presentation.getSlides().get_Item(0).getHeaderFooterManager(); + if (!headerFooterManager.isFooterVisible()) // Property IsFooterVisible is used for indicating that a slide footer placeholder is not present. + { + headerFooterManager.setFooterVisibility(true); // Method SetFooterVisibility is used for making a slide footer placeholder visible. + } + if (!headerFooterManager.isSlideNumberVisible()) // Property IsSlideNumberVisible is used for indicating that a slide page number placeholder is not present. + { + headerFooterManager.setSlideNumberVisibility(true); // Method SetSlideNumberVisibility is used for making a slide page number placeholder visible. + } + if (!headerFooterManager.isDateTimeVisible()) // Property IsDateTimeVisible is used for indicating that a slide date-time placeholder is not present. + { + headerFooterManager.setDateTimeVisibility(true); // Method SetFooterVisibility is used for making a slide date-time placeholder visible. + } + headerFooterManager.setFooterText("Footer text"); // Method SetFooterText is used for setting text to slide footer placeholder. + headerFooterManager.setDateTimeText("Date and time text"); // Method SetDateTimeText is used for setting text to slide date-time placeholder. + + + presentation.save(dataDir + "Presentation.ppt", SaveFormat.Ppt); + } + finally + { + if (presentation != null) presentation.dispose(); + } + + //ExEnd:HeaderFooterManager + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/layout/LayoutPlaceholderManagerExample.java b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/LayoutPlaceholderManagerExample.java new file mode 100644 index 00000000..31449bad --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/LayoutPlaceholderManagerExample.java @@ -0,0 +1,39 @@ +package com.aspose.slides.examples.slides.layout; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; + +public class LayoutPlaceholderManagerExample +{ + public static void main(String[] args) + { + // The path to output file + String outFilePath = RunExamples.getOutPath() + "placeholders.pptx"; + + //ExStart:LayoutPlaceholderManagerExample + Presentation pres = new Presentation(); + try { + // Getting the Blank layout slide. + ILayoutSlide layout = pres.getLayoutSlides().getByType(SlideLayoutType.Blank); + + // Getting the placeholder manager of the layout slide. + ILayoutPlaceholderManager placeholderManager = layout.getPlaceholderManager(); + + // Adding different placeholders to the Blank layout slide. + placeholderManager.addContentPlaceholder(10, 10, 300, 200); + placeholderManager.addVerticalTextPlaceholder(350, 10, 200, 300); + placeholderManager.addChartPlaceholder(10, 350, 300, 300); + placeholderManager.addTablePlaceholder(350, 350, 300, 200); + + // Adding the new slide with Blank layout. + ISlide newSlide = pres.getSlides().addEmptySlide(layout); + + pres.save(outFilePath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:LayoutPlaceholderManagerExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/layout/ManageHeaderFooterText.java b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/ManageHeaderFooterText.java new file mode 100644 index 00000000..ccf4de9e --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/ManageHeaderFooterText.java @@ -0,0 +1,55 @@ +package com.aspose.slides.examples.slides.layout; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ManageHeaderFooterText +{ + public static void main(String[] args) + { + + //ExStart:ManageHeaderFooterText + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Layout(); + + // Load Presentation + Presentation pres = new Presentation(dataDir + "presentation.pptx"); + + // Setting Footer + pres.getHeaderFooterManager().setAllFootersText("My Footer text"); + pres.getHeaderFooterManager().setAllFootersVisibility(true); + + // Access and Update Header + IMasterSlide masterNotesSlide = pres.getMasters().get_Item(0); + if (null != masterNotesSlide) + { + updateHeaderFooterText(masterNotesSlide); + } + + // Save presentation + pres.save(RunExamples.getOutPath() + "HeaderFooterJava.pptx", SaveFormat.Pptx); + + //ExEnd:ManageHeaderFooterText + + } + + //ExStart:UpdateHeaderFooterText + // Method to set Header/Footer Text + public static void updateHeaderFooterText(IBaseSlide master) + { + for (IShape shape : master.getShapes()) + { + if (shape.getPlaceholder() != null) + { + if (shape.getPlaceholder().getType() == PlaceholderType.Footer) + { + ((IAutoShape) shape).getTextFrame().setText("HI there new header"); + } + } + } + } + //ExEnd:UpdateHeaderFooterText +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/layout/SetChildFooter.java b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/SetChildFooter.java new file mode 100644 index 00000000..da93ca0b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/SetChildFooter.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.slides.layout; + +import com.aspose.slides.IMasterSlideHeaderFooterManager; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class SetChildFooter +{ + public static void main(String[] args) + { + //ExStart:SetChildFooter + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Layout(); + Presentation presentation = new Presentation(dataDir + "presentation.ppt"); + try + { + IMasterSlideHeaderFooterManager headerFooterManager = presentation.getMasters().get_Item(0).getHeaderFooterManager(); + headerFooterManager.setFooterAndChildFootersVisibility(true); // Method SetFooterAndChildFootersVisibility is used for making a master slide and all child footer placeholders visible. + headerFooterManager.setSlideNumberAndChildSlideNumbersVisibility(true); // Method SetSlideNumberAndChildSlideNumbersVisibility is used for making a master slide and all child page number placeholders visible. + headerFooterManager.setDateTimeAndChildDateTimesVisibility(true); // Method SetDateTimeAndChildDateTimesVisibility is used for making a master slide and all child date-time placeholders visible. + + headerFooterManager.setFooterAndChildFootersText("Footer text"); // Method SetFooterAndChildFootersText is used for setting text to master slide and all child footer placeholders. + headerFooterManager.setDateTimeAndChildDateTimesText("Date and time text"); // Method SetDateTimeAndChildDateTimesText is used for setting text to master slide and all child date-time placeholders. + } + finally + { + if (presentation != null) presentation.dispose(); + } + + //ExEnd:SetChildFooter + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/layout/SetPDFPageSize.java b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/SetPDFPageSize.java new file mode 100644 index 00000000..de7d0d71 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/SetPDFPageSize.java @@ -0,0 +1,29 @@ +package com.aspose.slides.examples.slides.layout; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetPDFPageSize +{ + public static void main(String[] args) + { + //ExStart:SetPDFPageSize + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Layout(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(); + + // Set SlideSize.Type Property + presentation.getSlideSize().setSize(SlideSizeType.A4Paper, SlideSizeScaleType.EnsureFit); + + // Set different properties of PDF Options + PdfOptions opts = new PdfOptions(); + opts.setSufficientResolution(600); + + // Save presentation to disk + presentation.save(dataDir + "SetPDFPageSize_out.pdf", SaveFormat.Pdf, opts); + //ExEnd:SetPDFPageSize + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/layout/SetSizeAndType.java b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/SetSizeAndType.java new file mode 100644 index 00000000..7eecf5a8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/SetSizeAndType.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.slides.layout; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.SlideSizeScaleType; +import com.aspose.slides.examples.RunExamples; + + +public class SetSizeAndType +{ + public static void main(String[] args) + { + //ExStart:SetSizeAndType + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Layout(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "AccessSlides.pptx"); + Presentation auxPresentation = new Presentation(); + + ISlide slide = presentation.getSlides().get_Item(0); + + // Set the slide size of generated presentations to that of source + auxPresentation.getSlideSize().setSize(presentation.getSlideSize().getType(), SlideSizeScaleType.EnsureFit); + + auxPresentation.getSlides().insertClone(0, slide); + auxPresentation.getSlides().removeAt(0); + // Save Presentation to disk + auxPresentation.save(dataDir + "Set_Size&Type_out.pptx", SaveFormat.Pptx); + //ExEnd:SetSizeAndType + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/layout/SetSlideSizeScale.java b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/SetSlideSizeScale.java new file mode 100644 index 00000000..b02db8ee --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/layout/SetSlideSizeScale.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.slides.layout; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetSlideSizeScale +{ + public static void main(String[] args) + { + + //ExStart:SetSlideSizeScale + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Layout(); + + // ExStart:SettSizeAndType + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "AccessSlides.pptx"); + Presentation auxPresentation = new Presentation(); + + ISlide slide = presentation.getSlides().get_Item(0); + + // Set the slide size of generated presentations to that of source + presentation.getSlideSize().setSize(540, 720, SlideSizeScaleType.EnsureFit); // Method SetSize is used for set slide size with scale content to ensure fit + presentation.getSlideSize().setSize(SlideSizeType.A4Paper, SlideSizeScaleType.Maximize); // Method SetSize is used for set slide size with maximize size of content + + + // Save Presentation to disk + auxPresentation.save(dataDir + "Set_Size&Type_out.pptx", SaveFormat.Pptx); + //ExEnd:SetSlideSizeScale + + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/media/AudioCaptionsExample.java b/Examples/src/main/java/com/aspose/slides/examples/slides/media/AudioCaptionsExample.java new file mode 100644 index 00000000..af1a2a62 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/media/AudioCaptionsExample.java @@ -0,0 +1,64 @@ +package com.aspose.slides.examples.slides.media; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; + +public class AudioCaptionsExample +{ + public static void main(String[] args) + { + String mediaFile = RunExamples.getDataDir_Slides_Presentations_Media() + "audio.mp3"; + String trackFile = RunExamples.getDataDir_Slides_Presentations_Media() + "bunny.vtt"; + String outCaption = RunExamples.getOutPath() + "AudioCaption_out.vtt"; + String outAddPath = RunExamples.getOutPath() + "AudioCaptionAdd_out.pptx"; + String outRemovePath = RunExamples.getOutPath() + "AudioCaptionRemove_out.pptx"; + + //ExStart:AudioCaptionsExample + // Add captions to a VideoFrame + Presentation pres = new Presentation(); + try { + IAudio audio = pres.getAudios().addAudio(new FileInputStream(mediaFile), LoadingStreamBehavior.KeepLocked); + IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(10, 10, 50, 50, audio); + + // Adds the new captions track from file + audioFrame.getCaptionTracks().add("New track", trackFile); + + pres.save(outAddPath, SaveFormat.Pptx); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } finally { + if (pres != null) pres.dispose(); + } + + // Extract captions from a VideoFrame + Presentation pres1 = new Presentation(outAddPath); + try { + IAudioFrame audioFrame = (IAudioFrame)pres1.getSlides().get_Item(0).getShapes().get_Item(0); + if (audioFrame != null) + { + for (ICaptions captionTrack : audioFrame.getCaptionTracks()) + { + // Extracts the captions binary data and saves theme to the file + FileOutputStream fos = new FileOutputStream(outCaption); + fos.write(captionTrack.getBinaryData()); + fos.close(); + } + + // Removes all captions from the VideoFrame + audioFrame.getCaptionTracks().clear(); + + pres1.save(outRemovePath, SaveFormat.Pptx); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (pres1 != null) pres1.dispose(); + } + //ExEnd:AudioCaptionsExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/media/ExtractAudio.java b/Examples/src/main/java/com/aspose/slides/examples/slides/media/ExtractAudio.java new file mode 100644 index 00000000..784d8bf6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/media/ExtractAudio.java @@ -0,0 +1,39 @@ +package com.aspose.slides.examples.slides.media; + +import com.aspose.slides.ISlide; +import com.aspose.slides.ISlideShowTransition; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class ExtractAudio +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Media(); + + String presName = dataDir + "AudioSlide.ppt"; + + //ExStart:ExtractAudio + // Instantiate Presentation class that represents the presentation file + Presentation pres = new Presentation(presName); + try { + // Access the desired slide + ISlide slide = pres.getSlides().get_Item(0); + + // Get the slideshow transition effects for slide + ISlideShowTransition transition = slide.getSlideShowTransition(); + + //Extract sound in byte array + byte[] audio = transition.getSound().getBinaryData(); + + System.out.println("Length: " + audio.length); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ExtractAudio + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/media/ExtractAudioFromHyperLink.java b/Examples/src/main/java/com/aspose/slides/examples/slides/media/ExtractAudioFromHyperLink.java new file mode 100644 index 00000000..bdb22f07 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/media/ExtractAudioFromHyperLink.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.slides.media; + +import com.aspose.slides.IHyperlink; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + + +public class ExtractAudioFromHyperLink +{ + public static void main(String[] args) + { + //ExStart:ExtractAudioFromHyperLink + String pptxFile = RunExamples.getDataDir_Slides_Presentations_Media() + "HyperlinkSound.pptx"; + String outMediaPath = RunExamples.getOutPath() + "HyperlinkSound.mpg"; + + Presentation pres = new Presentation(pptxFile); + try { + // Gets the first shape hyperlink + IHyperlink link = pres.getSlides().get_Item(0).getShapes().get_Item(0).getHyperlinkClick(); + + if (link.getSound() != null) { + // Extracts the hyperlink sound in byte array + byte[] audioData = link.getSound().getBinaryData(); + + // Saves effect sound to media file + Files.write(Paths.get(outMediaPath), audioData); + } + } catch(IOException e) { + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ExtractAudioFromHyperLink + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/media/ExtractAudioFromTimeline.java b/Examples/src/main/java/com/aspose/slides/examples/slides/media/ExtractAudioFromTimeline.java new file mode 100644 index 00000000..8bb63d4f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/media/ExtractAudioFromTimeline.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.slides.media; + +import com.aspose.slides.ISequence; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class ExtractAudioFromTimeline +{ + public static void main(String[] args) + { + String pptxFile = RunExamples.getDataDir_Slides_Presentations_Media() + "AnimationAudio.pptx"; + String outMediaPath = RunExamples.getOutPath() + "MediaTimeline.mpg"; + + //ExStart:ExtractAudioFromTimeline + Presentation pres = new Presentation(pptxFile); + try { + // Gets first slide of the presentation + ISlide slide = pres.getSlides().get_Item(0); + + // Gets the effects sequence for the slide + ISequence effectsSequence = slide.getTimeline().getMainSequence(); + + // Extracts the effect sound in byte array + byte[] audio = effectsSequence.get_Item(0).getSound().getBinaryData(); + + // Saves effect sound to media file + Files.write(Paths.get(outMediaPath), audio); + } catch (IOException e){ + e.printStackTrace(); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ExtractAudioFromTimeline + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/media/ExtractVideo.java b/Examples/src/main/java/com/aspose/slides/examples/slides/media/ExtractVideo.java new file mode 100644 index 00000000..f8bc1455 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/media/ExtractVideo.java @@ -0,0 +1,53 @@ +package com.aspose.slides.examples.slides.media; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.FileOutputStream; +import java.io.IOException; + + +public class ExtractVideo +{ + public static void main(String[] args) throws IOException + { + + //ExStart:ExtractVideo + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Media(); + String outPath = RunExamples.getOutPath(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "Video.pptx"); + try { + for (ISlide slide : presentation.getSlides().toArray()) + { + for (IShape shape : slide.getShapes().toArray()) + { + if (shape instanceof VideoFrame) + { + IVideoFrame vf = (IVideoFrame) shape; + String type = vf.getEmbeddedVideo().getContentType(); + int ss = type.lastIndexOf('/'); + type = type.substring(ss + 1); + byte[] buffer = vf.getEmbeddedVideo().getBinaryData(); + FileOutputStream fop = new FileOutputStream(outPath + "NewVideo_out." + type); + try + { + fop.write(buffer); + fop.flush(); + fop.close(); + } + finally + { + if (presentation != null) presentation.dispose(); + } + } + } + } + } finally { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ExtractVideo + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/media/FadeInOutDurationAudioExample.java b/Examples/src/main/java/com/aspose/slides/examples/slides/media/FadeInOutDurationAudioExample.java new file mode 100644 index 00000000..fdcb4c12 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/media/FadeInOutDurationAudioExample.java @@ -0,0 +1,32 @@ +package com.aspose.slides.examples.slides.media; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class FadeInOutDurationAudioExample +{ + public static void main(String[] args) throws IOException + { + String mediaFile = RunExamples.getDataDir_Slides_Presentations_Media() + "audio.m4a"; + String outPath = RunExamples.getOutPath() + "AudioFrameFade_out.pptx"; + + //ExStart:FadeInOutDurationAudioExample + Presentation pres = new Presentation(); + try { + // Add Audio Frame + IAudio audio = pres.getAudios().addAudio(Files.readAllBytes(Paths.get(mediaFile))); + IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio); + // Set the duration of the starting fade for 200ms + audioFrame.setFadeInDuration(200f); + // Set the duration of the ending fade for 500ms + audioFrame.setFadeOutDuration(500f); + pres.save(outPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:FadeInOutDurationAudioExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/media/StopPreviousSoundExample.java b/Examples/src/main/java/com/aspose/slides/examples/slides/media/StopPreviousSoundExample.java new file mode 100644 index 00000000..7ebcb3ad --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/media/StopPreviousSoundExample.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.slides.media; + +import com.aspose.slides.IEffect; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +public class StopPreviousSoundExample +{ + public static void main(String[] args) + { + //ExStart:StopPreviousSoundExample + String pptxFile = RunExamples.getDataDir_Slides_Presentations_Media() + "AnimationStopSound.pptx"; + String outPath = RunExamples.getOutPath() + "AnimationStopSound-out.pptx"; + + Presentation pres = new Presentation(pptxFile); + try { + // Gets the first effect of the first slide. + IEffect firstSlideEffect = pres.getSlides().get_Item(0).getTimeline().getMainSequence().get_Item(0); + + // Gets the first effect of the second slide. + IEffect secondSlideEffect = pres.getSlides().get_Item(1).getTimeline().getMainSequence().get_Item(0); + + if (firstSlideEffect.getSound() != null) + { + // Changes the second effect Enhancements/Sound to "Stop Previous Sound" + secondSlideEffect.setStopPreviousSound(true); + } + pres.save(outPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:StopPreviousSoundExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/media/TrimmingTimeAudioExample.java b/Examples/src/main/java/com/aspose/slides/examples/slides/media/TrimmingTimeAudioExample.java new file mode 100644 index 00000000..618823df --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/media/TrimmingTimeAudioExample.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.slides.media; + +import com.aspose.slides.IAudio; +import com.aspose.slides.IAudioFrame; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class TrimmingTimeAudioExample +{ + public static void main(String[] args) throws IOException + { + String mediaFile = RunExamples.getDataDir_Slides_Presentations_Media() + "audio.m4a"; + String outPath = RunExamples.getOutPath() + "AudioFrameTrim_out.pptx"; + + //ExStart:TrimmingTimeAudioExample + Presentation pres = new Presentation(); + try { + // Add Audio Frame + IAudio audio = pres.getAudios().addAudio(Files.readAllBytes(Paths.get(mediaFile))); + IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio); + // Set the start trimming time 0.5 seconds + audioFrame.setTrimFromStart(500f); + // Set the end trimming time 1 seconds + audioFrame.setTrimFromEnd(1000f); + pres.save(outPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:TrimmingTimeAudioExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/media/VideoCaptionsExample.java b/Examples/src/main/java/com/aspose/slides/examples/slides/media/VideoCaptionsExample.java new file mode 100644 index 00000000..449fd4b3 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/media/VideoCaptionsExample.java @@ -0,0 +1,62 @@ +package com.aspose.slides.examples.slides.media; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class VideoCaptionsExample +{ + public static void main(String[] args) + { + String mediaFile = RunExamples.getDataDir_Slides_Presentations_Media() + "sample_bunny.mp4"; + String trackFile = RunExamples.getDataDir_Slides_Presentations_Media() + "bunny.vtt"; + String outCaption = RunExamples.getOutPath() + "Caption_out.vtt"; + String outAddPath = RunExamples.getOutPath() + "VideoCaptionAdd_out.pptx"; + String outRemovePath = RunExamples.getOutPath() + "VideoCaptionRemove_out.pptx"; + + //ExStart:VideoCaptionsExample + // Add captions to a VideoFrame + Presentation pres = new Presentation(); + try { + IVideo video = pres.getVideos().addVideo(Files.readAllBytes(Paths.get(mediaFile))); + IVideoFrame videoFrame = pres.getSlides().get_Item(0).getShapes().addVideoFrame(0, 0, 100, 100, video); + + // Adds the new captions track from file + videoFrame.getCaptionTracks().add("New track", trackFile); + + pres.save(outAddPath, SaveFormat.Pptx); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (pres != null) pres.dispose(); + } + + // Extract captions from a VideoFrame + Presentation pres1 = new Presentation(outAddPath); + try { + IVideoFrame videoFrame = (IVideoFrame) pres1.getSlides().get_Item(0).getShapes().get_Item(0); + if (videoFrame != null) { + for (ICaptions captionTrack : videoFrame.getCaptionTracks()) { + // Extracts the captions binary data and saves theme to the file + FileOutputStream fos = new FileOutputStream(outCaption); + fos.write(captionTrack.getBinaryData()); + fos.close(); + } + + // Removes all captions from the VideoFrame + videoFrame.getCaptionTracks().clear(); + + pres1.save(outRemovePath, SaveFormat.Pptx); + } + } catch(IOException e) { + e.printStackTrace(); + } finally { + if (pres1 != null) pres1.dispose(); + } + //ExEnd:VideoCaptionsExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/media/VolumeAudioExample.java b/Examples/src/main/java/com/aspose/slides/examples/slides/media/VolumeAudioExample.java new file mode 100644 index 00000000..4fa7b3fb --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/media/VolumeAudioExample.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.slides.media; + +import com.aspose.slides.IAudio; +import com.aspose.slides.IAudioFrame; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class VolumeAudioExample +{ + public static void main(String[] args) throws IOException + { + String mediaFile = RunExamples.getDataDir_Slides_Presentations_Media() + "audio.m4a"; + String outPath = RunExamples.getOutPath() + "AudioFrameValue_out.pptx"; + + //ExStart:VolumeAudioExample + Presentation pres = new Presentation(); + try { + // Add Audio Frame + IAudio audio = pres.getAudios().addAudio(Files.readAllBytes(Paths.get(mediaFile))); + IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio); + // Set the audio volume for 85% + audioFrame.setVolumeValue(85f); + pres.save(outPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:VolumeAudioExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/notes/HeaderAndFooterInNotesSlide.java b/Examples/src/main/java/com/aspose/slides/examples/slides/notes/HeaderAndFooterInNotesSlide.java new file mode 100644 index 00000000..ca312447 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/notes/HeaderAndFooterInNotesSlide.java @@ -0,0 +1,63 @@ +package com.aspose.slides.examples.slides.notes; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class HeaderAndFooterInNotesSlide +{ + public static void main(String[] args) + { + //ExStart:HeaderAndFooterInNotesSlide + String dataDir = RunExamples.getDataDir_Slides_Presentations_Notes(); + Presentation presentation = new Presentation(dataDir + "presentation.pptx"); + try + { + // Change Header and Footer settings for notes master and all notes slides + IMasterNotesSlide masterNotesSlide = presentation.getMasterNotesSlideManager().getMasterNotesSlide(); + if (masterNotesSlide != null) + { + IMasterNotesSlideHeaderFooterManager headerFooterManager = masterNotesSlide.getHeaderFooterManager(); + + headerFooterManager.setHeaderAndChildHeadersVisibility(true); // make the master notes slide and all child Footer placeholders visible + headerFooterManager.setFooterAndChildFootersVisibility(true); // make the master notes slide and all child Header placeholders visible + headerFooterManager.setSlideNumberAndChildSlideNumbersVisibility(true); // make the master notes slide and all child SlideNumber placeholders visible + headerFooterManager.setDateTimeAndChildDateTimesVisibility(true); // make the master notes slide and all child Date and time placeholders visible + + headerFooterManager.setHeaderAndChildHeadersText("Header text"); // set text to master notes slide and all child Header placeholders + headerFooterManager.setFooterAndChildFootersText("Footer text"); // set text to master notes slide and all child Footer placeholders + headerFooterManager.setDateTimeAndChildDateTimesText("Date and time text"); // set text to master notes slide and all child Date and time placeholders + } + + // Change Header and Footer settings for first notes slide only + INotesSlide notesSlide = presentation.getSlides().get_Item(0).getNotesSlideManager().getNotesSlide(); + if (notesSlide != null) + { + INotesSlideHeaderFooterManager headerFooterManager = notesSlide.getHeaderFooterManager(); + if (!headerFooterManager.isHeaderVisible()) + headerFooterManager.setHeaderVisibility(true); // make this notes slide Header placeholder visible + + if (!headerFooterManager.isFooterVisible()) + headerFooterManager.setFooterVisibility(true); // make this notes slide Footer placeholder visible + + if (!headerFooterManager.isSlideNumberVisible()) + headerFooterManager.setSlideNumberVisibility(true); // make this notes slide SlideNumber placeholder visible + + if (!headerFooterManager.isDateTimeVisible()) + headerFooterManager.setDateTimeVisibility(true); // make this notes slide Date-time placeholder visible + + headerFooterManager.setHeaderText("New header text"); // set text to notes slide Header placeholder + headerFooterManager.setFooterText("New footer text"); // set text to notes slide Footer placeholder + headerFooterManager.setDateTimeText("New date and time text"); // set text to notes slide Date-time placeholder + } + presentation.save(dataDir + "testresult.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + + } + + //ExEnd:HeaderAndFooterInNotesSlide +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/notes/RemoveNotesAtSpecificSlide.java b/Examples/src/main/java/com/aspose/slides/examples/slides/notes/RemoveNotesAtSpecificSlide.java new file mode 100644 index 00000000..429e81fb --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/notes/RemoveNotesAtSpecificSlide.java @@ -0,0 +1,30 @@ +package com.aspose.slides.examples.slides.notes; + +import com.aspose.slides.INotesSlideManager; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class RemoveNotesAtSpecificSlide +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Notes(); + + //ExStart:RemoveNotesAtSpecificSlide + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "AccessSlides.pptx"); + + // Removing notes of first slide + INotesSlideManager mgr = presentation.getSlides().get_Item(0).getNotesSlideManager(); + mgr.removeNotesSlide(); + + // Save presentation to disk + presentation.save(dataDir + "RemoveNotesAtSpecificSlide_out.pptx", SaveFormat.Pptx); + + //ExEnd:RemoveNotesAtSpecificSlide + + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/notes/RemoveNotesFromAllSlides.java b/Examples/src/main/java/com/aspose/slides/examples/slides/notes/RemoveNotesFromAllSlides.java new file mode 100644 index 00000000..5d54a155 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/notes/RemoveNotesFromAllSlides.java @@ -0,0 +1,31 @@ +package com.aspose.slides.examples.slides.notes; + +import com.aspose.slides.INotesSlideManager; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class RemoveNotesFromAllSlides +{ + public static void main(String[] args) + { + //ExStart:RemoveNotesFromAllSlides + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Notes(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "AccessSlides.pptx"); + + // Removing notes of all slides + INotesSlideManager mgr = null; + for (int i = 0; i < presentation.getSlides().size(); i++) + { + mgr = presentation.getSlides().get_Item(i).getNotesSlideManager(); + mgr.removeNotesSlide(); + } + // Save presentation to disk + presentation.save(dataDir + "RemoveNotesFromAllSlides_out.pptx", SaveFormat.Pptx); + //ExEnd:RemoveNotesFromAllSlides + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/thumbnail/ThumbnailFromSlide.java b/Examples/src/main/java/com/aspose/slides/examples/slides/thumbnail/ThumbnailFromSlide.java new file mode 100644 index 00000000..c8f5fc8f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/thumbnail/ThumbnailFromSlide.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.slides.thumbnail; + +import com.aspose.slides.IImage; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + + +public class ThumbnailFromSlide +{ + public static void main(String[] args) + { + //ExStart:ThumbnailFromSlide + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Thumbnail(); + String outputDir = RunExamples.getOutPath(); + + // Instantiate a Presentation class that represents the presentation file + Presentation pres = new Presentation(dataDir + "ThumbnailFromSlide.pptx"); + try + { + + // Access the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Create a full scale image + IImage img = sld.getImage(1f, 1f); + + // Save the image to disk in JPEG format + img.save(outputDir + "Thumbnail_out.jpg"); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ThumbnailFromSlide + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/thumbnail/ThumbnailFromSlideInNotes.java b/Examples/src/main/java/com/aspose/slides/examples/slides/thumbnail/ThumbnailFromSlideInNotes.java new file mode 100644 index 00000000..473b9607 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/thumbnail/ThumbnailFromSlideInNotes.java @@ -0,0 +1,45 @@ +package com.aspose.slides.examples.slides.thumbnail; + +import com.aspose.slides.IImage; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class ThumbnailFromSlideInNotes +{ + public static void main(String[] args) + { + //ExStart:ThumbnailFromSlideInNotes + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Thumbnail(); + String outputDir = RunExamples.getOutPath(); + + // Instantiate a Presentation class that represents the presentation file + Presentation pres = new Presentation(dataDir + "ThumbnailFromSlideInNotes.pptx"); + try + { + // Access the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // User defined dimension + int desiredX = 1200; + int desiredY = 800; + + // Getting scaled value of X and Y + float ScaleX = (float) (1.0 / pres.getSlideSize().getSize().getWidth()) * desiredX; + float ScaleY = (float) (1.0 / pres.getSlideSize().getSize().getHeight()) * desiredY; + + + // Create a full scale image + IImage img = sld.getImage(ScaleX, ScaleY); + // Save the image to disk in JPEG format + img.save(outputDir + "Notes_tnail_out.jpg"); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ThumbnailFromSlideInNotes + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/thumbnail/ThumbnailWithUserDefinedDimensions.java b/Examples/src/main/java/com/aspose/slides/examples/slides/thumbnail/ThumbnailWithUserDefinedDimensions.java new file mode 100644 index 00000000..c53c3e9d --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/thumbnail/ThumbnailWithUserDefinedDimensions.java @@ -0,0 +1,47 @@ +package com.aspose.slides.examples.slides.thumbnail; + +import com.aspose.slides.IImage; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class ThumbnailWithUserDefinedDimensions +{ + public static void main(String[] args) + { + // The path to the document's directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Thumbnail(); + String outputDir = RunExamples.getOutPath(); + + //ExStart:ThumbnailWithUserDefinedDimensions + // Instantiate a Presentation class that represents the presentation file + Presentation pres = new Presentation(dataDir + "ThumbnailWithUserDefinedDimensions.pptx"); + try + { + + // Access the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // User defined dimension + int desiredX = 1200; + int desiredY = 800; + + // Getting scaled value of X and Y + float ScaleX = (float) (1.0 / pres.getSlideSize().getSize().getWidth()) * desiredX; + float ScaleY = (float) (1.0 / pres.getSlideSize().getSize().getHeight()) * desiredY; + + + // Create a full scale image + IImage img = sld.getImage(ScaleX, ScaleY); + + // Save the image to disk in JPEG format + img.save(outputDir + "Thumbnail2_out.jpg"); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ThumbnailWithUserDefinedDimensions + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AfterAnimationTypeExample.java b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AfterAnimationTypeExample.java new file mode 100644 index 00000000..05b208af --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AfterAnimationTypeExample.java @@ -0,0 +1,55 @@ +package com.aspose.slides.examples.slides.transitions; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + +public class AfterAnimationTypeExample +{ + public static void main(String[] args) + { + String pptxFileName = RunExamples.getDataDir_Slides_Presentations_LowCode() + "ForEachPortion.pptx"; + + //ExStart:AfterAnimationTypeExample + // The path to the document directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Transitions(); + String outPath = RunExamples.getOutPath() + "AnimationAfterEffect-out.pptx"; + + // Instantiate Presentation class that represents a presentation file + Presentation pres = new Presentation(dataDir + "AnimationAfterEffect.pptx"); + try { + // Add new slide to the presentation + ISlide slide1 = pres.getSlides().addClone(pres.getSlides().get_Item(0)); + // Get the first effect of the first slide + ISequence seq = slide1.getTimeline().getMainSequence(); + // Change the After animation effect to "Hide on Next Mouse Click" + for (IEffect effect : seq) + effect.setAfterAnimationType(AfterAnimationType.HideOnNextMouseClick); + + // Add new slide to the presentation + ISlide slide2 = pres.getSlides().addClone(pres.getSlides().get_Item(0)); + // Get the first effect of the first slide + seq = slide2.getTimeline().getMainSequence(); + // Change the After animation effect type to "Color" + for (IEffect effect : seq) + { + effect.setAfterAnimationType(AfterAnimationType.Color); + effect.getAfterAnimationColor().setColor(Color.GREEN); + } + + // Add new slide to the presentation + ISlide slide3 = pres.getSlides().addClone(pres.getSlides().get_Item(0)); + // Get the first effect of the first slide + seq = slide3.getTimeline().getMainSequence(); + // Change the After animation effect to "Hide After Animation" + for (IEffect effect : seq) + effect.setAfterAnimationType(AfterAnimationType.HideAfterAnimation); + + pres.save(outPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:AfterAnimationTypeExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AnimationDurationSlide.java b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AnimationDurationSlide.java new file mode 100644 index 00000000..9224e7f6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AnimationDurationSlide.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.slides.transitions; + + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +/* +This example demonstrates how to set the duration of the slide transition effect in milliseconds. +*/ + +public class AnimationDurationSlide +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Transitions(); + String outPath = RunExamples.getOutPath() + "AnimationDurationSlidest-out.pptx"; + + //ExStart:AnimationDurationSlide + // Instantiate Presentation class that represents a presentation file + Presentation pres = new Presentation(dataDir + "AnimationDurationSlides.pptx"); + { + for (ISlide slide : pres.getSlides()) + { + // Sets the transition duration to 0.25s + slide.getSlideShowTransition().setDuration(250); + } + + // Save result + pres.save(outPath, SaveFormat.Pptx); + } + //ExEnd:AnimationDurationSlide + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AnimationFadedZoomSubtype.java b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AnimationFadedZoomSubtype.java new file mode 100644 index 00000000..90fc1caa --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AnimationFadedZoomSubtype.java @@ -0,0 +1,43 @@ +package com.aspose.slides.examples.slides.transitions; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class AnimationFadedZoomSubtype +{ + public static void main(String[] args) + { + String outPres = RunExamples.getOutPath() + "AnimationFadedZoom-out.pptx"; + + //ExStart:AnimationFadedZoomSubtype + // Instantiate Presentation class that represents a presentation file + Presentation pres = new Presentation(); + try { + // Create shapes for demonstration + IAutoShape shp1 = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, + 0, + 0, + 50, + 50); + IAutoShape shp2 = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, + 100, + 0, + 50, + 50); + // Add FadedZoom effects + IEffect ef1 = pres.getSlides().get_Item(0).getTimeline().getMainSequence().addEffect(shp1, + EffectType.FadedZoom, + EffectSubtype.ObjectCenter, + EffectTriggerType.OnClick); + IEffect ef2 = pres.getSlides().get_Item(0).getTimeline().getMainSequence().addEffect(shp2, + EffectType.FadedZoom, + EffectSubtype.SlideCenter, + EffectTriggerType.OnClick); + // Save presentation + pres.save(outPres, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:AnimationFadedZoomSubtype + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AnimationRepeatOnSlide.java b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AnimationRepeatOnSlide.java new file mode 100644 index 00000000..910ce4ae --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AnimationRepeatOnSlide.java @@ -0,0 +1,39 @@ +package com.aspose.slides.examples.slides.transitions; + +import com.aspose.slides.IEffect; +import com.aspose.slides.ISequence; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +public class AnimationRepeatOnSlide +{ + public static void main(String[] args) + { + // The path to the document directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Transitions(); + String outDir = RunExamples.getOutPath(); + + //ExStart:AnimationRepeatOnSlide + // Instantiate Presentation class that represents a presentation file + Presentation pres = new Presentation(dataDir + "AnimationOnSlide.pptx"); + try { + // Gets the effects sequence for the first slide + ISequence effectsSequence = pres.getSlides().get_Item(0).getTimeline().getMainSequence(); + + // Gets the first effect of the main sequence. + IEffect effect = effectsSequence.get_Item(0); + + // Changes the effect Timing/Repeat to "Until End of Slide" + effect.getTiming().setRepeatUntilEndSlide(true); + + // Changes the effect Timing/Repeat to "Until End of Slide" + effect.getTiming().setRepeatUntilNextClick(true); + // Save presentation + pres.save(outDir + "AnimationOnSlide-out.pptx", SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:AnimationRepeatOnSlide + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AnimationRewind.java b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AnimationRewind.java new file mode 100644 index 00000000..4a655c6b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/AnimationRewind.java @@ -0,0 +1,46 @@ +package com.aspose.slides.examples.slides.transitions; + +import com.aspose.slides.IEffect; +import com.aspose.slides.ISequence; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +public class AnimationRewind +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Transitions(); + + // Instantiate Presentation class that represents a presentation file + Presentation presentation = new Presentation(dataDir + "AnimationRewind.pptx"); + try { + // Gets the effects sequence for the first slide + ISequence effectsSequence = presentation.getSlides().get_Item(0).getTimeline().getMainSequence(); + + // Gets the first effect of the main sequence. + IEffect effect = effectsSequence.get_Item(0); + System.out.println("Effect Timing/Rewind in source presentation is " + effect.getTiming().getRewind()); + // Turns the effect Timing/Rewind on. + effect.getTiming().setRewind(true); + + // Save presentation + presentation.save(RunExamples.getOutPath() + "AnimationRewind-out.pptx", SaveFormat.Pptx); + } finally { + if (presentation != null) presentation.dispose(); + } + + Presentation pres = new Presentation(RunExamples.getOutPath() + "AnimationRewind-out.pptx"); + try { + // Gets the effects sequence for the first slide + ISequence effectsSequence = pres.getSlides().get_Item(0).getTimeline().getMainSequence(); + + // Gets the first effect of the main sequence. + IEffect effect = effectsSequence.get_Item(0); + System.out.println("Effect Timing/Rewind in destination presentation is " + effect.getTiming().getRewind()); + } finally { + if (pres != null) pres.dispose(); + } + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/BetterSlideTransitions.java b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/BetterSlideTransitions.java new file mode 100644 index 00000000..6d12e17c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/BetterSlideTransitions.java @@ -0,0 +1,55 @@ +package com.aspose.slides.examples.slides.transitions; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.TransitionType; +import com.aspose.slides.examples.RunExamples; + + +public class BetterSlideTransitions +{ + public static void main(String[] args) + { + //ExStart:BetterSlideTransitions + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Transitions(); + + // Instantiate Presentation class that represents a presentation file + Presentation pres = new Presentation(dataDir + "BetterSlideTransitions.pptx"); + try + { + + // Apply circle type transition on slide 1 + pres.getSlides().get_Item(0).getSlideShowTransition().setType(TransitionType.Circle); + + + // Set the transition time of 3 seconds + pres.getSlides().get_Item(0).getSlideShowTransition().setAdvanceOnClick(true); + pres.getSlides().get_Item(0).getSlideShowTransition().setAdvanceAfterTime(3000); + + // Apply comb type transition on slide 2 + pres.getSlides().get_Item(1).getSlideShowTransition().setType(TransitionType.Comb); + + + // Set the transition time of 5 seconds + pres.getSlides().get_Item(1).getSlideShowTransition().setAdvanceOnClick(true); + pres.getSlides().get_Item(1).getSlideShowTransition().setAdvanceAfterTime(5000); + + // Apply zoom type transition on slide 3 + pres.getSlides().get_Item(2).getSlideShowTransition().setType(TransitionType.Zoom); + + + // Set the transition time of 7 seconds + pres.getSlides().get_Item(2).getSlideShowTransition().setAdvanceOnClick(true); + pres.getSlides().get_Item(2).getSlideShowTransition().setAdvanceAfterTime(7000); + + // Write the presentation to disk + pres.save(dataDir + "SampleTransition_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:BetterSlideTransitions + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/ManageSimpleSlideTransitions.java b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/ManageSimpleSlideTransitions.java new file mode 100644 index 00000000..8a3360a1 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/ManageSimpleSlideTransitions.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.slides.transitions; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.TransitionType; +import com.aspose.slides.examples.RunExamples; + + +public class ManageSimpleSlideTransitions +{ + public static void main(String[] args) + { + //ExStart:ManageSimpleSlideTransitions + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Transitions(); + final String outPath = RunExamples.getOutPath(); + + // Instantiate Presentation class to load the source presentation file + Presentation presentation = new Presentation(dataDir + "AccessSlides.pptx"); + try + { + // Apply circle type transition on slide 1 + presentation.getSlides().get_Item(0).getSlideShowTransition().setType(TransitionType.Circle); + + // Apply comb type transition on slide 2 + presentation.getSlides().get_Item(1).getSlideShowTransition().setType(TransitionType.Comb); + + // Write the presentation to disk + presentation.save(outPath + "SampleTransition_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ManageSimpleSlideTransitions + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/ManagingBetterSlideTransitions.java b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/ManagingBetterSlideTransitions.java new file mode 100644 index 00000000..606d4300 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/ManagingBetterSlideTransitions.java @@ -0,0 +1,47 @@ +package com.aspose.slides.examples.slides.transitions; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.TransitionType; +import com.aspose.slides.examples.RunExamples; + + +public class ManagingBetterSlideTransitions +{ + public static void main(String[] args) + { + //ExStart:ManagingBetterSlideTransitions + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Transitions(); + + // Instantiate Presentation class to load the source presentation file + Presentation presentation = new Presentation(dataDir + "AccessSlides.pptx"); + try + { + // Apply circle type transition on slide 1 + presentation.getSlides().get_Item(0).getSlideShowTransition().setType(TransitionType.Circle); + + // Set the transition time of 3 seconds + presentation.getSlides().get_Item(0).getSlideShowTransition().setAdvanceOnClick(true); + presentation.getSlides().get_Item(0).getSlideShowTransition().setAdvanceAfterTime(3000); + + // Apply comb type transition on slide 2 + presentation.getSlides().get_Item(1).getSlideShowTransition().setType(TransitionType.Comb); + + // Set the transition time of 5 seconds + presentation.getSlides().get_Item(1).getSlideShowTransition().setAdvanceOnClick(true); + presentation.getSlides().get_Item(1).getSlideShowTransition().setAdvanceAfterTime(5000); + + // Write the presentation to disk + presentation.save("SampleTransition_out.pptx", SaveFormat.Pptx); + + // Write the presentation to disk + presentation.save(dataDir + "BetterTransitions_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ManagingBetterSlideTransitions + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/SetTransitionEffects.java b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/SetTransitionEffects.java new file mode 100644 index 00000000..1b1d5113 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/SetTransitionEffects.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.slides.transitions; + +import com.aspose.slides.OptionalBlackTransition; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.TransitionType; +import com.aspose.slides.examples.RunExamples; + + +public class SetTransitionEffects +{ + public static void main(String[] args) + { + //ExStart:SetTransitionEffects + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Transitions(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(dataDir + "AccessSlides.pptx"); + try + { + // Set effect + presentation.getSlides().get_Item(0).getSlideShowTransition().setType(TransitionType.Cut); + ((OptionalBlackTransition) presentation.getSlides().get_Item(0).getSlideShowTransition().getValue()).setFromBlack(true); + + // Write the presentation to disk + presentation.save(dataDir + "SetTransitionEffects_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SetTransitionEffects + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/SetTransitionMorphType.java b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/SetTransitionMorphType.java new file mode 100644 index 00000000..f98970d0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/SetTransitionMorphType.java @@ -0,0 +1,30 @@ +package com.aspose.slides.examples.slides.transitions; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetTransitionMorphType +{ + public static void main(String[] args) + { + + //ExStart:SetTransitionMorphType + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Transitions(); + + Presentation presentation = new Presentation(dataDir + "presentation.pptx"); + try + { + presentation.getSlides().get_Item(0).getSlideShowTransition().setType(TransitionType.Morph); + ((IMorphTransition) presentation.getSlides().get_Item(0).getSlideShowTransition().getValue()).setMorphType(TransitionMorphType.ByWord); + presentation.save(dataDir + "presentation-out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SetTransitionMorphType + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/SimpleSlideTransitions.java b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/SimpleSlideTransitions.java new file mode 100644 index 00000000..867021c0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/SimpleSlideTransitions.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.slides.transitions; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.TransitionType; +import com.aspose.slides.examples.RunExamples; + + +public class SimpleSlideTransitions +{ + public static void main(String[] args) + { + //ExStart:SimpleSlideTransitions + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Transitions(); + + // Instantiate Presentation class that represents a presentation file + Presentation pres = new Presentation(dataDir + "SimpleSlideTransitions.pptx"); + try + { + + // Apply circle type transition on slide 1 + pres.getSlides().get_Item(0).getSlideShowTransition().setType(TransitionType.Circle); + + // Apply comb type transition on slide 2 + pres.getSlides().get_Item(1).getSlideShowTransition().setType(TransitionType.Comb); + + // Write the presentation to disk + pres.save(dataDir + "SampleTransition_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SimpleSlideTransitions + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/SupportOfMorphTransition.java b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/SupportOfMorphTransition.java new file mode 100644 index 00000000..12a1c285 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/transitions/SupportOfMorphTransition.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.slides.transitions; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SupportOfMorphTransition +{ + public static void main(String[] args) + { + //ExStart:SupportOfMorphTransition + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Presentations_Transitions(); + + Presentation presentation = new Presentation(); + try + { + AutoShape autoshape = (AutoShape) presentation.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 400, 100); + autoshape.getTextFrame().setText("Test text"); + + presentation.getSlides().addClone(presentation.getSlides().get_Item(0)); + + IShape shape = presentation.getSlides().get_Item(1).getShapes().get_Item(0); + shape.setX(shape.getX() + 100); + shape.setY(shape.getY() + 50); + shape.setWidth(shape.getWidth() - 200); + shape.setHeight(shape.getHeight() - 10); + + presentation.getSlides().get_Item(1).getSlideShowTransition().setType(com.aspose.slides.TransitionType.Morph); + + presentation.save(dataDir + "presentation-out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + + //ExEnd:SupportOfMorphTransition + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/views/GradientStyleRendering.java b/Examples/src/main/java/com/aspose/slides/examples/slides/views/GradientStyleRendering.java new file mode 100644 index 00000000..4abcc764 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/views/GradientStyleRendering.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.slides.views; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class GradientStyleRendering +{ + public static void main(String[] args) + { + // The path to the documents directory. + String presentationName = RunExamples.getDataDir_Slides_Views() + "GradientStyleExample.pptx"; + String outPath = RunExamples.getOutPath() + "GradientStyleExample-out.png"; + + //ExStart:GradientStyleRendering + Presentation pres = new Presentation(presentationName); + try { + RenderingOptions options = new RenderingOptions(); + + // Set rendering the two-color gradient according to its appearance in the PowerPoint user interface. + options.setGradientStyle(GradientStyle.PowerPointUI); + + // Get the image. + IImage img = pres.getSlides().get_Item(0).getImage(options, 2f, 2f); + + // Save image. + img.save(outPath, ImageFormat.Png); + } finally { + if (pres != null) pres.dispose(); + } + + //ExEnd:GradientStyleRendering + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/slides/views/ManagePresenetationNormalViewState.java b/Examples/src/main/java/com/aspose/slides/examples/slides/views/ManagePresenetationNormalViewState.java new file mode 100644 index 00000000..ec72bb69 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/slides/views/ManagePresenetationNormalViewState.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.slides.views; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.SplitterBarStateType; +import com.aspose.slides.examples.RunExamples; + + +public class ManagePresenetationNormalViewState +{ + public static void main(String[] args) + { + + //ExStart:ManagePresenetationNormalViewState + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Slides_Views(); + + Presentation pres = new Presentation(); + try + { + pres.getViewProperties().getNormalViewProperties().setHorizontalBarState(SplitterBarStateType.Restored); + pres.getViewProperties().getNormalViewProperties().setVerticalBarState(SplitterBarStateType.Maximized); + + pres.getViewProperties().getNormalViewProperties().getRestoredTop().setAutoAdjust(true); + pres.getViewProperties().getNormalViewProperties().getRestoredTop().setDimensionSize(80); + pres.getViewProperties().getNormalViewProperties().setShowOutlineIcons(true); + + pres.save(dataDir + "presentation_normal_view_state.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:ManagePresenetationNormalViewState + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessChildNodeSpecificPosition.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessChildNodeSpecificPosition.java new file mode 100644 index 00000000..401e017f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessChildNodeSpecificPosition.java @@ -0,0 +1,43 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class AccessChildNodeSpecificPosition +{ + public static void main(String[] args) + { + //ExStart:AccessChildNodeSpecificPosition + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate the presentation + Presentation pres = new Presentation(); + + // Accessing the first slide + ISlide slide = pres.getSlides().get_Item(0); + + // Adding the SmartArt shape in first slide + ISmartArt smart = slide.getShapes().addSmartArt(0, 0, 400, 400, SmartArtLayoutType.StackedList); + + // Accessing the SmartArt node at index 0 + ISmartArtNode node = smart.getAllNodes().get_Item(0); + + // Accessing the child node at position 1 in parent node + int position = 1; + SmartArtNode chNode = (SmartArtNode) node.getChildNodes().get_Item(position); + + // Printing the SmartArt child node parameters + String outString = String.format("j = {0},.Text{1}, Level = {2}, Position = {3}", position, chNode.getTextFrame().getText(), chNode.getLevel(), chNode.getPosition()); + System.out.println(outString); + //ExEnd:AccessChildNodeSpecificPosition + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessChildNodes.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessChildNodes.java new file mode 100644 index 00000000..df3aba14 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessChildNodes.java @@ -0,0 +1,56 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AccessChildNodes +{ + public static void main(String[] args) + { + //ExStart:AccessChildNodes + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + // Load the desired the presentation + Presentation pres = new Presentation(dataDir + "AccessChildNodes.pptx"); + try + { + // Traverse through every shape inside first slide + for (IShape shape : pres.getSlides().get_Item(0).getShapes()) + { + + // Check if shape is of SmartArt type + if (shape instanceof SmartArt) + { + + // Typecast shape to SmartArt + ISmartArt smart = (ISmartArt) shape; + + // Traverse through all nodes inside SmartArt + for (int i = 0; i < smart.getAllNodes().size(); i++) + { + // Accessing SmartArt node at index i + ISmartArtNode node0 = (ISmartArtNode) smart.getAllNodes().get_Item(i); + + // Traversing through the child nodes in SmartArt node at index i + for (int j = 0; j < node0.getChildNodes().size(); j++) + { + // Accessing the child node in SmartArt node + ISmartArtNode node = (ISmartArtNode) node0.getChildNodes().get_Item(j); + + // Printing the SmartArt child node parameters + String outString = String.format("j = {0},.Text{1}, Level = {2}, Position = {3}", j, node.getTextFrame().getText(), node.getLevel(), node.getPosition()); + System.out.println(outString); + } + } + } + } + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AccessChildNodes + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessSmartArt.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessSmartArt.java new file mode 100644 index 00000000..60bc9e72 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessSmartArt.java @@ -0,0 +1,51 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.IShape; +import com.aspose.slides.ISmartArt; +import com.aspose.slides.ISmartArtNode; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class AccessSmartArt +{ + public static void main(String[] args) + { + //ExStart:AccessSmartArt + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + // Load the desired the presentation + Presentation pres = new Presentation(dataDir + "AccessSmartArt.pptx"); + try + { + // Traverse through every shape inside first slide + for (IShape shape : pres.getSlides().get_Item(0).getShapes()) + { + // Check if shape is of SmartArt type + if (shape instanceof ISmartArt) + { + + // Typecast shape to SmartArt + ISmartArt smart = (ISmartArt) shape; + + // Traverse through all nodes inside SmartArt + for (int i = 0; i < smart.getAllNodes().size(); i++) + { + // Accessing SmartArt node at index i + ISmartArtNode node = (ISmartArtNode) smart.getAllNodes().get_Item(i); + + // Printing the SmartArt node parameters + String outString = String.format("i = {0},.Text{1}, Level = {2}, Position = {3}", i, node.getTextFrame().getText(), node.getLevel(), node.getPosition()); + System.out.println(outString); + } + } + } + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AccessSmartArt + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessSmartArtParticularLayout.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessSmartArtParticularLayout.java new file mode 100644 index 00000000..4fea7952 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessSmartArtParticularLayout.java @@ -0,0 +1,45 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.IShape; +import com.aspose.slides.Presentation; +import com.aspose.slides.SmartArt; +import com.aspose.slides.SmartArtLayoutType; +import com.aspose.slides.examples.RunExamples; + + +public class AccessSmartArtParticularLayout +{ + public static void main(String[] args) + { + //ExStart:AccessSmartArtParticularLayout + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + Presentation presentation = new Presentation(dataDir + "AccessSmartArtShape.pptx"); + try + { + // Traverse through every shape inside first slide + for (IShape shape : presentation.getSlides().get_Item(0).getShapes()) + { + // Check if shape is of SmartArt type + if (shape instanceof SmartArt) + { + // Typecast shape to SmartArtEx + SmartArt smart = (SmartArt) shape; + + // Checking SmartArt Layout + if (smart.getLayout() == SmartArtLayoutType.BasicBlockList) + { + System.out.println("Do some thing here...."); + } + } + } + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AccessSmartArtParticularLayout + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessSmartArtShape.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessSmartArtShape.java new file mode 100644 index 00000000..5f94e3bd --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AccessSmartArtShape.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.IShape; +import com.aspose.slides.ISmartArt; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class AccessSmartArtShape +{ + public static void main(String[] args) + { + //ExStart:AccessSmartArtShape + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + // Load the desired the presentation + Presentation pres = new Presentation(dataDir + "AccessSmartArtShape.pptx"); + try + { + + // Traverse through every shape inside first slide + for (IShape shape : pres.getSlides().get_Item(0).getShapes()) + { + // Check if shape is of SmartArt type + if (shape instanceof ISmartArt) + { + // Typecast shape to SmartArtEx + ISmartArt smart = (ISmartArt) shape; + System.out.println("Shape Name:" + smart.getName()); + + } + } + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AccessSmartArtShape + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/AddNodes.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AddNodes.java new file mode 100644 index 00000000..9c738125 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AddNodes.java @@ -0,0 +1,55 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AddNodes +{ + public static void main(String[] args) + { + //ExStart:AddNodes + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + // Load the desired the presentation// Load the desired the presentation + Presentation pres = new Presentation(dataDir + "AddNodes.pptx"); + try + { + // Traverse through every shape inside first slide + for (IShape shape : pres.getSlides().get_Item(0).getShapes()) + { + + // Check if shape is of SmartArt type + if (shape instanceof ISmartArt) + { + + // Typecast shape to SmartArt + ISmartArt smart = (ISmartArt) shape; + + // Adding a new SmartArt Node + ISmartArtNode TemNode = (ISmartArtNode) smart.getAllNodes().addNode(); + + // Adding text + TemNode.getTextFrame().setText("Test"); + + // Adding new child node in parent node. It will be added in the end of collection + ISmartArtNode newNode = (ISmartArtNode) TemNode.getChildNodes().addNode(); + + // Adding text + newNode.getTextFrame().setText("New Node Added"); + + } + } + + // Saving Presentation + pres.save(dataDir + "AddSmartArtNode_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + + } + //ExEnd:AddNodes + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/AddNodesSpecificPosition.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AddNodesSpecificPosition.java new file mode 100644 index 00000000..0fa736db --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AddNodesSpecificPosition.java @@ -0,0 +1,50 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class AddNodesSpecificPosition +{ + public static void main(String[] args) + { + //ExStart:AddNodesSpecificPosition + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Creating a presentation instance + Presentation pres = new Presentation(); + try + { + // Access the presentation slide + ISlide slide = pres.getSlides().get_Item(0); + + // Add Smart Art IShape + ISmartArt smart = slide.getShapes().addSmartArt(0, 0, 400, 400, SmartArtLayoutType.StackedList); + + // Accessing the SmartArt node at index 0 + ISmartArtNode node = smart.getAllNodes().get_Item(0); + + // Adding new child node at position 2 in parent node + SmartArtNode chNode = (SmartArtNode) ((SmartArtNodeCollection) node.getChildNodes()).addNodeByPosition(2); + + // Add Text + chNode.getTextFrame().setText("Sample Text Added"); + + // Save Presentation + pres.save(dataDir + "AddSmartArtNodeByPosition_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AddNodesSpecificPosition + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/AssistantNode.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AssistantNode.java new file mode 100644 index 00000000..4758d3c2 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/AssistantNode.java @@ -0,0 +1,49 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class AssistantNode +{ + public static void main(String[] args) + { + //ExStart:AssistantNode + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + // Creating a presentation instance + Presentation pres = new Presentation(dataDir + "AssistantNode.pptx"); + try + { + // Traverse through every shape inside first slide + for (IShape shape : pres.getSlides().get_Item(0).getShapes()) + { + // Check if shape is of SmartArt type + if (shape instanceof ISmartArt) + { + // Typecast shape to SmartArtEx + ISmartArt smart = (ISmartArt) shape; + // Traversing through all nodes of SmartArt shape + + for (ISmartArtNode node : smart.getAllNodes()) + { + String tc = node.getTextFrame().getText(); + // Check if node is Assitant node + if (node.isAssistant()) + { + // Setting Assitant node to false and making it normal node + node.setAssistant(false); + } + } + } + } + // Save Presentation + pres.save(dataDir + "ChangeAssitantNode_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:AssistantNode + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/BulletFillFormat.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/BulletFillFormat.java new file mode 100644 index 00000000..3ffd62ce --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/BulletFillFormat.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class BulletFillFormat +{ + public static void main(String[] args) + { + + //ExStart:BulletFillFormat + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + String outputDir = RunExamples.getOutPath(); + + Presentation presentation = new Presentation(); + try + { + ISmartArt smart = presentation.getSlides().get_Item(0).getShapes().addSmartArt(10, 10, 500, 400, SmartArtLayoutType.VerticalPictureList); + ISmartArtNode node = smart.getAllNodes().get_Item(0); + + if (node.getBulletFillFormat() != null) + { + IImage img = Images.fromFile(dataDir + "aspose-logo.jpg"); + IPPImage image = presentation.getImages().addImage(img); + node.getBulletFillFormat().setFillType(FillType.Picture); + node.getBulletFillFormat().getPictureFillFormat().getPicture().setImage(image); + node.getBulletFillFormat().getPictureFillFormat().setPictureFillMode(PictureFillMode.Stretch); + } + presentation.save(outputDir + "out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:BulletFillFormat + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangSmartArtShapeStyle.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangSmartArtShapeStyle.java new file mode 100644 index 00000000..785689a4 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangSmartArtShapeStyle.java @@ -0,0 +1,46 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ChangSmartArtShapeStyle +{ + public static void main(String[] args) + { + //ExStart:ChangSmartArtShapeStyle + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + Presentation presentation = new Presentation(dataDir + "AccessSmartArtShape.pptx"); + try + { + // Traverse through every shape inside first slide + for (IShape shape : presentation.getSlides().get_Item(0).getShapes()) + { + // Check if shape is of SmartArt type + if (shape instanceof ISmartArt) + { + // Typecast shape to SmartArtEx + ISmartArt smart = (ISmartArt) shape; + + // Checking SmartArt style + if (smart.getQuickStyle() == SmartArtQuickStyleType.SimpleFill) + { + // Changing SmartArt Style + smart.setQuickStyle(SmartArtQuickStyleType.Cartoon); + } + } + } + + // Saving Presentation + presentation.save(dataDir + "ChangeSmartArtStyle_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ChangSmartArtShapeStyle + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangeSmartArtLayout.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangeSmartArtLayout.java new file mode 100644 index 00000000..a20dd58d --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangeSmartArtLayout.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.ISmartArt; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.SmartArtLayoutType; +import com.aspose.slides.examples.RunExamples; + + +public class ChangeSmartArtLayout +{ + public static void main(String[] args) + { + //ExStart:ChangeSmartArtLayout + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + Presentation presentation = new Presentation(); + try + { + // Add SmartArt BasicProcess + ISmartArt smart = presentation.getSlides().get_Item(0).getShapes().addSmartArt(10, 10, 400, 300, SmartArtLayoutType.BasicBlockList); + + // Change LayoutType to BasicProcess + smart.setLayout(SmartArtLayoutType.BasicProcess); + + // Saving Presentation + presentation.save(dataDir + "ChangeSmartArtLayout_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ChangeSmartArtLayout + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangeSmartArtShapeColorStyle.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangeSmartArtShapeColorStyle.java new file mode 100644 index 00000000..93ed9103 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangeSmartArtShapeColorStyle.java @@ -0,0 +1,46 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ChangeSmartArtShapeColorStyle +{ + public static void main(String[] args) + { + //ExStart:ChangeSmartArtShapeColorStyle + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + Presentation presentation = new Presentation(dataDir + "AccessSmartArtShape.pptx"); + try + { + // Traverse through every shape inside first slide + for (IShape shape : presentation.getSlides().get_Item(0).getShapes()) + { + // Check if shape is of SmartArt type + if (shape instanceof ISmartArt) + { + // Typecast shape to SmartArtEx + ISmartArt smart = (ISmartArt) shape; + + // Checking SmartArt color type + if (smart.getColorStyle() == SmartArtColorType.ColoredFillAccent1) + { + // Changing SmartArt color type + smart.setColorStyle(SmartArtColorType.ColorfulAccentColors); + } + } + } + + // Saving Presentation + presentation.save(dataDir + "ChangeSmartArtColorStyle_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ChangeSmartArtShapeColorStyle + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangeSmartArtState.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangeSmartArtState.java new file mode 100644 index 00000000..1057ffa8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangeSmartArtState.java @@ -0,0 +1,39 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.ISmartArt; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.SmartArtLayoutType; +import com.aspose.slides.examples.RunExamples; + + +public class ChangeSmartArtState +{ + public static void main(String[] args) + { + //ExStart:ChangeSmartArtState + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + Presentation presentation = new Presentation(); + try + { + // Add SmartArt BasicProcess + ISmartArt smart = presentation.getSlides().get_Item(0).getShapes().addSmartArt(10, 10, 400, 300, SmartArtLayoutType.BasicProcess); + + // Get or Set the state of SmartArt Diagram + smart.setReversed(true); + boolean flag = smart.isReversed(); + + // Saving Presentation + presentation.save(dataDir + "ChangeSmartArtState_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ChangeSmartArtState + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangeTextOnSmartArtNode.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangeTextOnSmartArtNode.java new file mode 100644 index 00000000..446bbe8d --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/ChangeTextOnSmartArtNode.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ChangeTextOnSmartArtNode +{ + public static void main(String[] args) + { + //ExStart:ChangeTextOnSmartArtNode + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + Presentation presentation = new Presentation(); + try + { + // Add SmartArt BasicProcess + ISmartArt smart = presentation.getSlides().get_Item(0).getShapes().addSmartArt(10, 10, 400, 300, SmartArtLayoutType.BasicCycle); + + // Obtain the reference of a node by using its Index + ISmartArtNode node = smart.getNodes().get_Item(1); // select second root node + + // Setting the text of the TextFrame + node.getTextFrame().setText("Second root node"); + + // Saving Presentation + presentation.save(dataDir + "ChangeText_On_SmartArt_Node_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ChangeTextOnSmartArtNode + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/CheckSmartArtHiddenProperty.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/CheckSmartArtHiddenProperty.java new file mode 100644 index 00000000..df860670 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/CheckSmartArtHiddenProperty.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class CheckSmartArtHiddenProperty +{ + public static void main(String[] args) + { + //ExStart:CheckSmartArtHiddenProperty + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + Presentation presentation = new Presentation(); + try + { + // Add SmartArt BasicProcess + ISmartArt smart = presentation.getSlides().get_Item(0).getShapes().addSmartArt(10, 10, 400, 300, SmartArtLayoutType.RadialCycle); + + // Add node on SmartArt + ISmartArtNode node = smart.getAllNodes().addNode(); + + // Check isHidden property + boolean hidden = node.isHidden(); // Returns true + + if (hidden) + { + // Do some actions or notifications + } + // Saving Presentation + presentation.save(dataDir + "CheckSmartArtHiddenProperty_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:CheckSmartArtHiddenProperty + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/CreateSmartArtShape.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/CreateSmartArtShape.java new file mode 100644 index 00000000..57cdadeb --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/CreateSmartArtShape.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class CreateSmartArtShape +{ + public static void main(String[] args) + { + //ExStart:CreateSmartArtShape + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + // Instantiate the presentation + Presentation pres = new Presentation(); + try + { + + // Access the presentation slide + ISlide slide = pres.getSlides().get_Item(0); + + // Add Smart Art Shape + ISmartArt smart = slide.getShapes().addSmartArt(0, 0, 400, 400, SmartArtLayoutType.BasicBlockList); + + // Saving presentation + pres.save(dataDir + "SimpleSmartArt_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:CreateSmartArtShape + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/CustomChildNodesInSmartArt.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/CustomChildNodesInSmartArt.java new file mode 100644 index 00000000..c292f88f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/CustomChildNodesInSmartArt.java @@ -0,0 +1,49 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class CustomChildNodesInSmartArt +{ + public static void main(String[] args) + { + //ExStart:CustomChildNodesInSmartArt + String dataDir = RunExamples.getDataDir_SmartArts(); + + // Load the desired the presentation + Presentation pres = new Presentation(dataDir + "AccessChildNodes.pptx"); + try + { + ISmartArt smart = pres.getSlides().get_Item(0).getShapes().addSmartArt(20, 20, 600, 500, SmartArtLayoutType.OrganizationChart); + + // Move SmartArt shape to new position + ISmartArtNode node = smart.getAllNodes().get_Item(1); + ISmartArtShape shape = node.getShapes().get_Item(1); + shape.setX(shape.getX() + (shape.getWidth() * 2)); + shape.setY(shape.getY() - (shape.getHeight() / 2)); + + // Change SmartArt shape's widths + node = smart.getAllNodes().get_Item(2); + shape = node.getShapes().get_Item(1); + shape.setWidth(shape.getWidth() + (shape.getWidth() / 2)); + + // Change SmartArt shape's height + node = smart.getAllNodes().get_Item(3); + shape = node.getShapes().get_Item(1); + shape.setHeight(shape.getHeight() + (shape.getHeight() / 2)); + + // Change SmartArt shape's rotation + node = smart.getAllNodes().get_Item(4); + shape = node.getShapes().get_Item(1); + shape.setRotation(90); + + pres.save(dataDir + "SmartArt.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:CustomChildNodesInSmartArt + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/FillFormatSmartArtShapeNode.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/FillFormatSmartArtShapeNode.java new file mode 100644 index 00000000..c6b1ad02 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/FillFormatSmartArtShapeNode.java @@ -0,0 +1,45 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class FillFormatSmartArtShapeNode +{ + public static void main(String[] args) + { + //ExStart.getFillFormat().martArtShapeNode + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + Presentation presentation = new Presentation(); + try + { + // Accessing the slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Adding SmartArt shape and nodes + ISmartArt chevron = slide.getShapes().addSmartArt(10, 10, 800, 60, SmartArtLayoutType.ClosedChevronProcess); + ISmartArtNode node = chevron.getAllNodes().addNode(); + node.getTextFrame().setText("Some text"); + + // Setting node fill color + for (ISmartArtShape item : node.getShapes()) + { + item.getFillFormat().setFillType(FillType.Solid); + item.getFillFormat().getSolidFillColor().setColor(Color.RED); + } + + // Saving Presentation + presentation.save(dataDir + "FillFormat_SmartArt_ShapeNode_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd.getFillFormat().martArtShapeNode + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/OrganizeChartLayoutType.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/OrganizeChartLayoutType.java new file mode 100644 index 00000000..47160b65 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/OrganizeChartLayoutType.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class OrganizeChartLayoutType +{ + public static void main(String[] args) + { + //ExStart:OrganizeChartLayoutType + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + Presentation presentation = new Presentation(); + try + { + // Add SmartArt BasicProcess + ISmartArt smart = presentation.getSlides().get_Item(0).getShapes().addSmartArt(10, 10, 400, 300, SmartArtLayoutType.OrganizationChart); + + // Get or Set the organization chart type + smart.getNodes().get_Item(0).setOrganizationChartLayout(OrganizationChartLayoutType.LeftHanging); + + // Saving Presentation + presentation.save(dataDir + "OrganizeChartLayoutType_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:OrganizeChartLayoutType + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/RemoveNode.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/RemoveNode.java new file mode 100644 index 00000000..6a3665ed --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/RemoveNode.java @@ -0,0 +1,50 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class RemoveNode +{ + public static void main(String[] args) + { + //ExStart:RemoveNode + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + // Load the desired the presentation + Presentation pres = new Presentation(dataDir + "RemoveNode.pptx"); + try + { + + // Traverse through every shape inside first slide + for (IShape shape : pres.getSlides().get_Item(0).getShapes()) + { + + // Check if shape is of SmartArt type + if (shape instanceof ISmartArt) + { + // Typecast shape to SmartArtEx + ISmartArt smart = (ISmartArt) shape; + + if (smart.getAllNodes().size() > 0) + { + // Accessing SmartArt node at index 0 + ISmartArtNode node = smart.getAllNodes().get_Item(0); + + // Removing the selected node + smart.getAllNodes().removeNode(node); + + } + } + } + + // Save Presentation + pres.save(dataDir + "RemoveSmartArtNode_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:RemoveNode + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/smartarts/RemoveNodeSpecificPosition.java b/Examples/src/main/java/com/aspose/slides/examples/smartarts/RemoveNodeSpecificPosition.java new file mode 100644 index 00000000..941fe6ab --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/smartarts/RemoveNodeSpecificPosition.java @@ -0,0 +1,52 @@ +package com.aspose.slides.examples.smartarts; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class RemoveNodeSpecificPosition +{ + public static void main(String[] args) + { + //ExStart:RemoveNodeSpecificPosition + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_SmartArts(); + + // Load the desired the presentation + Presentation pres = new Presentation(dataDir + "RemoveNodeSpecificPosition.pptx"); + try + { + // Traverse through every shape inside first slide + for (IShape shape : pres.getSlides().get_Item(0).getShapes()) + { + // Check if shape is of SmartArt type + if (shape instanceof ISmartArt) + { + // Typecast shape to SmartArt + ISmartArt smart = (ISmartArt) shape; + + if (smart.getAllNodes().size() > 0) + { + // Accessing SmartArt node at index 0 + ISmartArtNode node = smart.getAllNodes().get_Item(0); + + if (node.getChildNodes().size() >= 2) + { + // Removing the child node at position 1 + ((ISmartArtNodeCollection) node.getChildNodes()).removeNode(1); + } + + } + } + } + + // Save Presentation + pres.save(dataDir + "RemoveSmartArtNodeByPosition_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:RemoveNodeSpecificPosition + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/AddImageinsideTableCell.java b/Examples/src/main/java/com/aspose/slides/examples/tables/AddImageinsideTableCell.java new file mode 100644 index 00000000..377ed58a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/AddImageinsideTableCell.java @@ -0,0 +1,50 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AddImageinsideTableCell +{ + public static void main(String[] args) + { + //ExStart:AddImageinsideTableCell + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + String outputDir = RunExamples.getOutPath(); + + // Instantiate Presentation class object + Presentation presentation = new Presentation(); + try + { + // Access first slide + ISlide islide = presentation.getSlides().get_Item(0); + + // Define columns with widths and rows with heights + double[] dblCols = {150, 150, 150, 150}; + double[] dblRows = {100, 100, 100, 100, 90}; + + // Add table shape to slide + ITable tbl = islide.getShapes().addTable(50, 50, dblCols, dblRows); + + // Creating a BufferedImage Image object to hold the image file + IImage image = Images.fromFile(dataDir + "aspose-logo.jpg"); + + // Create an IPPImage object using the bitmap object + IPPImage imgx1 = presentation.getImages().addImage(image); + + // Add image to first table cell + tbl.get_Item(0, 0).getCellFormat().getFillFormat().setFillType(FillType.Picture); + tbl.get_Item(0, 0).getCellFormat().getFillFormat().getPictureFillFormat().setPictureFillMode(PictureFillMode.Stretch); + tbl.get_Item(0, 0).getCellFormat().getFillFormat().getPictureFillFormat().getPicture().setImage(imgx1); + + // Save PPTX to Disk + presentation.save(outputDir + "Image_In_TableCell_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AddImageinsideTableCell + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/CellSplit.java b/Examples/src/main/java/com/aspose/slides/examples/tables/CellSplit.java new file mode 100644 index 00000000..1b23904f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/CellSplit.java @@ -0,0 +1,76 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class CellSplit +{ + public static void main(String[] args) + { + //ExStart:CellSplit + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + // Instantiate Presentation class that represents PPTX file + Presentation presentation = new Presentation(); + try + { + // Access first slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Define columns with widths and rows with heights + double[] dblCols = {70, 70, 70, 70}; + double[] dblRows = {70, 70, 70, 70}; + + // Add table shape to slide + ITable table = slide.getShapes().addTable(100, 50, dblCols, dblRows); + + // Set border format for each cell + for (IRow row : table.getRows()) + { + for (ICell cell : (Iterable) row) + { + cell.getCellFormat().getBorderTop().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderTop().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderTop().setWidth(5); + + + cell.getCellFormat().getBorderBottom().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderBottom().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderBottom().setWidth(5); + + cell.getCellFormat().getBorderLeft().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderLeft().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderLeft().setWidth(5); + + cell.getCellFormat().getBorderRight().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderRight().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderRight().setWidth(5); + + } + } + + // Merging cells (1, 1) x (2, 1) + table.mergeCells(table.get_Item(1, 1), table.get_Item(2, 1), false); + + // Merging cells (1, 2) x (2, 2) + table.mergeCells(table.get_Item(1, 2), table.get_Item(2, 2), false); + + // split cell (1, 1). + table.get_Item(1, 1).splitByWidth(table.get_Item(2, 1).getWidth() / 2); + + //Write PPTX to Disk + presentation.save(dataDir + "CellSplit_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:CellSplit + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/CloningInTable.java b/Examples/src/main/java/com/aspose/slides/examples/tables/CloningInTable.java new file mode 100644 index 00000000..b07af7be --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/CloningInTable.java @@ -0,0 +1,70 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.ISlide; +import com.aspose.slides.ITable; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class CloningInTable +{ + public static void main(String[] args) + { + //ExStart:CloningInTable + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + // Instantiate presentationentation class that representationents PPTX file + Presentation presentation = new Presentation(dataDir + "presentation.pptx"); + try + { + // Access first slide + ISlide sld = presentation.getSlides().get_Item(0); + + // Define columns with widths and rows with heights + double[] dblCols = {50, 50, 50}; + double[] dblRows = {50, 30, 30, 30, 30}; + + // Add table shape to slide + ITable table = sld.getShapes().addTable(100, 50, dblCols, dblRows); + + + // Add text to the row 1 cell 1 + table.get_Item(0, 0).getTextFrame().setText("Row 1 Cell 1"); + + // Add text to the row 1 cell 2 + table.get_Item(1, 0).getTextFrame().setText("Row 1 Cell 2"); + + // Clone Row 1 at end of table + table.getRows().addClone(table.getRows().get_Item(0), false); + + // Add text to the row 2 cell 1 + table.get_Item(0, 1).getTextFrame().setText("Row 2 Cell 1"); + + // Add text to the row 2 cell 2 + table.get_Item(1, 1).getTextFrame().setText("Row 2 Cell 2"); + + + // Clone Row 2 as 4th row of table + table.getRows().insertClone(3, table.getRows().get_Item(1), false); + + //Cloning first column at end + table.getColumns().addClone(table.getColumns().get_Item(0), false); + + //Cloning 2nd column at 4th column index + table.getColumns().insertClone(3, table.getColumns().get_Item(1), false); + + + // Write PPTX to Disk + presentation.save(dataDir + "table_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + } +} +//ExEnd:CloningInTable + + \ No newline at end of file diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/CreateATableFromScratchInASlide.java b/Examples/src/main/java/com/aspose/slides/examples/tables/CreateATableFromScratchInASlide.java new file mode 100644 index 00000000..344780fa --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/CreateATableFromScratchInASlide.java @@ -0,0 +1,74 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class CreateATableFromScratchInASlide +{ + public static void main(String[] args) + { + + //ExStart:CreateATableFromScratchInASlide + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + final String outPath = RunExamples.getOutPath(); + + // Instantiate Presentation class that represents PPTX file + Presentation pres = new Presentation(); + try + { + // Access first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Define columns with widths and rows with heights + double[] dblCols = {50, 50, 50}; + double[] dblRows = {50, 30, 30, 30, 30}; + + // Add table shape to slide + ITable tbl = sld.getShapes().addTable(100, 50, dblCols, dblRows); + + // Set border format for each cell + for (int row = 0; row < tbl.getRows().size(); row++) + { + for (int cell = 0; cell < tbl.getRows().get_Item(row).size(); cell++) + { + tbl.get_Item(cell, row).getCellFormat().getBorderTop().getFillFormat().setFillType(FillType.Solid); + tbl.get_Item(cell, row).getCellFormat().getBorderTop().getFillFormat().getSolidFillColor().setColor(Color.RED); + tbl.get_Item(cell, row).getCellFormat().getBorderTop().setWidth(5); + + tbl.get_Item(cell, row).getCellFormat().getBorderBottom().getFillFormat().setFillType((FillType.Solid)); + tbl.get_Item(cell, row).getCellFormat().getBorderBottom().getFillFormat().getSolidFillColor().setColor(Color.RED); + tbl.get_Item(cell, row).getCellFormat().getBorderBottom().setWidth(5); + + tbl.get_Item(cell, row).getCellFormat().getBorderLeft().getFillFormat().setFillType(FillType.Solid); + tbl.get_Item(cell, row).getCellFormat().getBorderLeft().getFillFormat().getSolidFillColor().setColor(Color.RED); + tbl.get_Item(cell, row).getCellFormat().getBorderLeft().setWidth(5); + + tbl.get_Item(cell, row).getCellFormat().getBorderRight().getFillFormat().setFillType(FillType.Solid); + tbl.get_Item(cell, row).getCellFormat().getBorderRight().getFillFormat().getSolidFillColor().setColor(Color.RED); + tbl.get_Item(cell, row).getCellFormat().getBorderRight().setWidth(5); + } + } + // Merge cells 1 & 2 of row 1 + tbl.mergeCells(tbl.get_Item(0, 0), tbl.get_Item(1, 1), false); + + // Add text to the merged cell + tbl.get_Item(0, 0).getTextFrame().setText("Merged Cells"); + + // Save PPTX to Disk + pres.save(outPath + "table.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:CreateATableFromScratchInASlide + + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/GetEffectiveValuesOfTable.java b/Examples/src/main/java/com/aspose/slides/examples/tables/GetEffectiveValuesOfTable.java new file mode 100644 index 00000000..7d2f3078 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/GetEffectiveValuesOfTable.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class GetEffectiveValuesOfTable +{ + public static void main(String[] args) + { + + //ExStart:GetEffectiveValuesOfTable + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + Presentation pres = new Presentation(dataDir + "pres.pptx"); + try + { + ITable tbl = (ITable) pres.getSlides().get_Item(0).getShapes().get_Item(0); + ITableFormatEffectiveData tableFormatEffective = tbl.getTableFormat().getEffective(); + IRowFormatEffectiveData rowFormatEffective = tbl.getRows().get_Item(0).getRowFormat().getEffective(); + IColumnFormatEffectiveData columnFormatEffective = tbl.getColumns().get_Item(0).getColumnFormat().getEffective(); + ICellFormatEffectiveData cellFormatEffective = tbl.get_Item(0, 0).getCellFormat().getEffective(); + + IFillFormatEffectiveData tableFillFormatEffective = tableFormatEffective.getFillFormat(); + IFillFormatEffectiveData rowFillFormatEffective = rowFormatEffective.getFillFormat(); + IFillFormatEffectiveData columnFillFormatEffective = columnFormatEffective.getFillFormat(); + IFillFormatEffectiveData cellFillFormatEffective = cellFormatEffective.getFillFormat(); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:GetEffectiveValuesOfTable + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/IdentifyingTheMergedCellsinTable.java b/Examples/src/main/java/com/aspose/slides/examples/tables/IdentifyingTheMergedCellsinTable.java new file mode 100644 index 00000000..b43ebd3c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/IdentifyingTheMergedCellsinTable.java @@ -0,0 +1,48 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.ICell; +import com.aspose.slides.ITable; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class IdentifyingTheMergedCellsinTable +{ + public static void main(String[] args) + { + // ExStart:IdentifyingTheMergedCellsinTable + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + + Presentation pres = new Presentation(dataDir + "SomePresentationWithTable.pptx"); + try + { + ITable table = (ITable) pres.getSlides().get_Item(0).getShapes().get_Item(0); // assuming that Slide#0.Shape#0 is a table + for (int i = 0; i < table.getRows().size(); i++) + { + for (int j = 0; j < table.getColumns().size(); j++) + { + ICell currentCell = table.getRows().get_Item(i).get_Item(j); + if (currentCell.isMergedCell()) + { + System.out.println(String.format("Cell {0};{1} is a part of merged cell with RowSpan={2} and ColSpan={3} starting from Cell {4};{5}.", + i, j, currentCell.getRowSpan(), currentCell.getColSpan(), currentCell.getFirstRowIndex(), currentCell.getFirstColumnIndex())); + + + } + } + + } + } + finally + { + if (pres != null) pres.dispose(); + } + + + // ExEnd:IdentifyingTheMergedCellsinTable + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/LockAspectRatio.java b/Examples/src/main/java/com/aspose/slides/examples/tables/LockAspectRatio.java new file mode 100644 index 00000000..07b55587 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/LockAspectRatio.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.ITable; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class LockAspectRatio +{ + public static void main(String[] args) + { + //ExStart:LockAspectRatio + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + Presentation pres = new Presentation(dataDir + "pres.pptx"); + try + { + ITable table = (ITable) pres.getSlides().get_Item(0).getShapes().get_Item(0); + System.out.println("Lock aspect ratio set: " + table.getGraphicalObjectLock().getAspectRatioLocked()); + + table.getGraphicalObjectLock().setAspectRatioLocked(!table.getGraphicalObjectLock().getAspectRatioLocked()); // invert + + System.out.println("Lock aspect ratio set: " + table.getGraphicalObjectLock().getAspectRatioLocked()); + + pres.save(dataDir + "pres-out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:LockAspectRatio + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/MergeCell.java b/Examples/src/main/java/com/aspose/slides/examples/tables/MergeCell.java new file mode 100644 index 00000000..cb185915 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/MergeCell.java @@ -0,0 +1,78 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class MergeCell +{ + public static void main(String[] args) + { + //ExStart:MergeCell + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + // Instantiate Presentation class that represents PPTX file + Presentation presentation = new Presentation(); + try + { + + // Access first slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Define columns with widths and rows with heights + double[] dblCols = {70, 70, 70, 70}; + double[] dblRows = {70, 70, 70, 70}; + + // Add table shape to slide + ITable table = slide.getShapes().addTable(100, 50, dblCols, dblRows); + + // Set border format for each cell + for (IRow row : table.getRows()) + { + for (ICell cell : (Iterable) row) + { + cell.getCellFormat().getBorderTop().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderTop().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderTop().setWidth(5); + + cell.getCellFormat().getBorderBottom().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderBottom().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderBottom().setWidth(5); + + cell.getCellFormat().getBorderLeft().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderLeft().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderLeft().setWidth(5); + + cell.getCellFormat().getBorderRight().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderRight().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderRight().setWidth(5); + + } + } + + // Merging cells (1, 1) x (2, 1) + table.mergeCells(table.get_Item(1, 1), table.get_Item(2, 1), false); + + // Merging cells (1, 2) x (2, 2) + table.mergeCells(table.get_Item(1, 2), table.get_Item(2, 2), false); + + // Merging cells (1, 2) x (2, 2) + table.mergeCells(table.get_Item(1, 1), table.get_Item(1, 2), true); + + //Write PPTX to Disk + presentation.save(dataDir + "MergeCells1_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:MergeCell + } +} + + + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/MergeCells.java b/Examples/src/main/java/com/aspose/slides/examples/tables/MergeCells.java new file mode 100644 index 00000000..cdd69e9f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/MergeCells.java @@ -0,0 +1,71 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class MergeCells +{ + public static void main(String[] args) + { + //ExStart:MergeCells + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + // Instantiate Presentation class that represents PPTX file + Presentation presentation = new Presentation(); + try + { + // Access first slide + ISlide sld = presentation.getSlides().get_Item(0); + + // Define columns with widths and rows with heights + double[] dblCols = {70, 70, 70, 70}; + double[] dblRows = {70, 70, 70, 70}; + + // Add table shape to slide + ITable tbl = sld.getShapes().addTable(100, 50, dblCols, dblRows); + + // Set border format for each cell + for (IRow row : tbl.getRows()) + { + for (ICell cell : (Iterable) row) + { + cell.getCellFormat().getBorderTop().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderTop().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderTop().setWidth(5); + + cell.getCellFormat().getBorderBottom().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderBottom().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderBottom().setWidth(5); + + cell.getCellFormat().getBorderLeft().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderLeft().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderLeft().setWidth(5); + + cell.getCellFormat().getBorderRight().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderRight().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderRight().setWidth(5); + } + } + + // Merging cells (1, 1) x (2, 1) + tbl.mergeCells(tbl.getRows().get_Item(1).get_Item(1), tbl.getRows().get_Item(2).get_Item(1), false); + + // Merging cells (1, 2) x (2, 2) + tbl.mergeCells(tbl.getRows().get_Item(1).get_Item(2), tbl.getRows().get_Item(2).get_Item(2), false); + + presentation.save(dataDir + "MergeCells_out.pptx", SaveFormat.Pptx); + //ExEnd:MergeCells + + } + finally + { + if (presentation != null) presentation.dispose(); + } + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/RemovingRowColumn.java b/Examples/src/main/java/com/aspose/slides/examples/tables/RemovingRowColumn.java new file mode 100644 index 00000000..dacd7072 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/RemovingRowColumn.java @@ -0,0 +1,43 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.ISlide; +import com.aspose.slides.ITable; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class RemovingRowColumn +{ + public static void main(String[] args) + { + //ExStart:RemovingRowColumn + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + Presentation pres = new Presentation(); + try + { + ISlide slide = pres.getSlides().get_Item(0); + double[] colWidth = new double[]{100, 50, 30}; + double[] rowHeight = new double[]{30, 50, 30}; + + ITable table = slide.getShapes().addTable(100, 100, colWidth, rowHeight); + table.getRows().removeAt(1, false); + table.getColumns().removeAt(1, false); + pres.save(dataDir + "TestTable_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:RemovingRowColumn + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/SetFirstRowAsHeader.java b/Examples/src/main/java/com/aspose/slides/examples/tables/SetFirstRowAsHeader.java new file mode 100644 index 00000000..591aeaf6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/SetFirstRowAsHeader.java @@ -0,0 +1,52 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.IShape; +import com.aspose.slides.ISlide; +import com.aspose.slides.ITable; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class SetFirstRowAsHeader +{ + + public static void main(String[] args) + { + + //ExStart:SetFirstRowAsHeader + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + // Instantiate Presentation class that represents PPTX + Presentation pres = new Presentation(dataDir + "table.pptx"); + try + { + // Access the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Initialize null TableEx + ITable tbl = null; + + // Iterate through the shapes and set a reference to the table found + for (IShape shp : sld.getShapes()) + { + if (shp instanceof ITable) + { + tbl = (ITable) shp; + } + } + + + //Set the first row of a table as header with a special formatting. + tbl.setFirstRow(true); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SetFirstRowAsHeader + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/SetTextFormattingInsideTable.java b/Examples/src/main/java/com/aspose/slides/examples/tables/SetTextFormattingInsideTable.java new file mode 100644 index 00000000..f4f8d879 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/SetTextFormattingInsideTable.java @@ -0,0 +1,49 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetTextFormattingInsideTable +{ + public static void main(String[] args) + { + //ExStart:Se.getTextFormat().ingInsideTable + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + // Create an instance of Presentation class + Presentation presentation = new Presentation(dataDir + "pres.pptx"); + try + { + ISlide slide = presentation.getSlides().get_Item(0); + + ITable someTable = (ITable) presentation.getSlides().get_Item(0).getShapes().get_Item(0); // let's say that the first shape on the first slide is a table + + // setting table cells' font height + PortionFormat portionFormat = new PortionFormat(); + portionFormat.setFontHeight(25); + someTable.setTextFormat(portionFormat); + + // setting table cells' text alignment and right margin in one call + ParagraphFormat paragraphFormat = new ParagraphFormat(); + paragraphFormat.setAlignment(TextAlignment.Right); + paragraphFormat.setMarginRight(20); + someTable.setTextFormat(paragraphFormat); + + // setting table cells' text vertical type + TextFrameFormat textFrameFormat = new TextFrameFormat(); + textFrameFormat.setTextVerticalType(TextVerticalType.Vertical); + someTable.setTextFormat(textFrameFormat); + + + presentation.save(dataDir + "result.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:Se.getTextFormat().ingInsideTable + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/StandardTables.java b/Examples/src/main/java/com/aspose/slides/examples/tables/StandardTables.java new file mode 100644 index 00000000..f01f9a01 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/StandardTables.java @@ -0,0 +1,66 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class StandardTables +{ + public static void main(String[] args) + { + //ExStart:StandardTables + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + // Instantiate Presentation class that represents PPTX file + Presentation pres = new Presentation(); + try + { + + // Access first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Define columns with widths and rows with heights + double[] dblCols = {70, 70, 70, 70}; + double[] dblRows = {70, 70, 70, 70}; + + // Add table shape to slide + ITable tbl = sld.getShapes().addTable(100, 50, dblCols, dblRows); + + // Set border format for each cell + for (IRow row : tbl.getRows()) + { + for (ICell cell : (Iterable) row) + { + cell.getCellFormat().getBorderTop().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderTop().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderTop().setWidth(5); + + cell.getCellFormat().getBorderBottom().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderBottom().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderBottom().setWidth(5); + + cell.getCellFormat().getBorderLeft().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderLeft().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderLeft().setWidth(5); + + cell.getCellFormat().getBorderRight().getFillFormat().setFillType(FillType.Solid); + cell.getCellFormat().getBorderRight().getFillFormat().getSolidFillColor().setColor(Color.RED); + cell.getCellFormat().getBorderRight().setWidth(5); + } + } + + //Write PPTX to Disk + pres.save(dataDir + "StandardTables_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:StandardTables + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/TableFromScratch.java b/Examples/src/main/java/com/aspose/slides/examples/tables/TableFromScratch.java new file mode 100644 index 00000000..64d83bbd --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/TableFromScratch.java @@ -0,0 +1,42 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class TableFromScratch +{ + public static void main(String[] args) + { + //ExStart:TableFromScratch + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + // Instantiate Presentation class that represents PPTX// Instantiate Presentation class that represents PPTX + Presentation presentation = new Presentation(dataDir + "UpdateExistingTable.pptx"); + try + { + // Access the first slide + ISlide sld = presentation.getSlides().get_Item(0); + + // Initialize null TableEx + ITable table = null; + + // Iterate through the shapes and set a reference to the table found + for (IShape shape : sld.getShapes()) + if (shape instanceof ITable) + table = (ITable) shape; + + // Set the text of the first column of second row + table.getRows().get_Item(0).get_Item(1).getTextFrame().setText("New"); + + // Write the PPTX to Disk + presentation.save(dataDir + "UpdateTable_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:TableFromScratch + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/TableTransparency.java b/Examples/src/main/java/com/aspose/slides/examples/tables/TableTransparency.java new file mode 100644 index 00000000..10b75413 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/TableTransparency.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class TableTransparency +{ + public static void main(String[] args) + { + + // The path to the presentation + String presentationFilePat = RunExamples.getDataDir_Tables() + "TableTransparency.pptx"; + + // The path to output file + String outFilePath = RunExamples.getOutPath() + "TableTransparency_out.pptx"; + + //ExStart:TableTransparency + // Create a new presentation + Presentation pres = new Presentation(presentationFilePat); + try { + // Get a table + ITable table = (ITable)pres.getSlides().get_Item(0).getShapes().get_Item(1); + + //Set transparency of the table to 62% + table.getTableFormat().setTransparency(0.62f); + + // Save presentation + pres.save(outFilePath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:TableTransparency + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/TableWithCellBorders.java b/Examples/src/main/java/com/aspose/slides/examples/tables/TableWithCellBorders.java new file mode 100644 index 00000000..c847786d --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/TableWithCellBorders.java @@ -0,0 +1,58 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class TableWithCellBorders +{ + public static void main(String[] args) + { + //ExStart:TableWithCellBorders + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Presentation class that represents PPTX file + Presentation pres = new Presentation(); + try + { + + // Access first slide + Slide sld = (Slide) pres.getSlides().get_Item(0); + + // Define columns with widths and rows with heights + double[] dblCols = {50, 50, 50, 50}; + double[] dblRows = {50, 30, 30, 30, 30}; + + // Add table shape to slide + + // Add table shape to slide + ITable tbl = sld.getShapes().addTable(100, 50, dblCols, dblRows); + + // Set border format for each cell + for (IRow row : tbl.getRows()) + for (ICell cell : (Iterable) row) + { + cell.getCellFormat().getBorderTop().getFillFormat().setFillType(FillType.NoFill); + cell.getCellFormat().getBorderBottom().getFillFormat().setFillType(FillType.NoFill); + cell.getCellFormat().getBorderLeft().getFillFormat().setFillType(FillType.NoFill); + cell.getCellFormat().getBorderRight().getFillFormat().setFillType(FillType.NoFill); + } + + //Write PPTX to Disk + pres.save(dataDir + "table_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:TableWithCellBorders + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/TextFormattingInsideTableColumn.java b/Examples/src/main/java/com/aspose/slides/examples/tables/TextFormattingInsideTableColumn.java new file mode 100644 index 00000000..cf9ea795 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/TextFormattingInsideTableColumn.java @@ -0,0 +1,50 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class TextFormattingInsideTableColumn +{ + public static void main(String[] args) + { + // ExStart.getTextFormat().ingInsideTableColumn + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + // Create an instance of Presentation class + Presentation pres = new Presentation(dataDir + "SomePresentationWithTable.pptx"); + try + { + ISlide slide = pres.getSlides().get_Item(0); + + ITable someTable = (ITable) pres.getSlides().get_Item(0).getShapes().get_Item(0); // let's say that the first shape on the first slide is a table + + // setting first column cells' font height + PortionFormat portionFormat = new PortionFormat(); + portionFormat.setFontHeight(25); + someTable.getColumns().get_Item(0).setTextFormat(portionFormat); + + // setting first column cells' text alignment and right margin in one call + ParagraphFormat paragraphFormat = new ParagraphFormat(); + paragraphFormat.setAlignment(TextAlignment.Right); + paragraphFormat.setMarginRight(20); + someTable.getColumns().get_Item(0).setTextFormat(portionFormat); + + // setting second column cells' text vertical type + TextFrameFormat textFrameFormat = new TextFrameFormat(); + textFrameFormat.setTextVerticalType(TextVerticalType.Vertical); + someTable.getColumns().get_Item(0).setTextFormat(portionFormat); + + pres.save(dataDir + "result.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + // ExEnd.getTextFormat().ingInsideTableColumn + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/TextFormattingInsideTableRow.java b/Examples/src/main/java/com/aspose/slides/examples/tables/TextFormattingInsideTableRow.java new file mode 100644 index 00000000..62ebe7bf --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/TextFormattingInsideTableRow.java @@ -0,0 +1,50 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class TextFormattingInsideTableRow +{ + public static void main(String[] args) + { + // ExStart.getTextFormat().ingInsideTableRow + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(dataDir + "SomePresentationWithTable.pptx"); + try + { + ISlide slide = presentation.getSlides().get_Item(0); + + ITable someTable = (ITable) presentation.getSlides().get_Item(0).getShapes().get_Item(0); // let's say that the first shape on the first slide is a table + + // setting first row cells' font height + PortionFormat portionFormat = new PortionFormat(); + portionFormat.setFontHeight(25f); + someTable.getRows().get_Item(0).setTextFormat(portionFormat); + + // setting first row cells' text alignment and right margin in one call + ParagraphFormat paragraphFormat = new ParagraphFormat(); + paragraphFormat.setAlignment(TextAlignment.Right); + paragraphFormat.setMarginRight(20); + someTable.getRows().get_Item(0).setTextFormat(paragraphFormat); + + // setting second row cells' text vertical type + TextFrameFormat textFrameFormat = new TextFrameFormat(); + textFrameFormat.setTextVerticalType(TextVerticalType.Vertical); + someTable.getColumns().get_Item(0).setTextFormat(textFrameFormat); + + presentation.save(dataDir + "result.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + + // ExEnd.getTextFormat().ingInsideTableRow + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/UpdateExistingTable.java b/Examples/src/main/java/com/aspose/slides/examples/tables/UpdateExistingTable.java new file mode 100644 index 00000000..e16bda8c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/UpdateExistingTable.java @@ -0,0 +1,43 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class UpdateExistingTable +{ + public static void main(String[] args) + { + //ExStart:UpdateExistingTable + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + // Instantiate Presentation class that represents PPTX// Instantiate Presentation class that represents PPTX + Presentation pres = new Presentation(dataDir + "UpdateExistingTable.pptx"); + try + { + + // Access the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Initialize null TableEx + ITable tbl = null; + + // Iterate through the shapes and set a reference to the table found + for (IShape shp : sld.getShapes()) + if (shp instanceof ITable) + tbl = (ITable) shp; + + // Set the text of the first column of second row + tbl.getRows().get_Item(0).get_Item(1).getTextFrame().setText("New"); + + //Write the PPTX to Disk + pres.save(dataDir + "table1_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:UpdateExistingTable + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/tables/VerticallyAlignText.java b/Examples/src/main/java/com/aspose/slides/examples/tables/VerticallyAlignText.java new file mode 100644 index 00000000..2d551f53 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/tables/VerticallyAlignText.java @@ -0,0 +1,62 @@ +package com.aspose.slides.examples.tables; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class VerticallyAlignText +{ + public static void main(String[] args) + { + //ExStart:VerticallyAlignText + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Tables(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + try + { + // Get the first slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Define columns with widths and rows with heights + double[] dblCols = {120, 120, 120, 120}; + double[] dblRows = {100, 100, 100, 100}; + + // Add table shape to slide + ITable tbl = slide.getShapes().addTable(100, 50, dblCols, dblRows); + tbl.getRows().get_Item(1).get_Item(0).getTextFrame().setText("10"); + tbl.getRows().get_Item(2).get_Item(0).getTextFrame().setText("20"); + tbl.getRows().get_Item(3).get_Item(0).getTextFrame().setText("30"); + + // Accessing the text frame + ITextFrame txtFrame = tbl.get_Item(0, 0).getTextFrame(); + + // Create the Paragraph object for text frame + IParagraph paragraph = txtFrame.getParagraphs().get_Item(0); + + // Create Portion object for paragraph + IPortion portion = paragraph.getPortions().get_Item(0); + portion.setText("Text here"); + portion.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); + + // Aligning the text vertically + ICell cell = tbl.get_Item(0, 0); + cell.setTextAnchorType(TextAnchorType.Center); + cell.setTextVerticalType(TextVerticalType.Vertical270); + + // Save Presentation + presentation.save(dataDir + "Vertical_Align_Text_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:VerticallyAlignText + } +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/AddColumnInTexBoxes.java b/Examples/src/main/java/com/aspose/slides/examples/text/AddColumnInTexBoxes.java new file mode 100644 index 00000000..a6f18737 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/AddColumnInTexBoxes.java @@ -0,0 +1,49 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AddColumnInTexBoxes +{ + public static void main(String[] args) + { + // ExStart:AddColumnInTexBoxes + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + Presentation presentation = new Presentation(); + try + { + // Get the first slide of presentation + ISlide slide = presentation.getSlides().get_Item(0); + + // Add an AutoShape of Rectangle type + IAutoShape aShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 300, 300); + + // Add TextFrame to the Rectangle + aShape.addTextFrame("All these columns are limited to be within a single text container -- " + + "you can add or delete text and the new or remaining text automatically adjusts " + + "itself to flow within the container. You cannot have text flow from one container " + + "to other though -- we told you PowerPoint's column options for text are limited!"); + + // Get text format of TextFrame + ITextFrameFormat format = aShape.getTextFrame().getTextFrameFormat(); + + // Specify number of columns in TextFrame + format.setColumnCount(3); + + // Specify spacing between columns + format.setColumnSpacing(10); + +// Save created presentation + presentation.save("ColumnCount.pptx", SaveFormat.Pptx); + + } + finally + { + if (presentation != null) presentation.dispose(); + } + + } + // ExEnd:AddColumnInTexBoxes +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/AddColumnsinTextFrame.java b/Examples/src/main/java/com/aspose/slides/examples/text/AddColumnsinTextFrame.java new file mode 100644 index 00000000..47b916a0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/AddColumnsinTextFrame.java @@ -0,0 +1,45 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AddColumnsinTextFrame +{ + public static void main(String[] args) + { + + //ExStart:AddColumnsinTextFrame + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + String outPptxFileName = dataDir + "ColumnsTest.pptx"; + Presentation pres = new Presentation(); + try + { + IAutoShape shape1 = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 300, 300); + TextFrameFormat format = (TextFrameFormat) shape1.getTextFrame().getTextFrameFormat(); + + format.setColumnCount(2); + shape1.getTextFrame().setText("All these columns are limited to be within a single text container -- " + + "you can add or delete text and the new or remaining text automatically adjusts " + + "itself to flow within the container. You cannot have text flow from one container " + + "to other though -- we told you PowerPoint's column options for text are limited!"); + pres.save(outPptxFileName, SaveFormat.Pptx); + + format.setColumnSpacing(20); + pres.save(outPptxFileName, SaveFormat.Pptx); + format.setColumnCount(3); + format.setColumnSpacing(15); + pres.save(outPptxFileName, SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:AddColumnsinTextFrame + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/AddCustomPromptText.java b/Examples/src/main/java/com/aspose/slides/examples/text/AddCustomPromptText.java new file mode 100644 index 00000000..b608b134 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/AddCustomPromptText.java @@ -0,0 +1,51 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AddCustomPromptText +{ + public static void main(String[] args) + { + + //ExStart:AddCustomPromptText + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + Presentation pres = new Presentation(dataDir + "Presentation2.pptx"); + try + { + ISlide slide = pres.getSlides().get_Item(0); + for (IShape shape : slide.getSlide().getShapes()) // iterate through the slide + { + if (shape.getPlaceholder() != null && shape instanceof AutoShape) + { + String text = ""; + if (shape.getPlaceholder().getType() == PlaceholderType.CenteredTitle) // title - the text is empty, PowerPoint displays "Click to add title". + { + text = "Click to add custom title"; + } else if (shape.getPlaceholder().getType() == PlaceholderType.Subtitle) // the same for subtitle. + { + text = "Click to add custom subtitle"; + } + + ((IAutoShape) shape).getTextFrame().setText(text); + + System.out.println(String.format("Placeholder with text: {0}", text)); + } + } + + pres.save(dataDir + "Placeholders_PromptText.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + + //ExEnd:AddCustomPromptText + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/AddEmbeddedFonts.java b/Examples/src/main/java/com/aspose/slides/examples/text/AddEmbeddedFonts.java new file mode 100644 index 00000000..e89df05f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/AddEmbeddedFonts.java @@ -0,0 +1,47 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AddEmbeddedFonts +{ + public static void main(String[] args) + { + //ExStart:AddEmbeddedFonts + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Load presentation + Presentation presentation = new Presentation(dataDir + "Fonts.pptx"); + + // Load source font to be replaced + IFontData sourceFont = new FontData("Arial"); + + + IFontData[] allFonts = presentation.getFontsManager().getFonts(); + IFontData[] embeddedFonts = presentation.getFontsManager().getEmbeddedFonts(); + for (IFontData font : allFonts) + { + boolean embeddedFontsContainsFont = false; + for (int i = 0; i < embeddedFonts.length; i++) + { + if (embeddedFonts[i].equals(font)) + { + embeddedFontsContainsFont = true; + break; + } + } + if (!embeddedFontsContainsFont) + { + presentation.getFontsManager().addEmbeddedFont(font, EmbedFontCharacters.All); + + embeddedFonts = presentation.getFontsManager().getEmbeddedFonts(); + } + } + + // Save the presentation + presentation.save(dataDir + "AddEmbeddedFont_out.pptx", SaveFormat.Pptx); + //ExEnd:AddEmbeddedFonts + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/AddingSuperscriptAndSubscriptTextInTextFrame.java b/Examples/src/main/java/com/aspose/slides/examples/text/AddingSuperscriptAndSubscriptTextInTextFrame.java new file mode 100644 index 00000000..fa8d1e78 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/AddingSuperscriptAndSubscriptTextInTextFrame.java @@ -0,0 +1,66 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AddingSuperscriptAndSubscriptTextInTextFrame +{ + public static void main(String[] args) + { + + //ExStart:AddingSuperscriptAndSubscriptTextInTextFrame + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + Presentation presentation = new Presentation(); + try + { + // Get slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Create text box + IAutoShape shape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 200, 100); + ITextFrame textFrame = shape.getTextFrame(); + textFrame.getParagraphs().clear(); + + // Create paragraph for superscript text + IParagraph superPar = new Paragraph(); + + // Create portion with usual text + IPortion portion1 = new Portion(); + portion1.setText("SlideTitle"); + superPar.getPortions().add(portion1); + + // Create portion with superscript text + IPortion superPortion = new Portion(); + superPortion.getPortionFormat().setEscapement(30); + superPortion.setText("TM"); + superPar.getPortions().add(superPortion); + + // Create paragraph for subscript text + IParagraph paragraph2 = new Paragraph(); + + // Create portion with usual text + IPortion portion2 = new Portion(); + portion2.setText("a"); + paragraph2.getPortions().add(portion2); + + // Create portion with subscript text + IPortion subPortion = new Portion(); + subPortion.getPortionFormat().setEscapement(-25); + subPortion.setText("i"); + paragraph2.getPortions().add(subPortion); + + // Add paragraphs to text box + textFrame.getParagraphs().add(superPar); + textFrame.getParagraphs().add(paragraph2); + + presentation.save(RunExamples.getOutPath() + "TestOut.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AddingSuperscriptAndSubscriptTextInTextFrame + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/AnimateTextTypeExample.java b/Examples/src/main/java/com/aspose/slides/examples/text/AnimateTextTypeExample.java new file mode 100644 index 00000000..faca8849 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/AnimateTextTypeExample.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class AnimateTextTypeExample +{ + public static void main(String[] args) + { + // Path to output document + String outFilePath = RunExamples.getOutPath() + "AnimateTextEffect_out.pptx"; + + //ExStart:AnimateTextTypeExample + Presentation presentation = new Presentation(); + try { + IAutoShape oval = presentation.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Ellipse, 100, 100, 300, 150); + oval.getTextFrame().setText("The new animated text"); + + // Get anomation timeline. + IAnimationTimeLine timeline = presentation.getSlides().get_Item(0).getTimeline(); + + // Set the effect of the first slide. + IEffect effect = timeline.getMainSequence().addEffect(oval, EffectType.Appear, EffectSubtype.None, EffectTriggerType.OnClick); + + // Set the effect Animate text type to "By letter". + effect.setAnimateTextType(AnimateTextType.ByLetter); + + // Set the delay between animated text parts. + effect.setDelayBetweenTextParts(-1.5f); + + // Save presentation. + presentation.save(outFilePath, SaveFormat.Pptx); + } finally { + if (presentation != null) presentation.dispose(); + } + + + //ExEnd:AnimateTextTypeExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/AnimationEffectinParagraph.java b/Examples/src/main/java/com/aspose/slides/examples/text/AnimationEffectinParagraph.java new file mode 100644 index 00000000..3398384f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/AnimationEffectinParagraph.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AnimationEffectinParagraph +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + //ExStart:AnimationEffectinParagraph + Presentation presentation = new Presentation(dataDir + "Presentation1.pptx"); + try + { + // select paragraph to add effect + IAutoShape autoShape = (IAutoShape) presentation.getSlides().get_Item(0).getShapes().get_Item(0); + IParagraph paragraph = autoShape.getTextFrame().getParagraphs().get_Item(0); + + // add Fly animation effect to selected paragraph + IEffect effect = presentation.getSlides().get_Item(0).getTimeline().getMainSequence().addEffect(paragraph, EffectType.Fly, EffectSubtype.Left, EffectTriggerType.OnClick); + + + presentation.save(dataDir + "AnimationEffectinParagraph.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + + + //ExEnd:AnimationEffectinParagraph + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ApplyInnerShadow.java b/Examples/src/main/java/com/aspose/slides/examples/text/ApplyInnerShadow.java new file mode 100644 index 00000000..5c337e4e --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ApplyInnerShadow.java @@ -0,0 +1,57 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class ApplyInnerShadow +{ + public static void main(String[] args) + { + //ExStart:ApplyInnerShadow + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate PresentationEx// Instantiate PresentationEx + Presentation pres = new Presentation(); + try + { + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add an AutoShape of Rectangle type + IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 150, 50); + + // Add TextFrame to the Rectangle + ashp.addTextFrame(" "); + + // Accessing the text frame + ITextFrame txtFrame = ashp.getTextFrame(); + + // Create the Paragraph object for text frame + IParagraph para = txtFrame.getParagraphs().get_Item(0); + + // Create Portion object for paragraph + IPortion portion = para.getPortions().get_Item(0); + + // Set Text + portion.setText("Aspose TextBox"); + + // Save the presentation to disk + pres.save(dataDir + "ApplyInnerShadow_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ApplyInnerShadow + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ApplyOuterShadow.java b/Examples/src/main/java/com/aspose/slides/examples/text/ApplyOuterShadow.java new file mode 100644 index 00000000..e04ef81c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ApplyOuterShadow.java @@ -0,0 +1,56 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ApplyOuterShadow +{ + public static void main(String[] args) + { + //ExStart:ApplyOuterShadow + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + try + { + // Get reference of a slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Add an AutoShape of Rectangle type + IAutoShape ashp = slide.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 400, 300); + ashp.getFillFormat().setFillType(FillType.NoFill); + + // Add TextFrame to the Rectangle + ashp.addTextFrame("Aspose TextBox"); + IPortion port = ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0); + IPortionFormat pf = port.getPortionFormat(); + pf.setFontHeight(50); + + // Enable InnerShadowEffect + IEffectFormat ef = pf.getEffectFormat(); + ef.enableInnerShadowEffect(); + + // Set all necessary parameters + ef.getInnerShadowEffect().setBlurRadius(8.0); + ef.getInnerShadowEffect().setDirection(90.0F); + ef.getInnerShadowEffect().setDistance(6.0); + ef.getInnerShadowEffect().getShadowColor().setB((byte) 189); + + // Set ColorType as Scheme + ef.getInnerShadowEffect().getShadowColor().setColorType(ColorType.Scheme); + + // Set Scheme Color + ef.getInnerShadowEffect().getShadowColor().setSchemeColor(SchemeColor.Accent1); + + // Save Presentation + presentation.save(dataDir + "WordArt_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ApplyOuterShadow + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ApplyingOuterShadowEffects.java b/Examples/src/main/java/com/aspose/slides/examples/text/ApplyingOuterShadowEffects.java new file mode 100644 index 00000000..198cb93a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ApplyingOuterShadowEffects.java @@ -0,0 +1,59 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class ApplyingOuterShadowEffects +{ + public static void main(String[] args) + { + //ExStart:ShadowEffects + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate a PPTX class + Presentation pres = new Presentation(); + try + { + + // Get reference of the slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add an AutoShape of Rectangle type + IAutoShape aShp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 150, 50); + + + // Add TextFrame to the Rectangle + aShp.addTextFrame("Aspose TextBox"); + + // Disable shape fill in case we want to get shadow of text + aShp.getFillFormat().setFillType(FillType.NoFill); + + // Add outer shadow and set all necessary parameters + aShp.getEffectFormat().enableOuterShadowEffect(); + IOuterShadow shadow = aShp.getEffectFormat().getOuterShadowEffect(); + shadow.setBlurRadius(4.0); + shadow.setDirection(45); + shadow.setDistance(3); + shadow.setRectangleAlign(RectangleAlignment.TopLeft); + shadow.getShadowColor().setColor(Color.BLACK); + + //Write the presentation to disk + pres.save(dataDir + "pres_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ShadowEffects + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/BulletFillFormatEffective.java b/Examples/src/main/java/com/aspose/slides/examples/text/BulletFillFormatEffective.java new file mode 100644 index 00000000..88f92218 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/BulletFillFormatEffective.java @@ -0,0 +1,51 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class BulletFillFormatEffective { + + public static void main(String[] args) { + //ExStart:BulletFillFormatEffective + String dataDir = RunExamples.getDataDir_Text(); + String pptxFile = dataDir + "BulletData.pptx"; + + Presentation pres = new Presentation(pptxFile); + try { + AutoShape autoShape = (AutoShape) pres.getSlides().get_Item(0).getShapes().get_Item(0); + for (IParagraph para : autoShape.getTextFrame().getParagraphs()) { + IBulletFormatEffectiveData bulletFormatEffective = para.getParagraphFormat().getBullet().getEffective(); + System.out.println("Bullet type: " + bulletFormatEffective.getType()); + if (bulletFormatEffective.getType() != BulletType.None) { + System.out.println("Bullet fill type: " + bulletFormatEffective.getFillFormat().getFillType()); + switch (bulletFormatEffective.getFillFormat().getFillType()) { + case FillType.Solid: + System.out.println( + "Solid fill color: " + bulletFormatEffective.getFillFormat().getSolidFillColor()); + break; + case FillType.Gradient: + System.out.println("Gradient stops count: " + + bulletFormatEffective.getFillFormat().getGradientFormat().getGradientStops().size()); + for (IGradientStopEffectiveData gradStop : bulletFormatEffective.getFillFormat() + .getGradientFormat().getGradientStops()) + System.out.println(gradStop.getPosition() + ": " + gradStop.getColor()); + break; + case FillType.Pattern: + System.out.println("Pattern style: " + + bulletFormatEffective.getFillFormat().getPatternFormat().getPatternStyle()); + System.out.println("Fore color: " + + bulletFormatEffective.getFillFormat().getPatternFormat().getForeColor()); + System.out.println("Back color: " + + bulletFormatEffective.getFillFormat().getPatternFormat().getBackColor()); + break; + } + } + + System.out.println(); + } + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:BulletFillFormatEffective + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/CustomRotationAngleTextframe.java b/Examples/src/main/java/com/aspose/slides/examples/text/CustomRotationAngleTextframe.java new file mode 100644 index 00000000..8c169ca1 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/CustomRotationAngleTextframe.java @@ -0,0 +1,33 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class CustomRotationAngleTextframe +{ + public static void main(String[] args) + { + //ExStart:CustomRotationAngleTextframe + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + + IChart chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 500, 300); + + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + + series.getLabels().getDefaultDataLabelFormat().setShowValue(true); + series.getLabels().getDefaultDataLabelFormat().getTextFormat().getTextBlockFormat().setRotationAngle(65); + + chart.setTitle(true); + chart.getChartTitle().addTextFrameForOverriding("Custom title").getTextFrameFormat().setRotationAngle(-30); + + // Save Presentation + presentation.save(dataDir + "textframe-rotation_out.pptx", SaveFormat.Pptx); + //ExEnd:CustomRotationAngleTextframe + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/DefaultFonts.java b/Examples/src/main/java/com/aspose/slides/examples/text/DefaultFonts.java new file mode 100644 index 00000000..c43dc035 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/DefaultFonts.java @@ -0,0 +1,39 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class DefaultFonts +{ + public static void main(String[] args) + { + //ExStart:DefaultFonts + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Use load options to define the default regualr and asian fonts// Use load options to define the default regualr and asian fonts + LoadOptions loadOptions = new LoadOptions(LoadFormat.Auto); + loadOptions.setDefaultRegularFont("Wingdings"); + loadOptions.setDefaultAsianFont("Wingdings"); + + // Load the presentation + Presentation pptx = new Presentation(dataDir + "DefaultFonts.pptx", loadOptions); + try + { + // Generate slide thumbnail + pptx.getSlides().get_Item(0).getImage(1, 1).save(dataDir + "output_out.png", ImageFormat.Png); + + // Generate PDF + pptx.save(dataDir + "output_out.pdf", SaveFormat.Pdf); + + // Generate XPS + pptx.save(dataDir + "output_out.xps", SaveFormat.Xps); + } + finally + { + if (pptx != null) pptx.dispose(); + } + //ExEnd:DefaultFonts + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/DisableFontLigaturesExample.java b/Examples/src/main/java/com/aspose/slides/examples/text/DisableFontLigaturesExample.java new file mode 100644 index 00000000..c48dd52f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/DisableFontLigaturesExample.java @@ -0,0 +1,32 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; +import java.io.IOException; + +public class DisableFontLigaturesExample +{ + public static void main(String[] args) throws IOException + { + String presentationName = RunExamples.getDataDir_Text() + "TextLigatures.pptx"; + String outPathEnabled = RunExamples.getOutPath() + "EnableLigatures-out.html"; + String outPathDisabled = RunExamples.getOutPath() + "DisableLigatures-out.html"; + + //ExStart:DisableFontLigaturesExample + Presentation pres = new Presentation(presentationName); + try { + // Save with enabled ligatures + pres.save(outPathEnabled, SaveFormat.Html); + + // Configure export options + HtmlOptions options = new HtmlOptions(); + options.setDisableFontLigatures(true); // Disable ligatures in rendered text + + // Export presentation to HTML with disabled ligatures + pres.save(outPathDisabled, SaveFormat.Html, options); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:DisableFontLigaturesExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/EffectTextBoxParagraph.java b/Examples/src/main/java/com/aspose/slides/examples/text/EffectTextBoxParagraph.java new file mode 100644 index 00000000..db3f1d9a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/EffectTextBoxParagraph.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class EffectTextBoxParagraph +{ + public static void main(String[] args) + { + //ExStart:EffectTextBoxParagraph + String dataDir = RunExamples.getDataDir_Charts(); + Presentation pres = new Presentation(dataDir + "Test.pptx"); + try + { + ISequence sequence = pres.getSlides().get_Item(0).getTimeline().getMainSequence(); + IAutoShape autoShape = (IAutoShape) pres.getSlides().get_Item(0).getShapes().get_Item(1); + + for (IParagraph paragraph : autoShape.getTextFrame().getParagraphs()) + { + IEffect[] effects = sequence.getEffectsByParagraph(paragraph); + + if (effects.length > 0) + System.out.println("Paragraph \"" + paragraph.getText() + "\" has " + effects[0].getType() + " effect."); + } + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:EffectTextBoxParagraph + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/EmbedFontsInHtml.java b/Examples/src/main/java/com/aspose/slides/examples/text/EmbedFontsInHtml.java new file mode 100644 index 00000000..41767c02 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/EmbedFontsInHtml.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class EmbedFontsInHtml +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + String outPath = RunExamples.getOutPath(); + + //ExStart:EmbedFontsInHtml + Presentation pres = new Presentation(dataDir + "Presentation.pptx"); + try + { + // exclude default presentation fonts + String[] fontNameExcludeList = { "Arial" }; + + EmbedAllFontsHtmlController embedFontsController = new EmbedAllFontsHtmlController(fontNameExcludeList); + + HtmlOptions htmlOptionsEmbed = new HtmlOptions(); + htmlOptionsEmbed.setHtmlFormatter(HtmlFormatter.createCustomFormatter(embedFontsController)); + + pres.save(outPath + "pres.html", SaveFormat.Html, htmlOptionsEmbed); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:EmbedFontsInHtml + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/EmbeddedFontCompression.java b/Examples/src/main/java/com/aspose/slides/examples/text/EmbeddedFontCompression.java new file mode 100644 index 00000000..cbe28607 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/EmbeddedFontCompression.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.nio.file.Files; +import java.nio.file.Paths; + +public class EmbeddedFontCompression +{ + public static void main(String[] args) throws Exception + { + String presentationName = RunExamples.getDataDir_Text() + "presWithEmbeddedFonts.pptx"; + String outPath = RunExamples.getOutPath() + "presWithEmbeddedFonts-out.pptx"; + + //ExStart:EmbeddedFontCompression + Presentation pres = new Presentation(presentationName); + try { + // Compress embedded fonts + Compress.compressEmbeddedFonts(pres); + // Save result + pres.save(outPath, SaveFormat.Pptx); + } finally { + if(pres != null) pres.dispose(); + } + + // Get source file info + byte[] sourceFile = Files.readAllBytes(Paths.get(presentationName)); + System.out.println(String.format("Source file size = %d bytes", sourceFile.length)); + // Get result file info + byte[] outputFile = Files.readAllBytes(Paths.get(outPath)); + System.out.println(String.format("Result file size = %d bytes", outputFile.length)); + //ExEnd:EmbeddedFontCompression + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/EndParaGraphProperties.java b/Examples/src/main/java/com/aspose/slides/examples/text/EndParaGraphProperties.java new file mode 100644 index 00000000..c73b5ccf --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/EndParaGraphProperties.java @@ -0,0 +1,42 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class EndParaGraphProperties +{ + public static void main(String[] args) + { + //ExStart:EndParaGraphProperties + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + Presentation pres = new Presentation(); + try + { + IAutoShape shape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 10, 10, 200, 250); + + Paragraph para1 = new Paragraph(); + para1.getPortions().add(new Portion("Sample text")); + + Paragraph para2 = new Paragraph(); + para2.getPortions().add(new Portion("Sample text 2")); + PortionFormat endParagraphPortionFormat = new PortionFormat(); + endParagraphPortionFormat.setFontHeight(48); + endParagraphPortionFormat.setLatinFont(new FontData("Times New Roman")); + para2.setEndParagraphPortionFormat(endParagraphPortionFormat); + + shape.getTextFrame().getParagraphs().add(para1); + shape.getTextFrame().getParagraphs().add(para2); + + pres.save(RunExamples.getOutPath() + "pres.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + } + //ExEnd:EndParaGraphProperties +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ExportingHTMLText.java b/Examples/src/main/java/com/aspose/slides/examples/text/ExportingHTMLText.java new file mode 100644 index 00000000..cdcf4e47 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ExportingHTMLText.java @@ -0,0 +1,51 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.IAutoShape; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.*; +import java.nio.charset.StandardCharsets; + + +public class ExportingHTMLText +{ + public static void main(String[] args) throws IOException + { + //ExStart:ExportingHTMLText + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Load the presentation file + Presentation pres = new Presentation(dataDir + "ExportingHTMLText.pptx"); + try + { + + // Acesss the default first slide of presentation + ISlide slide = pres.getSlides().get_Item(0); + + // Desired index + int index = 0; + + // Accessing the added shape + IAutoShape ashape = (IAutoShape) slide.getShapes().get_Item(index); + + //Writing Paragraphs data to HTML by providing paragraph starting index, total paragraphs to be copied + Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(dataDir + "output_out.html"), StandardCharsets.UTF_8)); + try + { + out.write(ashape.getTextFrame().getParagraphs().exportToHtml(0, ashape.getTextFrame().getParagraphs().getCount(), null)); + } + finally + { + out.close(); + } + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ExportingHTMLText + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/FallBackRulesCollection.java b/Examples/src/main/java/com/aspose/slides/examples/text/FallBackRulesCollection.java new file mode 100644 index 00000000..e1764c38 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/FallBackRulesCollection.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.FontFallBackRule; +import com.aspose.slides.FontFallBackRulesCollection; +import com.aspose.slides.IFontFallBackRulesCollection; +import com.aspose.slides.Presentation; + + +public class FallBackRulesCollection +{ + public static void main(String[] args) + { + + //ExStart:FallBackRulesCollection + + Presentation presentation = new Presentation(); + try + { + IFontFallBackRulesCollection userRulesList = new FontFallBackRulesCollection(); + + userRulesList.add(new FontFallBackRule(0x0B80, 0x0BFF, "Vijaya")); + userRulesList.add(new FontFallBackRule(0x3040, 0x309F, "MS Mincho, MS Gothic")); + + presentation.getFontsManager().setFontFallBackRulesCollection(userRulesList); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:FallBackRulesCollection + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/FindAndReplaceText.java b/Examples/src/main/java/com/aspose/slides/examples/text/FindAndReplaceText.java new file mode 100644 index 00000000..a1c7e394 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/FindAndReplaceText.java @@ -0,0 +1,30 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; +import java.awt.Color; + +public class FindAndReplaceText +{ + public static void main(String[] args) + { + String presentationName = RunExamples.getDataDir_Text() + "TextReplaceExample.pptx"; + String outPath = RunExamples.getOutPath() + "TextReplaceExample-out.pptx"; + + //ExStart:FindAndReplaceText + Presentation pres = new Presentation(presentationName); + try { + PortionFormat format = new PortionFormat(); + format.setFontHeight(24f); + format.setFontItalic(NullableBool.True); + format.getFillFormat().setFillType(FillType.Solid); + format.getFillFormat().getSolidFillColor().setColor(Color.RED); + + SlideUtil.findAndReplaceText(pres, true, "[this block] ", "my text", format); + pres.save(outPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:FontFamily + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/FindAndReplaceTextResult.java b/Examples/src/main/java/com/aspose/slides/examples/text/FindAndReplaceTextResult.java new file mode 100644 index 00000000..89e05dc6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/FindAndReplaceTextResult.java @@ -0,0 +1,148 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.util.ArrayList; +import java.util.List; + +/** + * The following code sample demonstrates how to handle text replacing results using the IFindResultCallback interface: + */ +public class FindAndReplaceTextResult +{ + public static void main(String[] args) + { + String presentationName = RunExamples.getDataDir_Text() + "TextReplaceExample.pptx"; + String outPath = RunExamples.getOutPath() + "TextReplaceExampleReplace-out.pptx"; + + Presentation pres = new Presentation(presentationName); + try { + // Create callback. + FindResultCallback callback = new FindResultCallback(); + + // Replace all words "[this block]". + pres.replaceText("\\[this block\\]", "my text", new TextSearchOptions(), callback); + + // Output the number of found fragments of the given text. + System.out.println("number of found fragments = " + callback.getCount()); + + // Output data for each word "[this block] " found. + for (WordInfo info : callback.Words) + { + System.out.println("Text = " + info.getFoundText() + ", Position = " + info.getTextPosition()); + } + + pres.save(outPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + + } + } + + /** + * Class that provides information about all found occurrences of a given text. + */ + static class FindResultCallback implements IFindResultCallback + { + // Array of retrieved text information. + public final List Words = new ArrayList<>(); + + /** + * The number of matches found to a given text. + */ + public int getCount() + { + return Words.size(); + } + + /** + * Gets all slides in which the given text was found. + */ + public Integer[] getSlideNumbers() + { + List slideNumbers = new ArrayList<>(); + for (WordInfo element : Words) + { + int slideNumber = ((Slide)element.TextFrame.getSlide()).getSlideNumber(); + if (!slideNumbers.contains(slideNumber)) + slideNumbers.add(slideNumber); + } + return slideNumbers.toArray(new Integer[0]); + } + + /** + * Gets all occurrences of the found text on the slide. + * @param slideNumber Slide number + */ + public WordInfo[] getElemensForSlide(int slideNumber) + { + List foundElements = new ArrayList<>(); + for (WordInfo element : Words) + { + if (((Slide)element.TextFrame.getSlide()).getSlideNumber() == slideNumber) + foundElements.add(element); + } + return foundElements.toArray(new WordInfo[0]); + } + + /** + * Callback method that receives data about the found text. + * @param textFrame The ITextFrame in which the text was found. + * @param oldText The source text in which the text was found. + * @param foundText The found text. + * @param textPosition The position of the found text. + */ + public void foundResult(ITextFrame textFrame, String oldText, String foundText, int textPosition) + { + Words.add(new WordInfo(textFrame, oldText, foundText, textPosition)); + } + } + + /** + * Class providing information about each text found in the presentation. + */ + public static class WordInfo + { + private final ITextFrame TextFrame; + private final String SourceText; + private final String FoundText; + private final int TextPosition; + + WordInfo(ITextFrame textFrame, String sourceText, String foundText, int textPosition) + { + TextFrame = textFrame; + SourceText = sourceText; + FoundText = foundText; + TextPosition = textPosition; + } + + /** + * Gets found text. + */ + public String getFoundText() { + return FoundText; + } + + /** + * Gets the source text for the TextFrame in which the text was found. + */ + public String getSourceText() { + return SourceText; + } + + /** + * The position of the found text in the text frame. + */ + public int getTextPosition() { + return TextPosition; + } + + /** + * The text frame in which the text was found. + */ + public ITextFrame getTextFrame() { + return TextFrame; + } + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/FindTextOptions.java b/Examples/src/main/java/com/aspose/slides/examples/text/FindTextOptions.java new file mode 100644 index 00000000..35e24eb1 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/FindTextOptions.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.text; + + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.TextSearchOptions; +import com.aspose.slides.examples.RunExamples; + + +/* +This example demonstrates how to use TextSearchOptions to allows including text +contained in slide notes when performing text replacement method. +*/ + +public class FindTextOptions +{ + public static void main(String[] args) + { + String presentationName = RunExamples.getDataDir_Text() + "TextOptionsExample.pptx"; + String outPath = RunExamples.getOutPath() + "TextOptionsExample-out.pptx"; + + //ExStart:FindTextOptions + Presentation pres = new Presentation(presentationName); + try { + // Set text search options + TextSearchOptions options = new TextSearchOptions(); + options.setIncludeNotes(true); + options.setCaseSensitive(true); + + // Replace test + pres.replaceText("old", "new", options, null); + + // Save result + pres.save(outPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:FindTextOptions + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/FontBinaryDataExample.java b/Examples/src/main/java/com/aspose/slides/examples/text/FontBinaryDataExample.java new file mode 100644 index 00000000..6fb7fd66 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/FontBinaryDataExample.java @@ -0,0 +1,39 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.FontStyleType; +import com.aspose.slides.IFontData; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class FontBinaryDataExample +{ + public static void main(String[] args) throws IOException + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + //ExStart:FontBinaryDataExample + Presentation pres = new Presentation(dataDir + "Presentation.pptx"); + try { + // Retrieve all fonts used in the presentation + IFontData[] fonts = pres.getFontsManager().getFonts(); + + // Get the byte array representing the regular style of the first font in the presentation + byte[] bytes = pres.getFontsManager().getFontBytes(fonts[0], FontStyleType.Regular); + + // The path to output file + String outFilePath = RunExamples.getOutPath() + fonts[0].getFontName() + ".ttf"; + + // Save font + Files.write(Paths.get(outFilePath), bytes); + } finally { + if (pres != null) + pres.dispose(); + } + //ExEnd:FontBinaryDataExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/FontEmbeddingLevelExample.java b/Examples/src/main/java/com/aspose/slides/examples/text/FontEmbeddingLevelExample.java new file mode 100644 index 00000000..185cc236 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/FontEmbeddingLevelExample.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.FontStyleType; +import com.aspose.slides.IFontData; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; + +public class FontEmbeddingLevelExample +{ + public static void main(String[] args) throws IOException + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + //ExStart:FontEmbeddingLevelExample + Presentation pres = new Presentation(dataDir + "Presentation.pptx"); + try { + // Retrieve all fonts used in the presentation + IFontData[] fontDatas = pres.getFontsManager().getFonts(); + + // Get the byte array representing the regular style of the first font in the presentation + byte[] bytes = pres.getFontsManager().getFontBytes(fontDatas[0], FontStyleType.Regular); + + // Determine the embedding level of the font + int embeddingLevel = pres.getFontsManager().getFontEmbeddingLevel(bytes, fontDatas[0].getFontName()); + + // Print embedding level to console + System.out.println(String.format("Font \"%s\" has \"%d\" Embedding Level", fontDatas[0].getFontName(), embeddingLevel)); + } finally { + if (pres != null) + pres.dispose(); + } + //ExEnd:FontEmbeddingLevelExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/FontFamilyExample.java b/Examples/src/main/java/com/aspose/slides/examples/text/FontFamilyExample.java new file mode 100644 index 00000000..d8e8a498 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/FontFamilyExample.java @@ -0,0 +1,72 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class FontFamilyExample +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + //ExStart:FontFamily + // Instantiate Presentation Class + Presentation pres = new Presentation(); + try + { + + // Get first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add an AutoShape of Rectangle type + IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 50, 200, 50); + + // Remove any fill style associated with the AutoShape + ashp.getFillFormat().setFillType(FillType.NoFill); + + // Access the TextFrame associated with the AutoShape + ITextFrame tf = ashp.getTextFrame(); + tf.setText("Aspose TextBox"); + + // Access the Portion associated with the TextFrame + IPortion port = tf.getParagraphs().get_Item(0).getPortions().get_Item(0); + + // Set the Font for the Portion + port.getPortionFormat().setLatinFont(new FontData("Times New Roman")); + + // Set Bold property of the Font + port.getPortionFormat().setFontBold(NullableBool.True); + + // Set Italic property of the Font + port.getPortionFormat().setFontItalic(NullableBool.True); + + // Set Underline property of the Font + port.getPortionFormat().setFontUnderline(TextUnderlineType.Single); + + // Set the Height of the Font + port.getPortionFormat().setFontHeight(25); + + // Set the color of the Font + port.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + port.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); + + //Write the presentation to disk + pres.save(dataDir + "pptxFont_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:FontFamily + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/FontProperties.java b/Examples/src/main/java/com/aspose/slides/examples/text/FontProperties.java new file mode 100644 index 00000000..cd5489a6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/FontProperties.java @@ -0,0 +1,68 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class FontProperties +{ + public static void main(String[] args) + { + //ExStart:FontProperties + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Instantiate a Presentation object that represents a PPTX file// Instantiate a Presentation object that represents a PPTX file + Presentation pres = new Presentation(dataDir + "FontProperties.pptx"); + try + { + + // Accessing a slide using its slide position + ISlide slide = pres.getSlides().get_Item(0); + + // Accessing the first and second placeholder in the slide and typecasting it as AutoShape + ITextFrame tf1 = ((IAutoShape) slide.getShapes().get_Item(0)).getTextFrame(); + ITextFrame tf2 = ((IAutoShape) slide.getShapes().get_Item(1)).getTextFrame(); + + // Accessing the first Paragraph + IParagraph para1 = tf1.getParagraphs().get_Item(0); + IParagraph para2 = tf2.getParagraphs().get_Item(0); + + // Accessing the first portion + IPortion port1 = para1.getPortions().get_Item(0); + IPortion port2 = para2.getPortions().get_Item(0); + + // Define new fonts + FontData fd1 = new FontData("Elephant"); + FontData fd2 = new FontData("Castellar"); + + // Assign new fonts to portion + port1.getPortionFormat().setLatinFont(fd1); + port2.getPortionFormat().setLatinFont(fd2); + + // Set font to Bold + port1.getPortionFormat().setFontBold(NullableBool.True); + port2.getPortionFormat().setFontBold(NullableBool.True); + + // Set font to Italic + port1.getPortionFormat().setFontItalic(NullableBool.True); + port2.getPortionFormat().setFontItalic(NullableBool.True); + + // Set font color + port1.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + port1.getPortionFormat().getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.Purple)); + port2.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + port2.getPortionFormat().getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.Peru)); + + //Write the PPTX to disk + pres.save(dataDir + "WelcomeFont_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:FontProperties + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/GetEffectiveValues.java b/Examples/src/main/java/com/aspose/slides/examples/text/GetEffectiveValues.java new file mode 100644 index 00000000..123e102a --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/GetEffectiveValues.java @@ -0,0 +1,37 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class GetEffectiveValues +{ + public static void main(String[] args) + { + + //ExStart:GetEffectiveValues + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + Presentation pres = new Presentation(dataDir + "Presentation1.pptx"); + try + { + IAutoShape shape = (IAutoShape) pres.getSlides().get_Item(0).getShapes().get_Item(0); + + ITextFrameFormat localTextFrameFormat = shape.getTextFrame().getTextFrameFormat(); + ITextFrameFormatEffectiveData effectiveTextFrameFormat = localTextFrameFormat.getEffective(); + + IPortionFormat localPortionFormat = shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat(); + IPortionFormatEffectiveData effectivePortionFormat = localPortionFormat.getEffective(); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:GetEffectiveValues + + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/GetFontsFolders.java b/Examples/src/main/java/com/aspose/slides/examples/text/GetFontsFolders.java new file mode 100644 index 00000000..4f146648 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/GetFontsFolders.java @@ -0,0 +1,22 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.FontsLoader; +import com.aspose.slides.examples.RunExamples; + + +public class GetFontsFolders +{ + public static void main(String[] args) + { + //ExStart:GetFontsFolders + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + //The following line shall return folders where font files are searched. + //Those are folders that have been added with LoadExternalFonts method as well as system font folders. + String[] fontFolders = FontsLoader.getFontFolders(); + + //ExEnd:GetFontsFolders + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/GetFontsSlideSubstitution.java b/Examples/src/main/java/com/aspose/slides/examples/text/GetFontsSlideSubstitution.java new file mode 100644 index 00000000..da7f186c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/GetFontsSlideSubstitution.java @@ -0,0 +1,31 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.FontSubstitutionInfo; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +/* +Thise example demonstrates how to obtain information about fonts +that will be substituted during the rendering of the specified slides. +*/ +public class GetFontsSlideSubstitution +{ + public static void main(String[] args) + { + // The path to the document directory. + String dataDir = RunExamples.getDataDir_Text(); + + //ExStart:GetFontsSlideSubstitution + Presentation pres = new Presentation(dataDir + "PresFontsSubst.pptx"); + try { + for (FontSubstitutionInfo fontSubstitution : pres.getFontsManager().getSubstitutions(new int[] {1, 2})) + { + System.out.println(fontSubstitution.getOriginalFontName() + " -> " + fontSubstitution.getSubstitutedFontName()); + } + } finally { + if (pres != null) pres.dispose(); + } + + //ExEnd:GetFontsSlideSubstitution + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/GetFontsSubstitution.java b/Examples/src/main/java/com/aspose/slides/examples/text/GetFontsSubstitution.java new file mode 100644 index 00000000..ba452cd4 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/GetFontsSubstitution.java @@ -0,0 +1,26 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.FontSubstitutionInfo; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +public class GetFontsSubstitution +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + //ExStart:GetFontsSubstitution + Presentation pres = new Presentation(dataDir + "PresFontsSubst.pptx"); + try { + for (FontSubstitutionInfo fontSubstitution : pres.getFontsManager().getSubstitutions()) + { + System.out.println(fontSubstitution.getOriginalFontName() + " -> " + fontSubstitution.getSubstitutedFontName()); + } + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:GetFontsSubstitution + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/GetPlaceholderTextExample.java b/Examples/src/main/java/com/aspose/slides/examples/text/GetPlaceholderTextExample.java new file mode 100644 index 00000000..756f01e6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/GetPlaceholderTextExample.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; + +public class GetPlaceholderTextExample +{ + public static void main(String[] args) + { + //ExStart:GetPlaceholderTextExample + Presentation presentation = new Presentation(); + try { + // Add new slide based on LayoutSlides[0] + ISlide slide = presentation.getSlides().addEmptySlide(presentation.getLayoutSlides().get_Item(0)); + + // Search for specified text in a slide, including its layout (layout template text) + for (ITextFrame textFrame : SlideUtil.getTextBoxesContainsText(slide, "Click", true)) + { + // Set text for TextFrame + System.out.println("A text block with the specified text was found."); + textFrame.setText("The new text!"); + } + + // Find all “Text” placeholders on a slide: + for (IShape shape : SlideUtil.findShapesByPlaceholderType(slide, PlaceholderType.CenteredTitle)) + { + System.out.println("Placeholder of type PlaceholderType.CenteredTitle was found."); + ((IAutoShape)shape).getTextFrame().setText("This is a Text placeholder."); + } + } finally { + if (presentation != null) presentation.dispose(); + } + //ExEnd:GetPlaceholderTextExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/GetPresentationRowTextExample.java b/Examples/src/main/java/com/aspose/slides/examples/text/GetPresentationRowTextExample.java new file mode 100644 index 00000000..80aa6358 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/GetPresentationRowTextExample.java @@ -0,0 +1,25 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +/* +This example demonstrates how to get raw text of a presentation using PresentationFactory.Instance.GetPresentationText method. + +In version 24.9 this method only works if you have a license. +*/ +public class GetPresentationRowTextExample +{ + public static void main(String[] args) + { + String presentationName = RunExamples.getDataDir_Text() + "PresentationText.pptx"; + + //ExStart:CreateBoundsShapeThumbnail + IPresentationText presentationText = PresentationFactory.getInstance().getPresentationText(presentationName, TextExtractionArrangingMode.Unarranged); + + System.out.println("Comments for Slide 1 : " + presentationText.getSlidesText()[0].getCommentsText()); + System.out.println("Text for Slide 1 : " + presentationText.getSlidesText()[0].getText()); + System.out.println("Notes for Slide 2 : " + presentationText.getSlidesText()[1].getNotesText()); + //ExEnd:CreateBoundsShapeThumbnail + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/GetTextFrameFormatEffectiveData.java b/Examples/src/main/java/com/aspose/slides/examples/text/GetTextFrameFormatEffectiveData.java new file mode 100644 index 00000000..edc6a4f3 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/GetTextFrameFormatEffectiveData.java @@ -0,0 +1,46 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.IAutoShape; +import com.aspose.slides.ITextFrameFormat; +import com.aspose.slides.ITextFrameFormatEffectiveData; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class GetTextFrameFormatEffectiveData +{ + public static void main(String[] args) + { + + //ExStart:GetTextFrameFormatEffectiveData + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + Presentation pres = new Presentation(dataDir + "Presentation1.pptx"); + try + { + IAutoShape shape = (IAutoShape) pres.getSlides().get_Item(0).getShapes().get_Item(0); + + ITextFrameFormat textFrameFormat = shape.getTextFrame().getTextFrameFormat(); + ITextFrameFormatEffectiveData effectiveTextFrameFormat = textFrameFormat.getEffective(); + + + System.out.println("Anchoring type: " + effectiveTextFrameFormat.getAnchoringType()); + System.out.println("Autofit type: " + effectiveTextFrameFormat.getAutofitType()); + System.out.println("Text vertical type: " + effectiveTextFrameFormat.getTextVerticalType()); + System.out.println("Margins"); + System.out.println(" Left: " + effectiveTextFrameFormat.getMarginLeft()); + System.out.println(" Top: " + effectiveTextFrameFormat.getMarginTop()); + System.out.println(" Right: " + effectiveTextFrameFormat.getMarginRight()); + System.out.println(" Bottom: " + effectiveTextFrameFormat.getMarginBottom()); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:GetTextFrameFormatEffectiveData + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/GetTextFromSmartArtNode.java b/Examples/src/main/java/com/aspose/slides/examples/text/GetTextFromSmartArtNode.java new file mode 100644 index 00000000..37d4eb81 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/GetTextFromSmartArtNode.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class GetTextFromSmartArtNode +{ + public static void main(String[] args) + { + // ExStart:GetTextFromSmartArtNode + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + Presentation presentation = new Presentation("Presentation.pptx"); + try + { + ISlide slide = presentation.getSlides().get_Item(0); + ISmartArt smartArt = (ISmartArt) slide.getShapes().get_Item(0); + + ISmartArtNodeCollection smartArtNodes = smartArt.getAllNodes(); + for (ISmartArtNode smartArtNode : (Iterable) smartArtNodes) + { + for (ISmartArtShape nodeShape : smartArtNode.getShapes()) + { + if (nodeShape.getTextFrame() != null) + System.out.println(nodeShape.getTextFrame().getText()); + } + } + } + finally + { + if (presentation != null) presentation.dispose(); + } + } + // ExEnd:GetTextFromSmartArtNode +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/GetTextStyleEffectiveData.java b/Examples/src/main/java/com/aspose/slides/examples/text/GetTextStyleEffectiveData.java new file mode 100644 index 00000000..5df2d97e --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/GetTextStyleEffectiveData.java @@ -0,0 +1,47 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.IAutoShape; +import com.aspose.slides.IParagraphFormatEffectiveData; +import com.aspose.slides.ITextStyleEffectiveData; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class GetTextStyleEffectiveData +{ + public static void main(String[] args) + { + + //ExStart: + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + + Presentation pres = new Presentation(dataDir + "Presentation1.pptx"); + try + { + IAutoShape shape = (IAutoShape) pres.getSlides().get_Item(0).getShapes().get_Item(0); + ITextStyleEffectiveData effectiveTextStyle = shape.getTextFrame().getTextFrameFormat().getTextStyle().getEffective(); + + for (int i = 0; i <= 8; i++) + { + IParagraphFormatEffectiveData effectiveStyleLevel = effectiveTextStyle.getLevel(i); + System.out.println("= Effective paragraph formatting for style level #" + i + " ="); + + System.out.println("Depth: " + effectiveStyleLevel.getDepth()); + System.out.println("Indent: " + effectiveStyleLevel.getIndent()); + System.out.println("Alignment: " + effectiveStyleLevel.getAlignment()); + System.out.println("Font alignment: " + effectiveStyleLevel.getFontAlignment()); + } + + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd: + } + +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/HighlightText.java b/Examples/src/main/java/com/aspose/slides/examples/text/HighlightText.java new file mode 100644 index 00000000..56b7d01e --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/HighlightText.java @@ -0,0 +1,30 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class HighlightText +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + //ExStart:HighlightText + Presentation presentation = new Presentation(dataDir + "SomePresentation.pptx"); + // highlighting all words 'title' + ((AutoShape) presentation.getSlides().get_Item(0).getShapes().get_Item(0)).getTextFrame().highlightText("title", Color.BLUE); + TextSearchOptions textSearchOptions = new TextSearchOptions(); + textSearchOptions.setWholeWordsOnly(true); + // highlighting all separate 'to' occurrences + ((AutoShape)presentation.getSlides().get_Item(0).getShapes().get_Item(0)).getTextFrame().highlightText("to", Color.MAGENTA, textSearchOptions, null); + + presentation.save(RunExamples.getOutPath() + "SomePresentation-out2.pptx", SaveFormat.Pptx); + + //ExEnd:HighlightText + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/HighlightTextusingRegex.java b/Examples/src/main/java/com/aspose/slides/examples/text/HighlightTextusingRegex.java new file mode 100644 index 00000000..375d3116 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/HighlightTextusingRegex.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.AutoShape; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.TextHighlightingOptions; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.util.regex.Pattern; + + +public class HighlightTextusingRegex +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Path to output file + String outFileName = RunExamples.getOutPath() + "omePresentation-out.pptx"; + + //ExStart:HighlightTextUsingRegx + Presentation presentation = new Presentation(dataDir + "SomePresentation.pptx"); + try { + Pattern regex = Pattern.compile("\\b[^\\s]{5,}\\b"); + ((AutoShape)presentation.getSlides().get_Item(0).getShapes().get_Item(0)).getTextFrame().highlightRegex(regex, Color.BLUE, null); + presentation.save(outFileName, SaveFormat.Pptx); + } finally { + if (presentation != null) presentation.dispose(); + } + //ExEnd:HighlightTextUsingRegx + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ImportingHTMLText.java b/Examples/src/main/java/com/aspose/slides/examples/text/ImportingHTMLText.java new file mode 100644 index 00000000..7780dbf6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ImportingHTMLText.java @@ -0,0 +1,52 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + + +public class ImportingHTMLText +{ + public static void main(String[] args) throws IOException + { + //ExStart:ImportingHTMLText + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create Empty presentation instance// Create Empty presentation instance + Presentation pres = new Presentation(); + try + { + // Acesss the default first slide of presentation + ISlide slide = pres.getSlides().get_Item(0); + + // Adding the AutoShape to accomodate the HTML content + IAutoShape ashape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 10, 10, (float) pres.getSlideSize().getSize().getWidth() - 20, (float) pres.getSlideSize().getSize().getHeight() - 10); + + ashape.getFillFormat().setFillType(FillType.NoFill); + + // Adding text frame to the shape + ashape.addTextFrame(""); + + // Clearing all paragraphs in added text frame + ashape.getTextFrame().getParagraphs().clear(); + + // Loading the HTML file using stream reader + String tr = new String(Files.readAllBytes(Paths.get(dataDir + "file.html"))); + + // Adding text from HTML stream reader in text frame + ashape.getTextFrame().getParagraphs().addFromHtml(tr); + + // Saving Presentation + pres.save(dataDir + "output_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ImportingHTMLText + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/KeepTextFlat.java b/Examples/src/main/java/com/aspose/slides/examples/text/KeepTextFlat.java new file mode 100644 index 00000000..9fa8ef0f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/KeepTextFlat.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.AutoShape; +import com.aspose.slides.IAutoShape; +import com.aspose.slides.ImageFormat; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +public class KeepTextFlat +{ + // This example demonstrates setting keep text out of 3D scene. + public static void main(String[] args) + { + //ExStart:KeepTextFlat + + String pptxFileName = RunExamples.getDataDir_Text() + "KeepTextFlat.pptx"; + String resultPath = RunExamples.getOutPath() + "KeepTextFlat_out.png"; + + Presentation pres = new Presentation(pptxFileName); + try { + IAutoShape shape1 = (AutoShape) pres.getSlides().get_Item(0).getShapes().get_Item(0); + IAutoShape shape2 = (AutoShape) pres.getSlides().get_Item(0).getShapes().get_Item(1); + + shape1.getTextFrame().getTextFrameFormat().setKeepTextFlat(false); + shape2.getTextFrame().getTextFrameFormat().setKeepTextFlat(true); + + pres.getSlides().get_Item(0).getImage(4 / 3f, 4 / 3f).save(resultPath, ImageFormat.Png); + } finally { + if (pres != null) pres.dispose(); + } + + //ExEnd:KeepTextFlat + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/LineSpacing.java b/Examples/src/main/java/com/aspose/slides/examples/text/LineSpacing.java new file mode 100644 index 00000000..dea8d4c9 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/LineSpacing.java @@ -0,0 +1,36 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class LineSpacing +{ + public static void main(String[] args) + { + //ExStart:LineSpacing + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(dataDir + "Fonts.pptx"); + + // Obtain a slide's reference by its index + ISlide sld = presentation.getSlides().get_Item(0); + + // Access the TextFrame + ITextFrame tf1 = ((IAutoShape) sld.getShapes().get_Item(0)).getTextFrame(); + + // Access the Paragraph + IParagraph para1 = tf1.getParagraphs().get_Item(0); + + // Set properties of Paragraph + para1.getParagraphFormat().setSpaceWithin(80); + para1.getParagraphFormat().setSpaceBefore(40); + para1.getParagraphFormat().setSpaceAfter(40); + // Save Presentation + presentation.save(dataDir + "LineSpacing_out.pptx", SaveFormat.Pptx); + //ExEnd:LineSpacing + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/LoadExternalFont.java b/Examples/src/main/java/com/aspose/slides/examples/text/LoadExternalFont.java new file mode 100644 index 00000000..2bedac48 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/LoadExternalFont.java @@ -0,0 +1,48 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.FontsLoader; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + + +public class LoadExternalFont + +{ + public static void main(String[] args) throws IOException + { + // ExStart:LoadExternalFont + + // The path to the documents directory. + + String dataDir = RunExamples.getDataDir_Text(); + + + // loading presentation uses SomeFont which is not installed on the system + Presentation pres = new Presentation(); + try + { + // load SomeFont from file into the byte array + Path path = Paths.get(dataDir + "CustomFonts.ttf"); + byte[] fontData = Files.readAllBytes(path); + + // load font represented as byte array + FontsLoader.loadExternalFont(fontData); + + // font SomeFont will be available during the rendering or other operations + } + finally + { + if (pres != null) pres.dispose(); + } + } + + // ExEnd:LoadExternalFont + +} + + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ManageEmbeddedFonts.java b/Examples/src/main/java/com/aspose/slides/examples/text/ManageEmbeddedFonts.java new file mode 100644 index 00000000..8d95b044 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ManageEmbeddedFonts.java @@ -0,0 +1,56 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class ManageEmbeddedFonts +{ + public static void main(String[] args) + { + //ExStart:ManageEmbeddedFonts + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Instantiate a Presentation object that represents a presentation file + Presentation presentation = new Presentation(dataDir + "EmbeddedFonts.pptx"); + try + { + // render a slide that contains a text frame that uses embedded "FunSized" + presentation.getSlides().get_Item(0).getImage(new Dimension(960, 720)) + .save(dataDir + "picture1_out.png", ImageFormat.Png); + + IFontsManager fontsManager = presentation.getFontsManager(); + + // get all embedded fonts + IFontData[] embeddedFonts = fontsManager.getEmbeddedFonts(); + + // find "Calibri" font + IFontData funSizedEmbeddedFont = null; + for (IFontData embeddedFont : embeddedFonts) + { + if ("Calibri".equals(embeddedFont.getFontName())) + { + funSizedEmbeddedFont = embeddedFont; + break; + } + } + // remove "Calibri" font + if (funSizedEmbeddedFont != null) fontsManager.removeEmbeddedFont(funSizedEmbeddedFont); + + // render the presentation; removed "Calibri" font is replaced to an existing one + presentation.getSlides().get_Item(0).getImage(new Dimension(960, 720)) + .save(dataDir + "picture2_out.png", ImageFormat.Png); + + // save the presentation without embedded "Calibri" font + presentation.save(dataDir + "WithoutManageEmbeddedFonts_out.ppt", SaveFormat.Ppt); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ManageEmbeddedFonts + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ManageParagraphFontProperties.java b/Examples/src/main/java/com/aspose/slides/examples/text/ManageParagraphFontProperties.java new file mode 100644 index 00000000..ee662f99 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ManageParagraphFontProperties.java @@ -0,0 +1,71 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class ManageParagraphFontProperties +{ + public static void main(String[] args) + { + //ExStart:ManageParagraphFontProperties + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Instantiate PresentationEx + Presentation presentation = new Presentation(dataDir + "DefaultFonts.pptx"); + try + { + // Accessing a slide using its slide position + ISlide slide = presentation.getSlides().get_Item(0); + + // Accessing the first and second placeholder in the slide and typecasting it as AutoShape + ITextFrame tf1 = ((IAutoShape) slide.getShapes().get_Item(0)).getTextFrame(); + ITextFrame tf2 = ((IAutoShape) slide.getShapes().get_Item(1)).getTextFrame(); + + // Accessing the first Paragraph + IParagraph para1 = tf1.getParagraphs().get_Item(0); + IParagraph para2 = tf2.getParagraphs().get_Item(0); + + // Justify the paragraph + para2.getParagraphFormat().setAlignment(TextAlignment.JustifyLow); + + // Accessing the first portion + IPortion port1 = para1.getPortions().get_Item(0); + IPortion port2 = para2.getPortions().get_Item(0); + + // Define new fonts + FontData fd1 = new FontData("Elephant"); + FontData fd2 = new FontData("Castellar"); + + // Assign new fonts to portion + port1.getPortionFormat().setLatinFont(fd1); + port2.getPortionFormat().setLatinFont(fd2); + + // Set font to Bold + port1.getPortionFormat().setFontBold(NullableBool.True); + port2.getPortionFormat().setFontBold(NullableBool.True); + + // Set font to Italic + port1.getPortionFormat().setFontItalic(NullableBool.True); + port2.getPortionFormat().setFontItalic(NullableBool.True); + + // Set font color + port1.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + port1.getPortionFormat().getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.Purple)); + port2.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + port2.getPortionFormat().getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.Peru)); + + // Write the PPTX to disk + presentation.save(dataDir + "ManagParagraphFontProperties_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:ManageParagraphFontProperties + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ManageParagraphPictureBulletsInPPT.java b/Examples/src/main/java/com/aspose/slides/examples/text/ManageParagraphPictureBulletsInPPT.java new file mode 100644 index 00000000..88f147e1 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ManageParagraphPictureBulletsInPPT.java @@ -0,0 +1,54 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ManageParagraphPictureBulletsInPPT +{ + public static void main(String[] args) + { + //ExStart:ManageParagraphPictureBulletsInPPT + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + String outputDir = RunExamples.getOutPath(); + + Presentation presentation = new Presentation(); + + // Accessing the first slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Instantiate the image for bullets + IImage image = Images.fromFile(dataDir + "bullets.png"); + IPPImage ippxImage = presentation.getImages().addImage(image); + + // Adding and accessing Autoshape + IAutoShape autoShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 200, 200, 400, 200); + + // Accessing the text frame of created autoshape + ITextFrame textFrame = autoShape.getTextFrame(); + + // Removing the default exisiting paragraph + textFrame.getParagraphs().removeAt(0); + + // Creating new paragraph + Paragraph paragraph = new Paragraph(); + paragraph.setText("Welcome to Aspose.Slides"); + + // Setting paragraph bullet style and image + paragraph.getParagraphFormat().getBullet().setType(BulletType.Picture); + paragraph.getParagraphFormat().getBullet().getPicture().setImage(ippxImage); + + // Setting Bullet Height + paragraph.getParagraphFormat().getBullet().setHeight(100); + + // Adding Paragraph to text frame + textFrame.getParagraphs().add(paragraph); + + // Writing the presentation as a PPTX file + presentation.save(outputDir + "ParagraphPictureBulletsPPTX_out.pptx", SaveFormat.Pptx); + // Writing the presentation as a PPT file + presentation.save(outputDir + "ParagraphPictureBulletsPPT_out.ppt", SaveFormat.Ppt); + //ExEnd:ManageParagraphPictureBulletsInPPT + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ManageScriptFontsExample.java b/Examples/src/main/java/com/aspose/slides/examples/text/ManageScriptFontsExample.java new file mode 100644 index 00000000..8fd7a63f --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ManageScriptFontsExample.java @@ -0,0 +1,35 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.Collections.Generic.Dictionary; +import com.aspose.slides.Collections.Generic.KeyValuePair; + +public class ManageScriptFontsExample +{ + public static void main(String[] args) + { + //ExStart:ManageScriptFontsExample + Presentation pres = new Presentation(); + try { + // Get all script mapping + Dictionary scriptFontMap = pres.getMasterTheme().getFontScheme().getMajor().getScriptFontMap(); + for (KeyValuePair kvp : scriptFontMap) + { + System.out.println(kvp.getKey() + " = " + kvp.getValue()); + } + + // Get script font + System.out.println("Font for \"Thaa\" tag is " + pres.getMasterTheme().getFontScheme().getMajor().getScriptFont("Thaa")); + + // Set script font + pres.getMasterTheme().getFontScheme().getMajor().setScriptFont("Thaa", "Super Thaa"); + pres.getMasterTheme().getFontScheme().getMinor().removeScriptFont("Geor"); + + // Check script font + System.out.println("Font for \"Thaa\" tag is " + pres.getMasterTheme().getFontScheme().getMajor().getScriptFont("Thaa")); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:ManageScriptFontsExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/MultipleParagraphs.java b/Examples/src/main/java/com/aspose/slides/examples/text/MultipleParagraphs.java new file mode 100644 index 00000000..176913f3 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/MultipleParagraphs.java @@ -0,0 +1,89 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class MultipleParagraphs +{ + public static void main(String[] args) + { + //ExStart:MultipleParagraphs + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate a Presentation class that represents a PPTX file + Presentation pres = new Presentation(); + try + { + // Accessing first slide + ISlide slide = pres.getSlides().get_Item(0); + + // Add an AutoShape of Rectangle type + IAutoShape ashp = slide.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 300, 150); + + // Access TextFrame of the AutoShape + ITextFrame tf = ashp.getTextFrame(); + + // Create Paragraphs and Portions with different text formats + IParagraph para0 = tf.getParagraphs().get_Item(0); + IPortion port01 = new Portion(); + IPortion port02 = new Portion(); + para0.getPortions().add(port01); + para0.getPortions().add(port02); + + IParagraph para1 = new Paragraph(); + tf.getParagraphs().add(para1); + IPortion port10 = new Portion(); + IPortion port11 = new Portion(); + IPortion port12 = new Portion(); + para1.getPortions().add(port10); + para1.getPortions().add(port11); + para1.getPortions().add(port12); + + IParagraph para2 = new Paragraph(); + tf.getParagraphs().add(para2); + IPortion port20 = new Portion(); + IPortion port21 = new Portion(); + IPortion port22 = new Portion(); + para2.getPortions().add(port20); + para2.getPortions().add(port21); + para2.getPortions().add(port22); + + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + { + tf.getParagraphs().get_Item(i).getPortions().get_Item(j).setText("Portion0" + j); + if (j == 0) + { + tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().getFillFormat().setFillType(FillType.Solid); + tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.RED); + tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().setFontBold(NullableBool.True); + tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().setFontHeight(15); + } else if (j == 1) + { + tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().getFillFormat().setFillType(FillType.Solid); + tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); + tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().setFontItalic(NullableBool.True); + tf.getParagraphs().get_Item(i).getPortions().get_Item(j).getPortionFormat().setFontHeight(18); + } + } + + //Write PPTX to Disk + pres.save(dataDir + "multiParaPort_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:MultipleParagraphs + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/MutilevelBullets.java b/Examples/src/main/java/com/aspose/slides/examples/text/MutilevelBullets.java new file mode 100644 index 00000000..c9ffdc31 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/MutilevelBullets.java @@ -0,0 +1,97 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class MutilevelBullets +{ + public static void main(String[] args) + { + //ExStart:MutilevelBullets + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Creating a presenation instance + Presentation pres = new Presentation(); + try + { + + // Accessing the first slide + ISlide slide = pres.getSlides().get_Item(0); + + // Adding and accessing Autoshape + IAutoShape aShp = slide.getShapes().addAutoShape(ShapeType.Rectangle, 200, 200, 400, 200); + + // Accessing the text frame of created autoshape + ITextFrame text = aShp.addTextFrame(""); + + //clearing default paragraph + text.getParagraphs().clear(); + + //Adding first paragraph + IParagraph para1 = new Paragraph(); + para1.setText("Content"); + para1.getParagraphFormat().getBullet().setType(BulletType.Symbol); + para1.getParagraphFormat().getBullet().setChar((char) 8226); + para1.getParagraphFormat().getDefaultPortionFormat().getFillFormat().setFillType(FillType.Solid); + para1.getParagraphFormat().getDefaultPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); + //Setting bullet level + para1.getParagraphFormat().setDepth((short) 0); + + //Adding second paragraph + IParagraph para2 = new Paragraph(); + para2.setText("Second Level"); + para2.getParagraphFormat().getBullet().setType(BulletType.Symbol); + para2.getParagraphFormat().getBullet().setChar('-'); + para2.getParagraphFormat().getDefaultPortionFormat().getFillFormat().setFillType(FillType.Solid); + para2.getParagraphFormat().getDefaultPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); + //Setting bullet level + para2.getParagraphFormat().setDepth((short) 1); + + //Adding third paragraph + IParagraph para3 = new Paragraph(); + para3.setText("Third Level"); + para3.getParagraphFormat().getBullet().setType(BulletType.Symbol); + para3.getParagraphFormat().getBullet().setChar((char) 8226); + para3.getParagraphFormat().getDefaultPortionFormat().getFillFormat().setFillType(FillType.Solid); + para3.getParagraphFormat().getDefaultPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); + //Setting bullet level + para3.getParagraphFormat().setDepth((short) 2); + + //Adding fourth paragraph + IParagraph para4 = new Paragraph(); + para4.setText("Fourth Level"); + para4.getParagraphFormat().getBullet().setType(BulletType.Symbol); + para4.getParagraphFormat().getBullet().setChar('-'); + para4.getParagraphFormat().getDefaultPortionFormat().getFillFormat().setFillType(FillType.Solid); + para4.getParagraphFormat().getDefaultPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); + //Setting bullet level + para4.getParagraphFormat().setDepth((short) 3); + + //Adding paragraphs to collection + text.getParagraphs().add(para1); + text.getParagraphs().add(para2); + text.getParagraphs().add(para3); + text.getParagraphs().add(para4); + + //Writing the presentation as a PPTX file + pres.save(dataDir + "MultilevelBullet.pptx", SaveFormat.Pptx); + + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:MutilevelBullets + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/NumberlinesInParagraph.java b/Examples/src/main/java/com/aspose/slides/examples/text/NumberlinesInParagraph.java new file mode 100644 index 00000000..97edc330 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/NumberlinesInParagraph.java @@ -0,0 +1,29 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; + + +public class NumberlinesInParagraph +{ + //ExStart:NumberlinesInParagraph + public static void main(String[] args) + { + Presentation presentation = new Presentation(); + try { + ISlide sld = presentation.getSlides().get_Item(0); + IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 150, 50); + IParagraph para = ashp.getTextFrame().getParagraphs().get_Item(0); + IPortion portion = para.getPortions().get_Item(0); + portion.setText("Aspose Paragraph GetLinesCount() Example"); + + System.out.println("Lines Count = " + para.getLinesCount()); + + // Change shape width + ashp.setWidth(250); + System.out.println("Lines Count after changing shape width = " + para.getLinesCount()); + } finally { + if (presentation != null) presentation.dispose(); + } + } + //ExEnd:NumberlinesInParagraph +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ParagraphBullets.java b/Examples/src/main/java/com/aspose/slides/examples/text/ParagraphBullets.java new file mode 100644 index 00000000..d1f57b26 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ParagraphBullets.java @@ -0,0 +1,99 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.File; + + +public class ParagraphBullets +{ + public static void main(String[] args) + { + //ExStart:ParagraphBullets + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Creating a presenation instance + Presentation pres = new Presentation(); + try + { + + // Accessing the first slide + ISlide slide = pres.getSlides().get_Item(0); + + + // Adding and accessing Autoshape + IAutoShape aShp = slide.getShapes().addAutoShape(ShapeType.Rectangle, 200, 200, 400, 200); + + // Accessing the text frame of created autoshape + ITextFrame txtFrm = aShp.getTextFrame(); + + // Removing the default exisiting paragraph + txtFrm.getParagraphs().removeAt(0); + + // Creating a paragraph + Paragraph para = new Paragraph(); + + // Setting paragraph bullet style and symbol + para.getParagraphFormat().getBullet().setType(BulletType.Symbol); + para.getParagraphFormat().getBullet().setChar((char) 8226); + + // Setting paragraph text + para.setText("Welcome to Aspose.Slides"); + + // Setting bullet indent + para.getParagraphFormat().setIndent(25); + + // Setting bullet color + para.getParagraphFormat().getBullet().getColor().setColorType(ColorType.RGB); + para.getParagraphFormat().getBullet().getColor().setColor(Color.BLACK); + para.getParagraphFormat().getBullet().setBulletHardColor(NullableBool.True); // set IsBulletHardColor to true to use own bullet color + + // Setting Bullet Height + para.getParagraphFormat().getBullet().setHeight(100); + + // Adding Paragraph to text frame + txtFrm.getParagraphs().add(para); + + // Creating second paragraph + Paragraph para2 = new Paragraph(); + + // Setting paragraph bullet type and style + para2.getParagraphFormat().getBullet().setType(BulletType.Numbered); + para2.getParagraphFormat().getBullet().setNumberedBulletStyle(NumberedBulletStyle.BulletCircleNumWDBlackPlain); + + // Adding paragraph text + para2.setText("This is numbered bullet"); + + // Setting bullet indent + para2.getParagraphFormat().setIndent(25); + + para2.getParagraphFormat().getBullet().getColor().setColorType(ColorType.RGB); + para2.getParagraphFormat().getBullet().getColor().setColor(Color.BLACK); + para2.getParagraphFormat().getBullet().setBulletHardColor(NullableBool.True); // set IsBulletHardColor to true to use own bullet color + + // Setting Bullet Height + para2.getParagraphFormat().getBullet().setHeight(100); + + // Adding Paragraph to text frame + txtFrm.getParagraphs().add(para2); + + + //Writing the presentation as a PPTX file + pres.save(dataDir + "Bullet_out.pptx", SaveFormat.Pptx); + + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ParagraphBullets + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ParagraphIndent.java b/Examples/src/main/java/com/aspose/slides/examples/text/ParagraphIndent.java new file mode 100644 index 00000000..ad00f3c8 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ParagraphIndent.java @@ -0,0 +1,71 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class ParagraphIndent +{ + public static void main(String[] args) + { + //ExStart:ParagraphIndent + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate Presentation Class + Presentation pres = new Presentation(); + + // Get first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add a Rectangle Shape + IAutoShape rect = sld.getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 500, 150); + + // Add TextFrame to the Rectangle + ITextFrame tf = rect.addTextFrame("This is first line \rThis is second line \rThis is third line"); + + // Set the text to fit the shape + tf.getTextFrameFormat().setAutofitType(TextAutofitType.Shape); + + // Hide the lines of the Rectangle + rect.getLineFormat().getFillFormat().setFillType(FillType.Solid); + + // Get first Paragraph in the TextFrame and set its Indent + IParagraph para1 = tf.getParagraphs().get_Item(0); + // Setting paragraph bullet style and symbol + para1.getParagraphFormat().getBullet().setType(BulletType.Symbol); + para1.getParagraphFormat().getBullet().setChar((char) 8226); + para1.getParagraphFormat().setAlignment(TextAlignment.Left); + + para1.getParagraphFormat().setDepth((short) 2); + para1.getParagraphFormat().setIndent(30); + + // Get second Paragraph in the TextFrame and set its Indent + IParagraph para2 = tf.getParagraphs().get_Item(1); + para2.getParagraphFormat().getBullet().setType(BulletType.Symbol); + para2.getParagraphFormat().getBullet().setChar((char) 8226); + para2.getParagraphFormat().setAlignment(TextAlignment.Left); + para2.getParagraphFormat().setDepth((short) 2); + para2.getParagraphFormat().setIndent(40); + + // Get third Paragraph in the TextFrame and set its Indent + IParagraph para3 = tf.getParagraphs().get_Item(2); + para3.getParagraphFormat().getBullet().setType(BulletType.Symbol); + para3.getParagraphFormat().getBullet().setChar((char) 8226); + para3.getParagraphFormat().setAlignment(TextAlignment.Left); + para3.getParagraphFormat().setDepth((short) 2); + para3.getParagraphFormat().setIndent(50); + + //Write the Presentation to disk + pres.save(dataDir + "InOutDent_out.pptx", SaveFormat.Pptx); + //ExEnd:ParagraphIndent + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ParagraphsAlignment.java b/Examples/src/main/java/com/aspose/slides/examples/text/ParagraphsAlignment.java new file mode 100644 index 00000000..a56b1919 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ParagraphsAlignment.java @@ -0,0 +1,48 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ParagraphsAlignment +{ + public static void main(String[] args) + { + //ExStart:ParagraphsAlignment + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Instantiate a Presentation object that represents a PPTX file + Presentation pres = new Presentation(dataDir + "ParagraphsAlignment.pptx"); + try + { + + // Accessing first slide + ISlide slide = pres.getSlides().get_Item(0); + + // Accessing the first and second placeholder in the slide and typecasting it as AutoShape + ITextFrame tf1 = ((IAutoShape) slide.getShapes().get_Item(0)).getTextFrame(); + ITextFrame tf2 = ((IAutoShape) slide.getShapes().get_Item(1)).getTextFrame(); + + // Change the text in both placeholders + tf1.setText("Center Align by Aspose"); + tf2.setText("Center Align by Aspose"); + + // Getting the first paragraph of the placeholders + IParagraph para1 = tf1.getParagraphs().get_Item(0); + IParagraph para2 = tf2.getParagraphs().get_Item(0); + + // Aligning the text paragraph to center + para1.getParagraphFormat().setAlignment(TextAlignment.Center); + para2.getParagraphFormat().setAlignment(TextAlignment.Center); + + //Writing the presentation as a PPTX file + pres.save(dataDir + "Centeralign_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ParagraphsAlignment + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/PortionGetRect.java b/Examples/src/main/java/com/aspose/slides/examples/text/PortionGetRect.java new file mode 100644 index 00000000..bd8734c0 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/PortionGetRect.java @@ -0,0 +1,104 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.awt.geom.Rectangle2D; + + +public class PortionGetRect +{ + public static void main(String[] args) + { + String outPath = RunExamples.getOutPath(); + + Presentation pres = new Presentation(); + try + { + // Create table + ITable tbl = pres.getSlides().get_Item(0).getShapes().addTable(50, 50, new double[]{50, 70}, new double[]{50, 50, 50}); + + // Create paragraths + IParagraph paragraph0 = new Paragraph(); + paragraph0.getPortions().add(new Portion("Text ")); + paragraph0.getPortions().add(new Portion("in0")); + paragraph0.getPortions().add(new Portion(" Cell")); + + IParagraph paragraph1 = new Paragraph(); + paragraph1.setText("On0"); + + IParagraph paragraph2 = new Paragraph(); + paragraph2.getPortions().add(new Portion("Hi there ")); + paragraph2.getPortions().add(new Portion("col0")); + + ICell cell = tbl.get_Item(1, 1); + + // Add text into the table cell + cell.getTextFrame().getParagraphs().clear(); + cell.getTextFrame().getParagraphs().add(paragraph0); + cell.getTextFrame().getParagraphs().add(paragraph1); + cell.getTextFrame().getParagraphs().add(paragraph2); + + // Add TextFrame + IAutoShape autoShape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 400, 100, 60, 120); + autoShape.getTextFrame().setText("Text in shape"); + autoShape.getTextFrame().getParagraphs().get_Item(0).getParagraphFormat().setAlignment(TextAlignment.Left); + + // Getting coordinates of the left top corner of the table cell. + double x = tbl.getX() + cell.getOffsetX(); + double y = tbl.getY() + cell.getOffsetY(); + + // Using IParagrap.getRect() and IPortion.getRect() methods in order to add frame to portions and paragraphs. + for (IParagraph para : cell.getTextFrame().getParagraphs()) + { + if ("".equals(para.getText())) + continue; + + Rectangle2D.Float rect = (Rectangle2D.Float) para.getRect().clone(); + IAutoShape shape = + (IAutoShape) pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, + (float) rect.getX() + (float) x, (float) rect.getY() + (float) y, (float) rect.getWidth(), (float) rect.getHeight()); + + shape.getFillFormat().setFillType(FillType.NoFill); + shape.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.YELLOW); + shape.getLineFormat().getFillFormat().setFillType(FillType.Solid); + + + for (IPortion portion : para.getPortions()) + { + if (portion.getText().contains("0")) + { + rect = portion.getRect(); + shape = + pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, + (float) rect.getX() + (float) x, (float) rect.getY() + (float) y, (float) rect.getWidth(), (float) rect.getHeight()); + + shape.getFillFormat().setFillType(FillType.NoFill); + } + } + } + + // Add frame to AutoShape paragraphs. + for (IParagraph para : autoShape.getTextFrame().getParagraphs()) + { + Rectangle2D.Float rect = (Rectangle2D.Float) para.getRect().clone(); + IAutoShape shape = + (IAutoShape) pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, + (float) rect.getX() + autoShape.getX(), (float) rect.getY() + autoShape.getY(), (float) rect.getWidth(), (float) rect.getHeight()); + + shape.getFillFormat().setFillType(FillType.NoFill); + shape.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.YELLOW); + shape.getLineFormat().getFillFormat().setFillType(FillType.Solid); + + } + + pres.save(outPath + "GetRect_Out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/RenderingWithFallBackFont.java b/Examples/src/main/java/com/aspose/slides/examples/text/RenderingWithFallBackFont.java new file mode 100644 index 00000000..e548d326 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/RenderingWithFallBackFont.java @@ -0,0 +1,55 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class RenderingWithFallBackFont +{ + public static void main(String[] args) + { + + //ExStart:RenderingWithFallBackFont + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create new instance of a rules collection + IFontFallBackRulesCollection rulesList = new FontFallBackRulesCollection(); + + // create a number of rules + rulesList.add(new FontFallBackRule(0x400, 0x4FF, "Times New Roman")); + //rulesList.add(new FontFallBackRule(...)); + + for (IFontFallBackRule fallBackRule : (Iterable) rulesList) + { + //Trying to remove FallBack font "Tahoma" from loaded rules + fallBackRule.remove("Tahoma"); + + //And to update of rules for specified range + if ((fallBackRule.getRangeEndIndex() >= 0x4000) && (fallBackRule.getRangeStartIndex() < 0x5000)) + fallBackRule.addFallBackFonts("Verdana"); + } + + //Also we can remove any existing rules from list + if (rulesList.size() > 0) + rulesList.remove(rulesList.get_Item(0)); + + Presentation pres = new Presentation(dataDir + "input.pptx"); + try + { + //Assigning a prepared rules list for using + pres.getFontsManager().setFontFallBackRulesCollection(rulesList); + + // Rendering of thumbnail with using of initialized rules collection and saving to PNG + pres.getSlides().get_Item(0).getImage(1f, 1f).save(dataDir + "Slide_0.png", ImageFormat.Png); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:RenderingWithFallBackFont + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ReplaceFontsExplicitly.java b/Examples/src/main/java/com/aspose/slides/examples/text/ReplaceFontsExplicitly.java new file mode 100644 index 00000000..315079db --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ReplaceFontsExplicitly.java @@ -0,0 +1,34 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.FontData; +import com.aspose.slides.IFontData; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class ReplaceFontsExplicitly +{ + public static void main(String[] args) + { + //ExStart:ReplaceFontsExplicitly + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Load presentation + Presentation presentation = new Presentation(dataDir + "Fonts.pptx"); + + // Load source font to be replaced + IFontData sourceFont = new FontData("Arial"); + + // Load the replacing font + IFontData destFont = new FontData("Times New Roman"); + + // Replace the fonts + presentation.getFontsManager().replaceFont(sourceFont, destFont); + + // Save the presentation + presentation.save(dataDir + "UpdatedFont_out.pptx", SaveFormat.Pptx); + //ExEnd:ReplaceFontsExplicitly + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/ReplacingText.java b/Examples/src/main/java/com/aspose/slides/examples/text/ReplacingText.java new file mode 100644 index 00000000..80efd828 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/ReplacingText.java @@ -0,0 +1,40 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class ReplacingText +{ + public static void main(String[] args) + { + //ExStart:ReplacingText + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Instantiate Presentation class that represents PPTX// Instantiate Presentation class that represents PPTX + Presentation pres = new Presentation(dataDir + "ReplacingText.pptx"); + try + { + + // Access first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Iterate through shapes to find the placeholder + for (IShape shp : sld.getShapes()) + if (shp.getPlaceholder() != null) + { + // Change the text of each placeholder + ((IAutoShape) shp).getTextFrame().setText("This is Placeholder"); + } + + // Save the PPTX to Disk + pres.save(dataDir + "output_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:ReplacingText + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/RotatingText.java b/Examples/src/main/java/com/aspose/slides/examples/text/RotatingText.java new file mode 100644 index 00000000..985ab1a6 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/RotatingText.java @@ -0,0 +1,47 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class RotatingText +{ + public static void main(String[] args) + { + //ExStart:RotatingText + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + + // Get the first slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Add an AutoShape of Rectangle type + IAutoShape ashp = slide.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 350, 350); + + // Add TextFrame to the Rectangle + ashp.addTextFrame(" "); + ashp.getFillFormat().setFillType(FillType.NoFill); + + // Accessing the text frame + ITextFrame txtFrame = ashp.getTextFrame(); + txtFrame.getTextFrameFormat().setTextVerticalType(TextVerticalType.Vertical270); + + // Create the Paragraph object for text frame + IParagraph para = txtFrame.getParagraphs().get_Item(0); + + // Create Portion object for paragraph + IPortion portion = para.getPortions().get_Item(0); + portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog."); + portion.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); + + // Save Presentation + presentation.save(dataDir + "RotateText_out.pptx", SaveFormat.Pptx); + //ExEnd:RotatingText + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/RuleBasedFontsReplacement.java b/Examples/src/main/java/com/aspose/slides/examples/text/RuleBasedFontsReplacement.java new file mode 100644 index 00000000..1e1d5829 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/RuleBasedFontsReplacement.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class RuleBasedFontsReplacement +{ + public static void main(String[] args) + { + // The path to the document's directory. + String dataDir = RunExamples.getDataDir_Text(); + + //ExStart:RuleBasedFontsReplacement + // Load presentation + Presentation presentation = new Presentation(dataDir + "Fonts.pptx"); + + // Load source font to be replaced + IFontData sourceFont = new FontData("SomeRareFont"); + + // Load the replacing font + IFontData destFont = new FontData("Arial"); + + // Add font rule for font replacement + IFontSubstRule fontSubstRule = new FontSubstRule(sourceFont, destFont, FontSubstCondition.WhenInaccessible); + + // Add rule to font substitute rules collection + IFontSubstRuleCollection fontSubstRuleCollection = new FontSubstRuleCollection(); + fontSubstRuleCollection.add(fontSubstRule); + + // Add font rule collection to rule list + presentation.getFontsManager().setFontSubstRuleList(fontSubstRuleCollection); + + // Arial font will be used instead of SomeRareFont when inaccessible + IImage img = presentation.getSlides().get_Item(0).getImage(1f, 1f); + + // Save the image to disk in JPEG format + img.save(dataDir + "Thumbnail_out.jpg", ImageFormat.Jpeg); + //ExEnd:RuleBasedFontsReplacement + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/SaveWithDefaultRegularFont.java b/Examples/src/main/java/com/aspose/slides/examples/text/SaveWithDefaultRegularFont.java new file mode 100644 index 00000000..367bba44 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/SaveWithDefaultRegularFont.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.HtmlOptions; +import com.aspose.slides.PdfOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class SaveWithDefaultRegularFont +{ + + public static void main(String[] args) + { + String dataDir = RunExamples.getDataDir_Text(); + String outPath = RunExamples.getOutPath(); + + //ExStart:SaveWithDefaultRegularFont + Presentation pres = new Presentation(dataDir + "DefaultFonts.pptx"); + try + { + HtmlOptions htmlOpts = new HtmlOptions(); + htmlOpts.setDefaultRegularFont("Arial Black"); + pres.save(outPath + "Presentation-out-ArialBlack.html", SaveFormat.Html, htmlOpts); + htmlOpts.setDefaultRegularFont("Lucida Console"); + pres.save(outPath + "Presentation-out-LucidaConsole.html", SaveFormat.Html, htmlOpts); + + PdfOptions pdfOpts = new PdfOptions(); + pdfOpts.setDefaultRegularFont("Arial Black"); + pres.save(outPath + "Presentation-out-ArialBlack.pdf", SaveFormat.Pdf, pdfOpts); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SaveWithDefaultRegularFont + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/SetAnchorOfTextFrame.java b/Examples/src/main/java/com/aspose/slides/examples/text/SetAnchorOfTextFrame.java new file mode 100644 index 00000000..88f4f590 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/SetAnchorOfTextFrame.java @@ -0,0 +1,47 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class SetAnchorOfTextFrame +{ + public static void main(String[] args) + { + //ExStart:SetAnchorOfTextFrame + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + + // Get the first slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Add an AutoShape of Rectangle type + IAutoShape ashp = slide.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 350, 350); + + // Add TextFrame to the Rectangle + ashp.addTextFrame(" "); + ashp.getFillFormat().setFillType(FillType.NoFill); + + // Accessing the text frame + ITextFrame txtFrame = ashp.getTextFrame(); + txtFrame.getTextFrameFormat().setAnchoringType(TextAnchorType.Bottom); + + // Create the Paragraph object for text frame + IParagraph para = txtFrame.getParagraphs().get_Item(0); + + // Create Portion object for paragraph + IPortion portion = para.getPortions().get_Item(0); + portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog."); + portion.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); + + // Save Presentation + presentation.save(dataDir + "AnchorText_out.pptx", SaveFormat.Pptx); + //ExEnd:SetAnchorOfTextFrame + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/SetAutofitOftextframe.java b/Examples/src/main/java/com/aspose/slides/examples/text/SetAutofitOftextframe.java new file mode 100644 index 00000000..068756be --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/SetAutofitOftextframe.java @@ -0,0 +1,47 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class SetAutofitOftextframe +{ + public static void main(String[] args) + { + //ExStart:SetAutofitOftextframe + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create an instance of Presentation class + Presentation presentation = new Presentation(); + + // Access the first slide + ISlide slide = presentation.getSlides().get_Item(0); + + // Add an AutoShape of Rectangle type + IAutoShape ashp = slide.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 350, 350); + + // Add TextFrame to the Rectangle + ashp.addTextFrame(" "); + ashp.getFillFormat().setFillType(FillType.NoFill); + + // Accessing the text frame + ITextFrame txtFrame = ashp.getTextFrame(); + txtFrame.getTextFrameFormat().setAutofitType(TextAutofitType.Shape); + + // Create the Paragraph object for text frame + IParagraph para = txtFrame.getParagraphs().get_Item(0); + + // Create Portion object for paragraph + IPortion portion = para.getPortions().get_Item(0); + portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog."); + portion.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); + + // Save Presentation + presentation.save(dataDir + "formatText_out.pptx", SaveFormat.Pptx); + } + //ExEnd:SetAutofitOftextframe +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/SetCustomBulletsNumber.java b/Examples/src/main/java/com/aspose/slides/examples/text/SetCustomBulletsNumber.java new file mode 100644 index 00000000..79a95a92 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/SetCustomBulletsNumber.java @@ -0,0 +1,63 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetCustomBulletsNumber +{ + public static void main(String[] args) + { + + //ExStart:SetCustomBulletsNumber + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + Presentation presentation = new Presentation(); + try + { + IAutoShape shape = presentation.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 200, 200, 400, 200); + + // Accessing the text frame of created autoshape + ITextFrame textFrame = shape.getTextFrame(); + + // Removing the default exisiting paragraph + textFrame.getParagraphs().removeAt(0); + + // First list + Paragraph paragraph1 = new Paragraph(); + paragraph1.setText("bullet 2"); + paragraph1.getParagraphFormat().setDepth((short) 4); + paragraph1.getParagraphFormat().getBullet().setNumberedBulletStartWith((short) 2); + paragraph1.getParagraphFormat().getBullet().setType(BulletType.Numbered); + textFrame.getParagraphs().add(paragraph1); + + Paragraph paragraph2 = new Paragraph(); + paragraph2.setText("bullet 3"); + paragraph2.getParagraphFormat().setDepth((short) 4); + paragraph2.getParagraphFormat().getBullet().setNumberedBulletStartWith((short) 3); + paragraph2.getParagraphFormat().getBullet().setType(BulletType.Numbered); + textFrame.getParagraphs().add(paragraph2); + + + Paragraph paragraph5 = new Paragraph(); + paragraph5.setText("bullet 7"); + paragraph5.getParagraphFormat().setDepth((short) 4); + paragraph5.getParagraphFormat().getBullet().setNumberedBulletStartWith((short) 7); + paragraph5.getParagraphFormat().getBullet().setType(BulletType.Numbered); + textFrame.getParagraphs().add(paragraph5); + + presentation.save(dataDir + "SetCustomBulletsNumber-slides.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + + + //ExEnd:SetCustomBulletsNumber + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/SetFontFallBack.java b/Examples/src/main/java/com/aspose/slides/examples/text/SetFontFallBack.java new file mode 100644 index 00000000..2f43cbfb --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/SetFontFallBack.java @@ -0,0 +1,31 @@ +package com.aspose.slides.examples.text; + + +import com.aspose.slides.FontFallBackRule; +import com.aspose.slides.IFontFallBackRule; + +public class SetFontFallBack +{ + public static void main(String[] args) + { + + //ExStart:SetFontFallBack + + + long startUnicodeIndex = 0x0B80; + + long endUnicodeIndex = 0x0BFF; + + IFontFallBackRule firstRule = new FontFallBackRule(startUnicodeIndex, endUnicodeIndex, "Vijaya"); + IFontFallBackRule secondRule = new FontFallBackRule(0x3040, 0x309F, "MS Mincho, MS Gothic"); + + //Also the fonts list can be added in several ways: + String[] fontNames = new String[]{"Segoe UI Emoji, Segoe UI Symbol", "Arial"}; + + IFontFallBackRule thirdRule = new FontFallBackRule(0x1F300, 0x1F64F, fontNames); + + //ExEnd:SetFontFallBack + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/SetLocalFontHeightValues.java b/Examples/src/main/java/com/aspose/slides/examples/text/SetLocalFontHeightValues.java new file mode 100644 index 00000000..ada37f34 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/SetLocalFontHeightValues.java @@ -0,0 +1,69 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class SetLocalFontHeightValues +{ + public static void main(String[] args) + { + + + //ExStart:SetLocalFontHeightValues + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + Presentation pres = new Presentation(); + try + { + IAutoShape newShape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 400, 75, false); + newShape.addTextFrame(""); + newShape.getTextFrame().getParagraphs().get_Item(0).getPortions().clear(); + + IPortion portion0 = new Portion("Sample text with first portion"); + IPortion portion1 = new Portion(" and second portion."); + + newShape.getTextFrame().getParagraphs().get_Item(0).getPortions().add(portion0); + newShape.getTextFrame().getParagraphs().get_Item(0).getPortions().add(portion1); + + System.out.println("Effective font height just after creation:"); + System.out.println("Portion #0: " + portion0.getPortionFormat().getEffective().getFontHeight()); + System.out.println("Portion #1: " + portion1.getPortionFormat().getEffective().getFontHeight()); + + pres.getDefaultTextStyle().getLevel(0).getDefaultPortionFormat().setFontHeight(24); + + System.out.println("Effective font height after setting entire presentation default font height:"); + System.out.println("Portion #0: " + portion0.getPortionFormat().getEffective().getFontHeight()); + System.out.println("Portion #1: " + portion1.getPortionFormat().getEffective().getFontHeight()); + + newShape.getTextFrame().getParagraphs().get_Item(0).getParagraphFormat().getDefaultPortionFormat().setFontHeight(40); + + System.out.println("Effective font height after setting paragraph default font height:"); + System.out.println("Portion #0: " + portion0.getPortionFormat().getEffective().getFontHeight()); + System.out.println("Portion #1: " + portion1.getPortionFormat().getEffective().getFontHeight()); + + newShape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().setFontHeight(55); + + System.out.println("Effective font height after setting portion #0 font height:"); + System.out.println("Portion #0: " + portion0.getPortionFormat().getEffective().getFontHeight()); + System.out.println("Portion #1: " + portion1.getPortionFormat().getEffective().getFontHeight()); + + newShape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(1).getPortionFormat().setFontHeight(18); + + System.out.println("Effective font height after setting portion #1 font height:"); + System.out.println("Portion #0: " + portion0.getPortionFormat().getEffective().getFontHeight()); + System.out.println("Portion #1: " + portion1.getPortionFormat().getEffective().getFontHeight()); + + pres.save(dataDir + "SetLocalFontHeightValues.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:SetLocalFontHeightValues + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/SetTextFontProperties.java b/Examples/src/main/java/com/aspose/slides/examples/text/SetTextFontProperties.java new file mode 100644 index 00000000..d09d68e3 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/SetTextFontProperties.java @@ -0,0 +1,67 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class SetTextFontProperties +{ + public static void main(String[] args) + { + //ExStart:SetTextFontProperties + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Instantiate Presentation + Presentation presentation = new Presentation(); + try + { + + // Get first slide + ISlide sld = presentation.getSlides().get_Item(0); + + // Add an AutoShape of Rectangle type + IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 50, 200, 50); + + // Remove any fill style associated with the AutoShape + ashp.getFillFormat().setFillType(FillType.NoFill); + + // Access the TextFrame associated with the AutoShape + ITextFrame tf = ashp.getTextFrame(); + tf.setText("Aspose TextBox"); + + // Access the Portion associated with the TextFrame + IPortion port = tf.getParagraphs().get_Item(0).getPortions().get_Item(0); + + // Set the Font for the Portion + port.getPortionFormat().setLatinFont(new FontData("Times New Roman")); + + // Set Bold property of the Font + port.getPortionFormat().setFontBold(NullableBool.True); + + // Set Italic property of the Font + port.getPortionFormat().setFontItalic(NullableBool.True); + + // Set Underline property of the Font + port.getPortionFormat().setFontUnderline(TextUnderlineType.Single); + + // Set the Height of the Font + port.getPortionFormat().setFontHeight(25); + + // Set the color of the Font + port.getPortionFormat().getFillFormat().setFillType(FillType.Solid); + port.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLUE); + + // Write the PPTX to disk + presentation.save(dataDir + "SetTextFontProperties_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:SetTextFontProperties + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/SetTransparencyOfTextInShadow.java b/Examples/src/main/java/com/aspose/slides/examples/text/SetTransparencyOfTextInShadow.java new file mode 100644 index 00000000..15a7e87b --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/SetTransparencyOfTextInShadow.java @@ -0,0 +1,39 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; + + +public class SetTransparencyOfTextInShadow +{ + public static void main(String[] args) + { + //ExStart:SetTransparencyOfTextInShadow + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + Presentation pres = new Presentation(dataDir + "transparency.pptx"); + try + { + IAutoShape shape = (IAutoShape) pres.getSlides().get_Item(0).getShapes().get_Item(0); + IEffectFormat effects = shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getEffectFormat(); + + IOuterShadow outerShadowEffect = effects.getOuterShadowEffect(); + + Color shadowColor = outerShadowEffect.getShadowColor().getColor(); + System.out.println(String.format("{0} - transparency is: {1}", shadowColor, ((float) (shadowColor.getAlpha() & 0xFF) / (Byte.MIN_VALUE & 0xFF)) * 100)); + + // set transparency to zero percent + //com.aspose.cells.Color.fromArgb(255, shadowColor.Clone()).CloneTo(outerShadowEffect.getShadowColor().getColor()); + outerShadowEffect.getShadowColor().setColor(new java.awt.Color(shadowColor.getRed(), shadowColor.getGreen(), shadowColor.getBlue(), 255)); + pres.save(dataDir + "transparency-2.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SetTransparencyOfTextInShadow + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/SettingPresentationLanguageAndShapeText.java b/Examples/src/main/java/com/aspose/slides/examples/text/SettingPresentationLanguageAndShapeText.java new file mode 100644 index 00000000..0566e44d --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/SettingPresentationLanguageAndShapeText.java @@ -0,0 +1,31 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.IAutoShape; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.ShapeType; +import com.aspose.slides.examples.RunExamples; + + +public class SettingPresentationLanguageAndShapeText +{ + public static void main(String[] args) + { + // ExStart:SettingPresentationLanguageAndShapeText + Presentation pres = new Presentation(); + try + { + IAutoShape shape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 50, 50, 200, 50); + shape.addTextFrame("Text to apply spellcheck language"); + shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().setLanguageId("en-EN"); + + pres.save(RunExamples.getOutPath() + "test1.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + } + // ExEnd:SettingPresentationLanguageAndShapeText +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/SpecifyDefaultTextLanguage.java b/Examples/src/main/java/com/aspose/slides/examples/text/SpecifyDefaultTextLanguage.java new file mode 100644 index 00000000..095d9b0c --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/SpecifyDefaultTextLanguage.java @@ -0,0 +1,29 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; + + +public class SpecifyDefaultTextLanguage +{ + public static void main(String[] args) + { + //ExStart:SpecifyDefaultTextLanguage + LoadOptions loadOptions = new LoadOptions(); + loadOptions.setDefaultTextLanguage("en-US"); + Presentation pres = new Presentation(loadOptions); + try + { + // Add new rectangle shape with text + IAutoShape shp = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 50, 50, 150, 50); + shp.getTextFrame().setText("New Text"); + + // Check the first portion language + System.out.println(shp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getLanguageId()); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:SpecifyDefaultTextLanguage + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/SpecifyFontsUsedWithPresentation.java b/Examples/src/main/java/com/aspose/slides/examples/text/SpecifyFontsUsedWithPresentation.java new file mode 100644 index 00000000..32bfbfe7 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/SpecifyFontsUsedWithPresentation.java @@ -0,0 +1,41 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.IPresentation; +import com.aspose.slides.LoadOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + + +public class SpecifyFontsUsedWithPresentation +{ + public static void main(String[] args) throws IOException + { + // ExStart:SpecifyFontsUsedWithPresentation + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + byte[] memoryFont1 = Files.readAllBytes(Paths.get(dataDir + "customfonts\\CustomFont1.ttf")); + byte[] memoryFont2 = Files.readAllBytes(Paths.get(dataDir + "customfonts\\CustomFont2.ttf")); + + LoadOptions loadOptions = new LoadOptions(); + loadOptions.getDocumentLevelFontSources().setFontFolders(new String[]{"assets\\fonts", "global\\fonts"}); + loadOptions.getDocumentLevelFontSources().setMemoryFonts(new byte[][]{memoryFont1, memoryFont2}); + + IPresentation presentation = new Presentation("MyPresentation.pptx", loadOptions); + try + { + //work with the presentation + //CustomFont1, CustomFont2 as well as fonts from assets\fonts & global\fonts folders and their subfolders are available to the presentation + } + finally + { + if (presentation != null) presentation.dispose(); + } + // ExEnd:SpecifyFontsUsedWithPresentation + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/SplitTextByColumnsExample.java b/Examples/src/main/java/com/aspose/slides/examples/text/SplitTextByColumnsExample.java new file mode 100644 index 00000000..cb455327 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/SplitTextByColumnsExample.java @@ -0,0 +1,30 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +public class SplitTextByColumnsExample +{ + public static void main(String[] args) + { + //Path for source presentation + String presentationName = RunExamples.getDataDir_Text() + "MultiColumnText.pptx"; + + //ExStart:JavaScriptLinkExample + Presentation pres = new Presentation(presentationName); + try { + // Get the first shape on the slide + IAutoShape shape = (IAutoShape) pres.getSlides().get_Item(0).getShapes().get_Item(0); + // Get textFrame + ITextFrame textFrame = shape.getTextFrame(); + // Split the text frame content into columns + String[] columnsText = textFrame.splitTextByColumns(); + // Print each column's text to the console + for (String column : columnsText) + System.out.println(column + '\n'); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:JavaScriptLinkExample + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/TextBoxHyperlink.java b/Examples/src/main/java/com/aspose/slides/examples/text/TextBoxHyperlink.java new file mode 100644 index 00000000..fcb32e90 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/TextBoxHyperlink.java @@ -0,0 +1,49 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class TextBoxHyperlink +{ + public static void main(String[] args) + { + //ExStart:TextBoxHyperlink + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate a Presentation class that represents a PPTX + Presentation pptxPresentation = new Presentation(); + + // Get first slide + ISlide slide = pptxPresentation.getSlides().get_Item(0); + + // Add an AutoShape of Rectangle Type + IShape pptxShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 150, 150, 150, 50); + + // Cast the shape to AutoShape + IAutoShape pptxAutoShape = (IAutoShape) pptxShape; + + // Access ITextFrame associated with the AutoShape + pptxAutoShape.addTextFrame(""); + + ITextFrame ITextFrame = pptxAutoShape.getTextFrame(); + + // Add some text to the frame + ITextFrame.getParagraphs().get_Item(0).getPortions().get_Item(0).setText("Aspose.Slides"); + + // Set Hyperlink for the portion text + IHyperlinkManager HypMan = ITextFrame.getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getHyperlinkManager(); + HypMan.setExternalHyperlinkClick("http://www.aspose.com"); + // Save the PPTX Presentation + pptxPresentation.save(dataDir + "hLinkPPTX_out.pptx", SaveFormat.Pptx); + //ExEnd:TextBoxHyperlink + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/TextBoxOnSlideProgram.java b/Examples/src/main/java/com/aspose/slides/examples/text/TextBoxOnSlideProgram.java new file mode 100644 index 00000000..c623a818 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/TextBoxOnSlideProgram.java @@ -0,0 +1,57 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.io.File; + + +public class TextBoxOnSlideProgram +{ + public static void main(String[] args) + { + //ExStart:TextBoxOnSlideProgram + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + // Create directory if it is not already present. + boolean IsExists = new File(dataDir).exists(); + if (!IsExists) + new File(dataDir).mkdirs(); + + // Instantiate PresentationEx + Presentation pres = new Presentation(); + try + { + + // Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add an AutoShape of Rectangle type + IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 150, 50); + + // Add TextFrame to the Rectangle + ashp.addTextFrame(" "); + + // Accessing the text frame + ITextFrame txtFrame = ashp.getTextFrame(); + + // Create the Paragraph object for text frame + IParagraph para = txtFrame.getParagraphs().get_Item(0); + + // Create Portion object for paragraph + IPortion portion = para.getPortions().get_Item(0); + + // Set Text + portion.setText("Aspose TextBox"); + + // Save the presentation to disk + pres.save(dataDir + "TextBox_out.pptx", SaveFormat.Pptx); + } + finally + { + if (pres != null) pres.dispose(); + } + //ExEnd:TextBoxOnSlideProgram + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/UseCustomFonts.java b/Examples/src/main/java/com/aspose/slides/examples/text/UseCustomFonts.java new file mode 100644 index 00000000..8f1131e5 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/UseCustomFonts.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.FontsLoader; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class UseCustomFonts +{ + public static void main(String[] args) + { + //ExStart:UseCustomFonts + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_Text(); + + String[] loadFonts = new String[]{dataDir + "CustomFonts.ttf"}; + + // Load the custom font directory fonts + FontsLoader.loadExternalFonts(loadFonts); + + // Do Some work and perform presentation/slides rendering + Presentation presentation = new Presentation(dataDir + "DefaultFonts.pptx"); + try + { + presentation.save(dataDir + "NewFonts_out.pptx", SaveFormat.Pptx); + } + finally + { + if (presentation != null) presentation.dispose(); + } + + // Clear Font Cachce + FontsLoader.clearCache(); + //ExEnd:UseCustomFonts + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/text/WordArt.java b/Examples/src/main/java/com/aspose/slides/examples/text/WordArt.java new file mode 100644 index 00000000..b8f80763 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/text/WordArt.java @@ -0,0 +1,131 @@ +package com.aspose.slides.examples.text; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + +import java.awt.*; +import java.io.IOException; + +public class WordArt { + + public static void main(String[] args) throws IOException + { + //ExStart:WordArt + String resultPath = RunExamples.getOutPath() + "WordArt_out.pptx"; + + Presentation pres = new Presentation(); + try { + // Create shape and text frame + IAutoShape shape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 314, 122, 400, 215.433f); + + ITextFrame textFrame = shape.getTextFrame(); + + Portion portion = (Portion)textFrame.getParagraphs().get_Item(0).getPortions().get_Item(0); + portion.setText("Aspose.Slides"); + FontData fontData = new FontData("Arial Black"); + portion.getPortionFormat().setLatinFont(fontData); + portion.getPortionFormat().setFontHeight(36); + + // Set format of the text + portion.getPortionFormat().getFillFormat().setFillType(FillType.Pattern); + portion.getPortionFormat().getFillFormat().getPatternFormat().getForeColor().setColor(Color.getColor("16762880")); + portion.getPortionFormat().getFillFormat().getPatternFormat().getBackColor().setColor(Color.WHITE); + portion.getPortionFormat().getFillFormat().getPatternFormat().setPatternStyle(PatternStyle.SmallGrid); + + portion.getPortionFormat().getLineFormat().getFillFormat().setFillType(FillType.Solid); + portion.getPortionFormat().getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); + + // Add a shadow effect for the text + portion.getPortionFormat().getEffectFormat().enableOuterShadowEffect(); + portion.getPortionFormat().getEffectFormat().getOuterShadowEffect().getShadowColor().setColor(Color.BLACK); + portion.getPortionFormat().getEffectFormat().getOuterShadowEffect().setScaleHorizontal(100); + portion.getPortionFormat().getEffectFormat().getOuterShadowEffect().setScaleVertical(65); + portion.getPortionFormat().getEffectFormat().getOuterShadowEffect().setBlurRadius(4.73); + portion.getPortionFormat().getEffectFormat().getOuterShadowEffect().setDirection(230); + portion.getPortionFormat().getEffectFormat().getOuterShadowEffect().setDistance(2); + portion.getPortionFormat().getEffectFormat().getOuterShadowEffect().setSkewHorizontal(30); + portion.getPortionFormat().getEffectFormat().getOuterShadowEffect().setSkewVertical(0); + portion.getPortionFormat().getEffectFormat().getOuterShadowEffect().getShadowColor().getColorTransform().add(ColorTransformOperation.SetAlpha, 0.32f); + + // Add reflection + portion.getPortionFormat().getEffectFormat().enableReflectionEffect(); + portion.getPortionFormat().getEffectFormat().getReflectionEffect().setBlurRadius(0.5); + portion.getPortionFormat().getEffectFormat().getReflectionEffect().setDistance(4.72); + portion.getPortionFormat().getEffectFormat().getReflectionEffect().setStartPosAlpha(0f); + portion.getPortionFormat().getEffectFormat().getReflectionEffect().setEndPosAlpha(60f); + portion.getPortionFormat().getEffectFormat().getReflectionEffect().setDirection(90); + portion.getPortionFormat().getEffectFormat().getReflectionEffect().setScaleHorizontal(100); + portion.getPortionFormat().getEffectFormat().getReflectionEffect().setScaleVertical(-100); + portion.getPortionFormat().getEffectFormat().getReflectionEffect().setStartReflectionOpacity(60f); + portion.getPortionFormat().getEffectFormat().getReflectionEffect().setEndReflectionOpacity(0.9f); + portion.getPortionFormat().getEffectFormat().getReflectionEffect().setRectangleAlign(RectangleAlignment.BottomLeft); + + // Add glow effect + portion.getPortionFormat().getEffectFormat().enableGlowEffect(); + portion.getPortionFormat().getEffectFormat().getGlowEffect().getColor().setR((byte)255); + portion.getPortionFormat().getEffectFormat().getGlowEffect().getColor().getColorTransform().add(ColorTransformOperation.SetAlpha, 0.54f); + portion.getPortionFormat().getEffectFormat().getGlowEffect().setRadius(7); + + // Add transformation + textFrame.getTextFrameFormat().setTransform(TextShapeType.ArchUpPour); + + // Add 3D effects to the shape + shape.getThreeDFormat().getBevelBottom().setBevelType(BevelPresetType.Circle); + shape.getThreeDFormat().getBevelBottom().setHeight(10.5); + shape.getThreeDFormat().getBevelBottom().setWidth(10.5); + + shape.getThreeDFormat().getBevelTop().setBevelType(BevelPresetType.Circle); + shape.getThreeDFormat().getBevelTop().setHeight(12.5); + shape.getThreeDFormat().getBevelTop().setWidth(11); + + shape.getThreeDFormat().getExtrusionColor().setColor(Color.getColor("16762880")); + shape.getThreeDFormat().setExtrusionHeight(6); + + shape.getThreeDFormat().getContourColor().setColor(Color.getColor("12058624")); + shape.getThreeDFormat().setContourWidth(1.5); + + shape.getThreeDFormat().setDepth(3); + + shape.getThreeDFormat().setMaterial(MaterialPresetType.Plastic); + + shape.getThreeDFormat().getLightRig().setDirection(LightingDirection.Top); + shape.getThreeDFormat().getLightRig().setLightType(LightRigPresetType.Balanced); + shape.getThreeDFormat().getLightRig().setRotation(0, 0, 40); + + shape.getThreeDFormat().getCamera().setCameraType(CameraPresetType.PerspectiveContrastingRightFacing); + + // Add 3D effects to the text + textFrame = shape.getTextFrame(); + + textFrame.getTextFrameFormat().getThreeDFormat().getBevelBottom().setBevelType(BevelPresetType.Circle); + textFrame.getTextFrameFormat().getThreeDFormat().getBevelBottom().setHeight(3.5); + textFrame.getTextFrameFormat().getThreeDFormat().getBevelBottom().setWidth(3.5); + + textFrame.getTextFrameFormat().getThreeDFormat().getBevelTop().setBevelType(BevelPresetType.Circle); + textFrame.getTextFrameFormat().getThreeDFormat().getBevelTop().setHeight(12.5); + textFrame.getTextFrameFormat().getThreeDFormat().getBevelTop().setWidth(11); + + textFrame.getTextFrameFormat().getThreeDFormat().getExtrusionColor().setColor(Color.ORANGE); + textFrame.getTextFrameFormat().getThreeDFormat().setExtrusionHeight(6); + + textFrame.getTextFrameFormat().getThreeDFormat().getContourColor().setColor(Color.getColor("12058624")); + textFrame.getTextFrameFormat().getThreeDFormat().setContourWidth(1.5); + + textFrame.getTextFrameFormat().getThreeDFormat().setDepth(3); + + textFrame.getTextFrameFormat().getThreeDFormat().setMaterial(MaterialPresetType.Plastic); + + textFrame.getTextFrameFormat().getThreeDFormat().getLightRig().setDirection(LightingDirection.Top); + textFrame.getTextFrameFormat().getThreeDFormat().getLightRig().setLightType(LightRigPresetType.Balanced); + textFrame.getTextFrameFormat().getThreeDFormat().getLightRig().setRotation(0, 0, 40); + + textFrame.getTextFrameFormat().getThreeDFormat().getCamera().setCameraType(CameraPresetType.PerspectiveContrastingRightFacing); + + pres.save(resultPath, SaveFormat.Pptx); + } finally { + if (pres != null) pres.dispose(); + } + //ExEnd:WordArt + } + +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/vba/AddVBAMacros.java b/Examples/src/main/java/com/aspose/slides/examples/vba/AddVBAMacros.java new file mode 100644 index 00000000..361ee82e --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/vba/AddVBAMacros.java @@ -0,0 +1,50 @@ +package com.aspose.slides.examples.vba; + +import com.aspose.slides.*; +import com.aspose.slides.examples.RunExamples; + + +public class AddVBAMacros +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_VBA(); + + //ExStart:AddVBAMacros + // Instantiate Presentation + Presentation presentation = new Presentation(); + try + { + // Create new VBA Project + presentation.setVbaProject(new VbaProject()); + + // Add empty module to the VBA project + IVbaModule module = presentation.getVbaProject().getModules().addEmptyModule("Module"); + + // Set module source code + module.setSourceCode("Sub Test(oShape As Shape) MsgBox \"Test\" End Sub"); + + // Create reference to + VbaReferenceOleTypeLib stdoleReference = + new VbaReferenceOleTypeLib("stdole", "*\\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\\Windows\\system32\\stdole2.tlb#OLE Automation"); + + // Create reference to Office + VbaReferenceOleTypeLib officeReference = + new VbaReferenceOleTypeLib("Office", "*\\G{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}#2.0#0#C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE14\\MSO.DLL#Microsoft Office 14.0 Object Library"); + + // Add references to the VBA project + presentation.getVbaProject().getReferences().add(stdoleReference); + presentation.getVbaProject().getReferences().add(officeReference); + + + // Save Presentation + presentation.save(dataDir + "AddVBAMacros_out.pptm", SaveFormat.Pptm); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:AddVBAMacros + } +} diff --git a/Examples/src/main/java/com/aspose/slides/examples/vba/ExtractingVBAMacros.java b/Examples/src/main/java/com/aspose/slides/examples/vba/ExtractingVBAMacros.java new file mode 100644 index 00000000..b73caf65 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/vba/ExtractingVBAMacros.java @@ -0,0 +1,38 @@ +package com.aspose.slides.examples.vba; + +import com.aspose.slides.IVbaModule; +import com.aspose.slides.Presentation; +import com.aspose.slides.examples.RunExamples; + + +public class ExtractingVBAMacros +{ + public static void main(String[] args) + { + //ExStart:ExtractingVBAMacros + + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_VBA(); + + Presentation pres = new Presentation(dataDir + "VBA.pptm"); + try + { + if (pres.getVbaProject() != null) // check if Presentation contains VBA Project + { + for (IVbaModule module : pres.getVbaProject().getModules()) + { + System.out.println(module.getName()); + System.out.println(module.getSourceCode()); + } + } + } + finally + { + if (pres != null) pres.dispose(); + } + + //ExEnd:ExtractingVBAMacros + + } +} + diff --git a/Examples/src/main/java/com/aspose/slides/examples/vba/RemoveVBAMacros.java b/Examples/src/main/java/com/aspose/slides/examples/vba/RemoveVBAMacros.java new file mode 100644 index 00000000..ab365f40 --- /dev/null +++ b/Examples/src/main/java/com/aspose/slides/examples/vba/RemoveVBAMacros.java @@ -0,0 +1,32 @@ +package com.aspose.slides.examples.vba; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.examples.RunExamples; + + +public class RemoveVBAMacros +{ + public static void main(String[] args) + { + // The path to the documents directory. + String dataDir = RunExamples.getDataDir_VBA(); + + //ExStart:RemoveVBAMacros + // Instantiate Presentation + Presentation presentation = new Presentation(dataDir + "VBA.pptm"); + try + { + // Access the Vba module and remove + presentation.getVbaProject().getModules().remove(presentation.getVbaProject().getModules().get_Item(0)); + + // Save Presentation + presentation.save(dataDir + "RemovedVBAMacros_out.pptm", SaveFormat.Pptm); + } + finally + { + if (presentation != null) presentation.dispose(); + } + //ExEnd:RemoveVBAMacros + } +} diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Charts/ChartFromScratch/scatteredchart/AsposeScatterChart.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Charts/ChartFromScratch/scatteredchart/AsposeScatterChart.pptx deleted file mode 100644 index 3a49ff47..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Charts/ChartFromScratch/scatteredchart/AsposeScatterChart.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Charts/chartentities/FormattedChart.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Charts/chartentities/FormattedChart.pptx deleted file mode 100644 index ac985ff9..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Charts/chartentities/FormattedChart.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Charts/charttrendlines/ChartTrendLines.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Charts/charttrendlines/ChartTrendLines.pptx deleted file mode 100644 index c5c2faab..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Charts/charttrendlines/ChartTrendLines.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Charts/existingchart/AsposeChartModified.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Charts/existingchart/AsposeChartModified.pptx deleted file mode 100644 index 467cee69..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Charts/existingchart/AsposeChartModified.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Charts/numberformat/PresetNumberFormat.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Charts/numberformat/PresetNumberFormat.pptx deleted file mode 100644 index 1505f081..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Charts/numberformat/PresetNumberFormat.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/accessmodifyproperties/DocProps.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/accessmodifyproperties/DocProps.pptx deleted file mode 100644 index 6ff66597..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/accessmodifyproperties/DocProps.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/modifybuiltinproperties/CustomDemoModified.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/modifybuiltinproperties/CustomDemoModified.pptx deleted file mode 100644 index e5e5bfa3..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/modifybuiltinproperties/CustomDemoModified.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/modifybuiltinproperties/DocProps.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/modifybuiltinproperties/DocProps.pptx deleted file mode 100644 index 984451d3..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ManageProperties/modifybuiltinproperties/DocProps.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/PresentationToTIFF/customsize/demo.tiff b/Examples/src/main/resources/com/aspose/slides/examples/Presentation/PresentationToTIFF/customsize/demo.tiff deleted file mode 100644 index 6d6cee5d..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/PresentationToTIFF/customsize/demo.tiff and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/removewriteprotection/newDemo.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/removewriteprotection/newDemo.pptx deleted file mode 100644 index 595dded9..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/removewriteprotection/newDemo.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/saveasreadonly/demoWriteProtected.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/saveasreadonly/demoWriteProtected.pptx deleted file mode 100644 index f59fba7a..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/saveasreadonly/demoWriteProtected.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/saveproperties/Aspose.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/saveproperties/Aspose.pptx deleted file mode 100644 index d253bd4d..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/saveproperties/Aspose.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/saveproperties/demoPassDocument.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/saveproperties/demoPassDocument.pptx deleted file mode 100644 index df2384e4..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/saveproperties/demoPassDocument.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/savetofile/Aspose.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/savetofile/Aspose.pptx deleted file mode 100644 index cda4a6f2..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/SavePresentation/savetofile/Aspose.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/converttopdf/Aspose.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Presentation/converttopdf/Aspose.pptx deleted file mode 100644 index b4217968..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/converttopdf/Aspose.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/converttopdf/demoDefault.pdf b/Examples/src/main/resources/com/aspose/slides/examples/Presentation/converttopdf/demoDefault.pdf deleted file mode 100644 index 6ca469da..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/converttopdf/demoDefault.pdf and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ppttopptx/Aspose.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ppttopptx/Aspose.pptx deleted file mode 100644 index 6a557a2b..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ppttopptx/Aspose.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ppttopptx/Presentation1.ppt b/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ppttopptx/Presentation1.ppt deleted file mode 100644 index 20aeebf1..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Presentation/ppttopptx/Presentation1.ppt and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddEllipse/formattedellipse/EllipseShp1.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddEllipse/formattedellipse/EllipseShp1.pptx deleted file mode 100644 index 429d8e07..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddEllipse/formattedellipse/EllipseShp1.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddEllipse/simpleellipse/EllipseShp1.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddEllipse/simpleellipse/EllipseShp1.pptx deleted file mode 100644 index ccf7de15..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddEllipse/simpleellipse/EllipseShp1.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddLineShape/addarrowshapedline/LineShape2.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddLineShape/addarrowshapedline/LineShape2.pptx deleted file mode 100644 index 0fc25566..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddLineShape/addarrowshapedline/LineShape2.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddPictureFrame/addsimplepictureframes/RectPicFrame.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddPictureFrame/addsimplepictureframes/RectPicFrame.pptx deleted file mode 100644 index 16d40881..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/AddPictureFrame/addsimplepictureframes/RectPicFrame.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/FormatLines/formatjoinstyles/RectShpLnJoin.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/FormatLines/formatjoinstyles/RectShpLnJoin.pptx deleted file mode 100644 index 5e945b46..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/FormatLines/formatjoinstyles/RectShpLnJoin.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/FormatLines/formatlines/RectShpLn.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/FormatLines/formatlines/RectShpLn.pptx deleted file mode 100644 index 7ee8d472..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/FormatLines/formatlines/RectShpLn.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/OLEObjectFrames/addoleobjectframe/OleEmbed.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/OLEObjectFrames/addoleobjectframe/OleEmbed.pptx deleted file mode 100644 index c40a2ad2..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/OLEObjectFrames/addoleobjectframe/OleEmbed.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/OLEObjectFrames/addoleobjectframe/sample.xlsx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/OLEObjectFrames/addoleobjectframe/sample.xlsx deleted file mode 100644 index b5450773..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/OLEObjectFrames/addoleobjectframe/sample.xlsx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/RectangleShape/formattedrectangle/RecShp2.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/RectangleShape/formattedrectangle/RecShp2.pptx deleted file mode 100644 index 2e74216e..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/RectangleShape/formattedrectangle/RecShp2.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/RectangleShape/simplerectangle/RecShp1.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/RectangleShape/simplerectangle/RecShp1.pptx deleted file mode 100644 index 91a80c2a..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/RectangleShape/simplerectangle/RecShp1.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/connectorlineangle/LineExample.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/connectorlineangle/LineExample.pptx deleted file mode 100644 index 57a7587f..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/connectorlineangle/LineExample.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/embeddedvideoframe/Wildlife.mp4 b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/embeddedvideoframe/Wildlife.mp4 deleted file mode 100644 index aa450296..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/embeddedvideoframe/Wildlife.mp4 and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/fillshapesgradient/EllipseShpGrad.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/fillshapesgradient/EllipseShpGrad.pptx deleted file mode 100644 index 23ea516b..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/fillshapesgradient/EllipseShpGrad.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/fillshapespattern/RectShpPatt.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/fillshapespattern/RectShpPatt.pptx deleted file mode 100644 index 4362566f..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/fillshapespattern/RectShpPatt.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/fillshapespicture/RectShpPic.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/fillshapespicture/RectShpPic.pptx deleted file mode 100644 index 95dddd3f..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/fillshapespicture/RectShpPic.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/rotateshapes/RectShpRot.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Shapes/rotateshapes/RectShpRot.pptx deleted file mode 100644 index 6059545c..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Shapes/rotateshapes/RectShpRot.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/CloneSlides/anotherpresentationwithmaster/demo.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Slides/CloneSlides/anotherpresentationwithmaster/demo.pptx deleted file mode 100644 index 2a7a2f76..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Slides/CloneSlides/anotherpresentationwithmaster/demo.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/CloneSlides/anotherpresentationwithmaster/helloworld_dest3.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Slides/CloneSlides/anotherpresentationwithmaster/helloworld_dest3.pptx deleted file mode 100644 index 9a91febf..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Slides/CloneSlides/anotherpresentationwithmaster/helloworld_dest3.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/CreateSlidesThumbnailImage/generatethumbnailfromslidewithuserdefineddimensions/ContentBG_tnail.jpg b/Examples/src/main/resources/com/aspose/slides/examples/Slides/CreateSlidesThumbnailImage/generatethumbnailfromslidewithuserdefineddimensions/ContentBG_tnail.jpg deleted file mode 100644 index c808276c..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Slides/CreateSlidesThumbnailImage/generatethumbnailfromslidewithuserdefineddimensions/ContentBG_tnail.jpg and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/RemoveSlides/usingslideindex/demo.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Slides/RemoveSlides/usingslideindex/demo.pptx deleted file mode 100644 index 2a7a2f76..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Slides/RemoveSlides/usingslideindex/demo.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/RemoveSlides/usingslideindex/modified.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Slides/RemoveSlides/usingslideindex/modified.pptx deleted file mode 100644 index 2a562809..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Slides/RemoveSlides/usingslideindex/modified.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/RemoveSlides/usingslidereference/demo.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Slides/RemoveSlides/usingslidereference/demo.pptx deleted file mode 100644 index 2a7a2f76..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Slides/RemoveSlides/usingslidereference/demo.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/RemoveSlides/usingslidereference/modified.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Slides/RemoveSlides/usingslidereference/modified.pptx deleted file mode 100644 index 6a119bf5..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Slides/RemoveSlides/usingslidereference/modified.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/accessslides/demo.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Slides/accessslides/demo.pptx deleted file mode 100644 index 2a7a2f76..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Slides/accessslides/demo.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/addslides/EmptySlide.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Slides/addslides/EmptySlide.pptx deleted file mode 100644 index 5e92263d..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Slides/addslides/EmptySlide.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/createslidessvgimage/SvgImage0.svg b/Examples/src/main/resources/com/aspose/slides/examples/Slides/createslidessvgimage/SvgImage0.svg deleted file mode 100644 index e9b332a7..00000000 --- a/Examples/src/main/resources/com/aspose/slides/examples/Slides/createslidessvgimage/SvgImage0.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - Aspose.Slides for Java - - - - Test File - - - - -Evaluation only. -Created with Aspose.Slides for Java 14.4.0.0. -Copyright 2004-2014 Aspose Pty Ltd. - - - \ No newline at end of file diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Slides/createslidessvgimage/demo.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Slides/createslidessvgimage/demo.pptx deleted file mode 100644 index 2a7a2f76..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Slides/createslidessvgimage/demo.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/accesschildnodes/SimpleSmartArt.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/accesschildnodes/SimpleSmartArt.pptx deleted file mode 100644 index 9db7f799..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/accesschildnodes/SimpleSmartArt.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/accesssmartart/SimpleSmartArt.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/accesssmartart/SimpleSmartArt.pptx deleted file mode 100644 index 9db7f799..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AccessSmartArtNodes/accesssmartart/SimpleSmartArt.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddAccessSmartArt/accesssmartartshape/SimpleSmartArt.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddAccessSmartArt/accesssmartartshape/SimpleSmartArt.pptx deleted file mode 100644 index 366b2383..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddAccessSmartArt/accesssmartartshape/SimpleSmartArt.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddAccessSmartArt/createsmartartshape/SimpleSmartArt.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddAccessSmartArt/createsmartartshape/SimpleSmartArt.pptx deleted file mode 100644 index 366b2383..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddAccessSmartArt/createsmartartshape/SimpleSmartArt.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/addnodes/AddSmartArtNode.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/addnodes/AddSmartArtNode.pptx deleted file mode 100644 index 9db7f799..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/addnodes/AddSmartArtNode.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/addnodes/SimpleSmartArt.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/addnodes/SimpleSmartArt.pptx deleted file mode 100644 index a955e8d9..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/addnodes/SimpleSmartArt.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/nodeatspecificposition/AddSmartArtNodeByPosition.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/nodeatspecificposition/AddSmartArtNodeByPosition.pptx deleted file mode 100644 index a4e80a19..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/nodeatspecificposition/AddSmartArtNodeByPosition.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/removenode/AddSmartArtNode.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/removenode/AddSmartArtNode.pptx deleted file mode 100644 index 9db7f799..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/removenode/AddSmartArtNode.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/removenode/RemoveSmartArtNode.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/removenode/RemoveSmartArtNode.pptx deleted file mode 100644 index b9d0165c..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/removenode/RemoveSmartArtNode.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/removenodespecificposition/AddSmartArtNode.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/removenodespecificposition/AddSmartArtNode.pptx deleted file mode 100644 index 9db7f799..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/removenodespecificposition/AddSmartArtNode.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/removenodespecificposition/RemoveSmartArtNodeByPosition.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/removenodespecificposition/RemoveSmartArtNodeByPosition.pptx deleted file mode 100644 index 6817326b..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/AddRemoveNodes/removenodespecificposition/RemoveSmartArtNodeByPosition.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/CheckAssistantNodes/assistantnode/AddSmartArtNode.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/CheckAssistantNodes/assistantnode/AddSmartArtNode.pptx deleted file mode 100644 index 9db7f799..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/CheckAssistantNodes/assistantnode/AddSmartArtNode.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/CheckAssistantNodes/assistantnode/ChangeAssitantNode.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/CheckAssistantNodes/assistantnode/ChangeAssitantNode.pptx deleted file mode 100644 index d0cd8e42..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/CheckAssistantNodes/assistantnode/ChangeAssitantNode.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/accesssmartart/SimpleSmartArt.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/accesssmartart/SimpleSmartArt.pptx deleted file mode 100644 index a955e8d9..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/accesssmartart/SimpleSmartArt.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/changesmartart/ChangeSmartArtStyle.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/changesmartart/ChangeSmartArtStyle.pptx deleted file mode 100644 index 048bd457..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/changesmartart/ChangeSmartArtStyle.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/changesmartart/SimpleSmartArt.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/changesmartart/SimpleSmartArt.pptx deleted file mode 100644 index a955e8d9..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/changesmartart/SimpleSmartArt.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/smartartcolorstyle/ChangeSmartArtColorStyle.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/smartartcolorstyle/ChangeSmartArtColorStyle.pptx deleted file mode 100644 index cbc3e7c9..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/smartartcolorstyle/ChangeSmartArtColorStyle.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/smartartcolorstyle/SimpleSmartArt.pptx b/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/smartartcolorstyle/SimpleSmartArt.pptx deleted file mode 100644 index a955e8d9..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/SmartArt/ManageSmartArtStyle/smartartcolorstyle/SimpleSmartArt.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Tables/TableFromScratch/cellsborder/table_no_border.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Tables/TableFromScratch/cellsborder/table_no_border.pptx deleted file mode 100644 index 4f6f15cf..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Tables/TableFromScratch/cellsborder/table_no_border.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Tables/TableFromScratch/fromscratch/table.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Tables/TableFromScratch/fromscratch/table.pptx deleted file mode 100644 index e6bf88dc..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Tables/TableFromScratch/fromscratch/table.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Tables/existingtable/demotable.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Tables/existingtable/demotable.pptx deleted file mode 100644 index faefa943..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Tables/existingtable/demotable.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Tables/existingtable/table1.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Tables/existingtable/table1.pptx deleted file mode 100644 index 10b35e31..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Tables/existingtable/table1.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Tables/removerowcolumn/TestTable.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Tables/removerowcolumn/TestTable.pptx deleted file mode 100644 index 52399277..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Tables/removerowcolumn/TestTable.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/exportparagraphtext/first paragraph_Java.html b/Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/exportparagraphtext/first paragraph_Java.html deleted file mode 100644 index 000e7e1a..00000000 --- a/Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/exportparagraphtext/first paragraph_Java.html +++ /dev/null @@ -1,5 +0,0 @@ -

Aspose -Sample

\ No newline at end of file diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/importhtmltext/output.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/importhtmltext/output.pptx deleted file mode 100644 index b5d541c9..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/importhtmltext/output.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/input.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/input.pptx deleted file mode 100644 index 6bb9a12b..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/input.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/output.png b/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/output.png deleted file mode 100644 index 40d4df7f..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/output.png and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/output.xps b/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/output.xps deleted file mode 100644 index 3955781a..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/output.xps and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/fontfamily/pptxFont.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/fontfamily/pptxFont.pptx deleted file mode 100644 index 4c0da3af..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/fontfamily/pptxFont.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/fontproperties/WelcomeFont.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/fontproperties/WelcomeFont.pptx deleted file mode 100644 index c9a682f2..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/fontproperties/WelcomeFont.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/fontproperties/welcome.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/fontproperties/welcome.pptx deleted file mode 100644 index 73ab0103..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/fontproperties/welcome.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/multipleparagraphs/multiParaPort.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/multipleparagraphs/multiParaPort.pptx deleted file mode 100644 index 4f12d5ea..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/multipleparagraphs/multiParaPort.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphbullets/Bullet.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphbullets/Bullet.pptx deleted file mode 100644 index d76a3f0e..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphbullets/Bullet.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphindent/InOutDent.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphindent/InOutDent.pptx deleted file mode 100644 index 0ba2a033..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphindent/InOutDent.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphsalignment/Centeralign.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphsalignment/Centeralign.pptx deleted file mode 100644 index e9b7924a..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphsalignment/Centeralign.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphsalignment/leftalign.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphsalignment/leftalign.pptx deleted file mode 100644 index fcaebff6..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphsalignment/leftalign.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/replacingtext/welcome.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/replacingtext/welcome.pptx deleted file mode 100644 index 73ab0103..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/replacingtext/welcome.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/replacingtext/welcome_PH.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/replacingtext/welcome_PH.pptx deleted file mode 100644 index 8d1212cc..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/replacingtext/welcome_PH.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/shadoweffects/pres.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/shadoweffects/pres.pptx deleted file mode 100644 index 16d2800c..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/shadoweffects/pres.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/textboxhyperlink/hLinkPPTX.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/textboxhyperlink/hLinkPPTX.pptx deleted file mode 100644 index 469b31d0..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/textboxhyperlink/hLinkPPTX.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/textboxonslide/Textbox.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/textboxonslide/Textbox.pptx deleted file mode 100644 index dd5ac4b0..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/textboxonslide/Textbox.pptx and /dev/null differ diff --git a/Plugins/Aspose-Slides-Java-for-Jython/README.md b/Plugins/Aspose-Slides-Java-for-Jython/README.md index 2037b011..a16581a1 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/README.md +++ b/Plugins/Aspose-Slides-Java-for-Jython/README.md @@ -4,20 +4,11 @@ Aspose.Slides Java for Jython is a project that demonstrates / provides the Aspo ## Download -* To download Aspose.Slides for Java API to be used with these examples, Please navigate to [Aspose.Slides for Java](http://www.aspose.com/community/files/72/java-components/aspose.slides-for-java/) +* To download Aspose.Slides for Java API to be used with these examples, Please navigate to [Aspose.Slides for Java](http://maven.aspose.com/repository/simple/ext-release-local/com/aspose/aspose-slides/) * Place downloaded jar file into "lib" directory. * Replace "your-lib" with the jar filename. ## Documentation -For most complete documentation of the project, check [Aspose.Slides Java For Jython confluence wiki](http://www.aspose.com/docs/display/slidesjava/Aspose.Slides+Java+for+Jython). +For most complete documentation of the project, check [Aspose.Slides Java For Jython confluence wiki](https://docs.aspose.com/display/slidesjava/Aspose.Slides+Java+for+Jython). -## Download Latest Versions? - -* [Latest Releases on Codeplex](http://asposeslidesjavajython.codeplex.com/releasesce) - -## Clone Plugin SourceCodes? - -This project is also hosted and maintained at CodePlex. To clone navigate to: - -* [Aspose.Slides Java for Jython on CodePlex - click here](https://asposeslidesjavajython.codeplex.com/SourceControl/latest) diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/IntroductionToPresentation/HelloWorld.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/IntroductionToPresentation/HelloWorld.py index f2614d59..39bb07eb 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/IntroductionToPresentation/HelloWorld.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/IntroductionToPresentation/HelloWorld.py @@ -1,46 +1,46 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import SaveFormat -from java.awt import Color - -class HelloWorld: - - def __init__(self): - - dataDir = Settings.dataDir + 'IntroductionToPresentation/HelloWorld' - - # Instantiate Presentation - pres = Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Add an AutoShape of Rectangle type - shape_type = ShapeType - ashp = slide.getShapes().addAutoShape(shape_type.Rectangle, 150, 75, 150, 50) - - # Add ITextFrame to the Rectangle - ashp.addTextFrame("Hello World") - - # Change the text color to Black (which is White by default) - fill_type = FillType - color = Color - ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().setFillType(fill_type.Solid) - ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) - - # Change the line color of the rectangle to White - ashp.getShapeStyle().getLineColor().setColor(color.WHITE) - - # Remove any fill formatting in the shape - ashp.getFillFormat().setFillType (fill_type.NoFill) - - # Save the presentation to disk - save_format = SaveFormat - pres.save(dataDir + "HelloWorld.pptx", save_format.Pptx) - - print "Document has been saved, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import SaveFormat +from java.awt import Color + +class HelloWorld: + + def __init__(self): + + dataDir = Settings.dataDir + 'IntroductionToPresentation/HelloWorld' + + # Instantiate Presentation + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shape_type = ShapeType + ashp = slide.getShapes().addAutoShape(shape_type.Rectangle, 150, 75, 150, 50) + + # Add ITextFrame to the Rectangle + ashp.addTextFrame("Hello World") + + # Change the text color to Black (which is White by default) + fill_type = FillType + color = Color + ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().setFillType(fill_type.Solid) + ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Change the line color of the rectangle to White + ashp.getShapeStyle().getLineColor().setColor(color.WHITE) + + # Remove any fill formatting in the shape + ashp.getFillFormat().setFillType (fill_type.NoFill) + + # Save the presentation to disk + save_format = SaveFormat + pres.save(dataDir + "HelloWorld.pptx", save_format.Pptx) + + print "Document has been saved, please check the output file." + +if __name__ == '__main__': HelloWorld() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithActiveXControls/AddActiveX.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithActiveXControls/AddActiveX.py index bedda7e7..112dd2cf 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithActiveXControls/AddActiveX.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithActiveXControls/AddActiveX.py @@ -1,28 +1,28 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ControlType -from com.aspose.slides import SaveFormat - -class AddActiveX: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithActiveXControls/' - # Create an instance of Presentation class - pres = Presentation() - - # Adding the Media Player ActiveX control - controlType = ControlType - pres.getSlides().get_Item(0).getControls().addControl(controlType.WindowsMediaPlayer, 100, 100, 400, 400) - - # Access the Media Player ActiveX control and set the video path - pres.getSlides().get_Item(0).getControls().get_Item(0).getProperties().set_Item("URL" , dataDir + "Wildlife.mp4") - - # Write the presentation as a PPTX file - saveFormat = SaveFormat - pres.save(dataDir + "AddActiveX.pptx", saveFormat.Pptx) - - print "Added ActiveX control, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ControlType +from com.aspose.slides import SaveFormat + +class AddActiveX: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithActiveXControls/' + # Create an instance of Presentation class + pres = Presentation() + + # Adding the Media Player ActiveX control + controlType = ControlType + pres.getSlides().get_Item(0).getControls().addControl(controlType.WindowsMediaPlayer, 100, 100, 400, 400) + + # Access the Media Player ActiveX control and set the video path + pres.getSlides().get_Item(0).getControls().get_Item(0).getProperties().set_Item("URL" , dataDir + "Wildlife.mp4") + + # Write the presentation as a PPTX file + saveFormat = SaveFormat + pres.save(dataDir + "AddActiveX.pptx", saveFormat.Pptx) + + print "Added ActiveX control, please check the output file." + +if __name__ == '__main__': AddActiveX() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartLegend.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartLegend.py index 93a3a343..fee3f331 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartLegend.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartLegend.py @@ -1,46 +1,46 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import SaveFormat -from java.awt import Color - -class ChartLegend: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithCharts/' - - # Instantiate Presentation - pres = Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Add an AutoShape of Rectangle type - shape_type = ShapeType - ashp = slide.getShapes().addAutoShape(shape_type.Rectangle, 150, 75, 150, 50) - - # Add ITextFrame to the Rectangle - ashp.addTextFrame("Hello World") - - # Change the text color to Black (which is White by default) - fill_type = FillType - color = Color - ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().setFillType(fill_type.Solid) - ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) - - # Change the line color of the rectangle to White - ashp.getShapeStyle().getLineColor().setColor(color.WHITE) - - # Remove any fill formatting in the shape - ashp.getFillFormat().setFillType (fill_type.NoFill) - - # Save the presentation to disk - save_format = SaveFormat - pres.save(dataDir + "HelloWorld.pptx", save_format.Pptx) - - print "Document has been saved, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import SaveFormat +from java.awt import Color + +class ChartLegend: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithCharts/' + + # Instantiate Presentation + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shape_type = ShapeType + ashp = slide.getShapes().addAutoShape(shape_type.Rectangle, 150, 75, 150, 50) + + # Add ITextFrame to the Rectangle + ashp.addTextFrame("Hello World") + + # Change the text color to Black (which is White by default) + fill_type = FillType + color = Color + ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().setFillType(fill_type.Solid) + ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Change the line color of the rectangle to White + ashp.getShapeStyle().getLineColor().setColor(color.WHITE) + + # Remove any fill formatting in the shape + ashp.getFillFormat().setFillType (fill_type.NoFill) + + # Save the presentation to disk + save_format = SaveFormat + pres.save(dataDir + "HelloWorld.pptx", save_format.Pptx) + + print "Document has been saved, please check the output file." + +if __name__ == '__main__': ChartLegend() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartProperties.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartProperties.py index b3a4d422..966797d5 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartProperties.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartProperties.py @@ -1,128 +1,128 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat - -class ChartProperties: - - def __init__(self): - - # Setting the RotationX, RotationY and DepthPercents properties of 3D Chart. - self.set_rotation_and_depth() - - # Setting the GapWidth property of Chart Series - self.set_gapwidth() - - def set_rotation_and_depth(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ChartProperties' - - pres = Presentation() - - # Access first slide - sld = pres.getSlides().get_Item(0) - - # Add chart with default data - charType=ChartType - chart = sld.getShapes().addChart(charType.StackedColumn3D, 0, 0, 500, 500) - - # Getting the chart data worksheet - fact = chart.getChartData().getChartDataWorkbook() - - # Delete default generated series and categories - chart.getChartData().getSeries().clear() - chart.getChartData().getCategories().clear() - - # Adding series - chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()) - chart.getChartData().getSeries().add(fact.getCell(0, 0, 2, "Series 2"), chart.getType()) - - # Adding categories - chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "Caetegoty 1")) - chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "Caetegoty 2")) - chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "Caetegoty 3")) - - # Set Rotation3D properties - chart.getRotation3D().setRightAngleAxes(True) - chart.getRotation3D().setRotationX(40) - chart.getRotation3D().setRotationY(270) - chart.getRotation3D().setDepthPercents(150) - - # Take first chart series - series = chart.getChartData().getSeries().get_Item(0) - - # Populating series data - series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 1, 20)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 1, 50)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 1, 30)) - - # Take second chart series - series = chart.getChartData().getSeries().get_Item(1) - - # Populating series data - series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 2, 30)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 2, 10)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 2, 60)) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "3Drotation.pptx", save_format.Pptx) - - print "Done with rotation, please check the output file." - - def set_gapwidth(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ChartProperties' - - pres = Presentation() - - # Access first slide - sld = pres.getSlides().get_Item(0) - - # Add chart with default data - charType=ChartType - chart = sld.getShapes().addChart(charType.StackedColumn3D, 0, 0, 500, 500) - - # Getting the chart data worksheet - fact = chart.getChartData().getChartDataWorkbook() - - # Delete default generated series and categories - chart.getChartData().getSeries().clear() - chart.getChartData().getCategories().clear() - - # Adding series - chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()) - chart.getChartData().getSeries().add(fact.getCell(0, 0, 2, "Series 2"), chart.getType()) - - # Adding categories - chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "Caetegoty 1")) - chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "Caetegoty 2")) - chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "Caetegoty 3")) - - # Take first chart series - series = chart.getChartData().getSeries().get_Item(0) - - # Populating series data - series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 1, 20)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 1, 50)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 1, 30)) - - # Take second chart series - series = chart.getChartData().getSeries().get_Item(1) - - # Populating series data - series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 2, 30)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 2, 10)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 2, 60)) - - # Set GapWidth value - series.getParentSeriesGroup().setGapWidth(75) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "SetGapWidth.pptx", save_format.Pptx) - - print "Set Gapwidth property of chart series, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat + +class ChartProperties: + + def __init__(self): + + # Setting the RotationX, RotationY and DepthPercents properties of 3D Chart. + self.set_rotation_and_depth() + + # Setting the GapWidth property of Chart Series + self.set_gapwidth() + + def set_rotation_and_depth(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ChartProperties' + + pres = Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + charType=ChartType + chart = sld.getShapes().addChart(charType.StackedColumn3D, 0, 0, 500, 500) + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete default generated series and categories + chart.getChartData().getSeries().clear() + chart.getChartData().getCategories().clear() + + # Adding series + chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()) + chart.getChartData().getSeries().add(fact.getCell(0, 0, 2, "Series 2"), chart.getType()) + + # Adding categories + chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "Caetegoty 1")) + chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "Caetegoty 2")) + chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "Caetegoty 3")) + + # Set Rotation3D properties + chart.getRotation3D().setRightAngleAxes(True) + chart.getRotation3D().setRotationX(40) + chart.getRotation3D().setRotationY(270) + chart.getRotation3D().setDepthPercents(150) + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 1, 20)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 1, 50)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 1, 30)) + + # Take second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 2, 30)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 2, 10)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 2, 60)) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "3Drotation.pptx", save_format.Pptx) + + print "Done with rotation, please check the output file." + + def set_gapwidth(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ChartProperties' + + pres = Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + charType=ChartType + chart = sld.getShapes().addChart(charType.StackedColumn3D, 0, 0, 500, 500) + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete default generated series and categories + chart.getChartData().getSeries().clear() + chart.getChartData().getCategories().clear() + + # Adding series + chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()) + chart.getChartData().getSeries().add(fact.getCell(0, 0, 2, "Series 2"), chart.getType()) + + # Adding categories + chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "Caetegoty 1")) + chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "Caetegoty 2")) + chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "Caetegoty 3")) + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 1, 20)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 1, 50)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 1, 30)) + + # Take second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 2, 30)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 2, 10)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 2, 60)) + + # Set GapWidth value + series.getParentSeriesGroup().setGapWidth(75) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "SetGapWidth.pptx", save_format.Pptx) + + print "Set Gapwidth property of chart series, please check the output file." + +if __name__ == '__main__': ChartProperties() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartSeries.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartSeries.py index bc151f40..b16343fb 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartSeries.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartSeries.py @@ -1,37 +1,37 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat - -class ChartSeries: - - def __init__(self): - - # Adding Chart Series Overlap for Charts - self.add_overlap_for_chart() - - def add_overlap_for_chart(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ChartSeries' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Adding chart - chartType = ChartType - - chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.ClusteredColumn, 50, 50, 600, 400, True) - - series = chart.getChartData().getSeries() - if (series.get_Item(0).getOverlap() == 0): - # Setting series overlap - series . get_Item(0) . getParentSeriesGroup().setOverlap(-30) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "Overlap.pptx", save_format.Pptx) - - print "Added chart series overlap for charts, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat + +class ChartSeries: + + def __init__(self): + + # Adding Chart Series Overlap for Charts + self.add_overlap_for_chart() + + def add_overlap_for_chart(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ChartSeries' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Adding chart + chartType = ChartType + + chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.ClusteredColumn, 50, 50, 600, 400, True) + + series = chart.getChartData().getSeries() + if (series.get_Item(0).getOverlap() == 0): + # Setting series overlap + series . get_Item(0) . getParentSeriesGroup().setOverlap(-30) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "Overlap.pptx", save_format.Pptx) + + print "Added chart series overlap for charts, please check the output file." + +if __name__ == '__main__': ChartSeries() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartTrendLines.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartTrendLines.py index 3314ed07..e5912e54 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartTrendLines.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartTrendLines.py @@ -1,67 +1,67 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat -from com.aspose.slides import TrendlineType -from com.aspose.slides import FillType -from java.awt import Color - -class ChartTrendLines: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ChartTrendLines' - - # Creating empty presentation - pres =Presentation() - - # Creating a clustered column chart - chartType=ChartType - chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.ClusteredColumn, 20, 20, 500, 400) - - # Adding ponential trend line for chart series 1 - trendlineType=TrendlineType - tredLinep = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(trendlineType.Exponential) - tredLinep.setDisplayEquation(False) - tredLinep.setDisplayRSquaredValue(False) - - # Adding Linear trend line for chart series 1 - fillType=FillType - color=Color - - tredLineLin = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(trendlineType.Linear) - tredLineLin.setTrendlineType(trendlineType.Linear) - tredLineLin.getFormat().getLine().getFillFormat().setFillType(fillType.Solid) - tredLineLin.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.RED) - - - # Adding Logarithmic trend line for chart series 2 - tredLineLog = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(trendlineType.Logarithmic) - tredLineLog.setTrendlineType(trendlineType.Logarithmic) - tredLineLog.addTextFrameForOverriding("New log trend line") - - # Adding MovingAverage trend line for chart series 2 - tredLineMovAvg = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(trendlineType.MovingAverage) - tredLineMovAvg.setTrendlineType(trendlineType.MovingAverage) - tredLineMovAvg.setPeriod(3) - tredLineMovAvg.setTrendlineName("New TrendLine Name") - - # Adding Polynomial trend line for chart series 3 - tredLinePol = chart.getChartData().getSeries().get_Item(2).getTrendLines().add(trendlineType.Polynomial) - tredLinePol.setTrendlineType(trendlineType.Polynomial) - tredLinePol.setForward(1) - tredLinePol.setOrder(3) - - # Adding Power trend line for chart series 3 - tredLinePower = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(trendlineType.Power) - tredLinePower.setTrendlineType(trendlineType.Power) - tredLinePower.setBackward(1) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "ChartTrendLines.pptx", save_format.Pptx) - - print "Done with chart trend lines, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat +from com.aspose.slides import TrendlineType +from com.aspose.slides import FillType +from java.awt import Color + +class ChartTrendLines: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ChartTrendLines' + + # Creating empty presentation + pres =Presentation() + + # Creating a clustered column chart + chartType=ChartType + chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.ClusteredColumn, 20, 20, 500, 400) + + # Adding ponential trend line for chart series 1 + trendlineType=TrendlineType + tredLinep = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(trendlineType.Exponential) + tredLinep.setDisplayEquation(False) + tredLinep.setDisplayRSquaredValue(False) + + # Adding Linear trend line for chart series 1 + fillType=FillType + color=Color + + tredLineLin = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(trendlineType.Linear) + tredLineLin.setTrendlineType(trendlineType.Linear) + tredLineLin.getFormat().getLine().getFillFormat().setFillType(fillType.Solid) + tredLineLin.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.RED) + + + # Adding Logarithmic trend line for chart series 2 + tredLineLog = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(trendlineType.Logarithmic) + tredLineLog.setTrendlineType(trendlineType.Logarithmic) + tredLineLog.addTextFrameForOverriding("New log trend line") + + # Adding MovingAverage trend line for chart series 2 + tredLineMovAvg = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(trendlineType.MovingAverage) + tredLineMovAvg.setTrendlineType(trendlineType.MovingAverage) + tredLineMovAvg.setPeriod(3) + tredLineMovAvg.setTrendlineName("New TrendLine Name") + + # Adding Polynomial trend line for chart series 3 + tredLinePol = chart.getChartData().getSeries().get_Item(2).getTrendLines().add(trendlineType.Polynomial) + tredLinePol.setTrendlineType(trendlineType.Polynomial) + tredLinePol.setForward(1) + tredLinePol.setOrder(3) + + # Adding Power trend line for chart series 3 + tredLinePower = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(trendlineType.Power) + tredLinePower.setTrendlineType(trendlineType.Power) + tredLinePower.setBackward(1) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "ChartTrendLines.pptx", save_format.Pptx) + + print "Done with chart trend lines, please check the output file." + +if __name__ == '__main__': ChartTrendLines() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/CreateChart.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/CreateChart.py index 00cd8d55..5f554b73 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/CreateChart.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/CreateChart.py @@ -1,194 +1,194 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import ChartType -from com.aspose.slides import LineDashStyle -from com.aspose.slides import LineArrowheadLength -from com.aspose.slides import LineArrowheadStyle -from com.aspose.slides import PresetColor -from com.aspose.slides import FillType -from com.aspose.slides import NullableBool -from com.aspose.slides import MarkerStyleType -from java.awt import color - -class CreateChart : - - def __init__(self): - # Creating Normal Charts - self.create_normal_chart() - - # Creating Scattered Chart with multiple series and different series markers - self.create_scatter_chart() - - - def create_normal_chart(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/CreateChart' - - pres = Presentation() - - # Access first slide - sld = pres.getSlides().get_Item(0) - - chartType=ChartType() - # Add chart with default data - chart = sld.getShapes().addChart(chartType.ClusteredColumn, 0, 0, 500, 500) - - nullableBool=NullableBool() - - # Setting chart Title - # chart.ChartTitle.TextFrameForOverriding.Text = "Sample Title" - chart.getChartTitle().addTextFrameForOverriding("Sample Title") - chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(nullableBool.True) - chart.getChartTitle().setHeight (20) - chart.hasTitle(True) - - # Set first series to Show Values - chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(True) - - # Setting the index of chart data sheet - defaultWorksheetIndex = 0 - - # Getting the chart data worksheet - fact = chart.getChartData().getChartDataWorkbook() - - # Delete default generated series and categories - chart.getChartData().getSeries().clear() - chart.getChartData().getCategories().clear() - s = chart.getChartData().getSeries().size() - s = chart.getChartData().getCategories().size() - - # Adding series - chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 1, "Series 1"), chart.getType()) - chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 2, "Series 2"), chart.getType()) - - # Adding categories - chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "Caetegoty 1")) - chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 2, 0, "Caetegoty 2")) - chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 3, 0, "Caetegoty 3")) - - # Take first chart series - series = chart.getChartData().getSeries().get_Item(0) - - # Now populating series data - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)) - - # Setting fill color for series - fillType=FillType() - color=Color() - - - series.getFormat().getFill().setFillType(fillType.Solid) - series.getFormat().getFill().getSolidFillColor().setColor(color.RED) - - - # Take second chart series - series = chart.getChartData().getSeries().get_Item(1) - - # Now populating series data - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 2, 30)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 2, 10)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 2, 60)) - - # Setting fill color for series - - fillType1=FillType() - color1=Color() - - series.getFormat().getFill().setFillType(fillType1.Solid) - series.getFormat().getFill().getSolidFillColor().setColor(color1.GREEN) - - # create custom labels for each of categories for series - # first label will be show Category name - lbl = series.getDataPoints().get_Item(0).getLabel() - lbl.getDataLabelFormat().setShowCategoryName(True) - - lbl = series.getDataPoints().get_Item(1).getLabel() - lbl.getDataLabelFormat().setShowSeriesName(True) - - # Show value for third label - lbl = series.getDataPoints().get_Item(2).getLabel() - lbl.getDataLabelFormat().setShowValue(True) - lbl.getDataLabelFormat().setShowSeriesName(True) - lbl.getDataLabelFormat().setSeparator ("/") - - # Save presentation with chart - save_format = SaveFormat() - pres.save(dataDir + "NormalChart.pptx", save_format.Pptx) - - print "Created normal chart, please check the output file.".PHP_EOL - - def create_scatter_chart(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/CreateChart' - - pres = Presentation() - - slide = pres.getSlides().get_Item(0) - - chartType=ChartType() - - # Creating the default chart - chart = slide.getShapes().addChart(chartType.ScatterWithSmoothLines, 0, 0, 400, 400) - - # Getting the default chart data worksheet index - defaultWorksheetIndex = 0 - - # Getting the chart data worksheet - fact = chart.getChartData().getChartDataWorkbook() - - # Delete demo series - chart.getChartData().getSeries().clear() - - # Add series - chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 1, "Series 1"), chart.getType()) - chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 3, "Series 2"), chart.getType()) - - # Take first chart series - series = chart.getChartData().getSeries().get_Item(0) - - # Add point (1:3) there. - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 1), fact.getCell(defaultWorksheetIndex, 2, 2, 3)) - - # Add point (2:10) - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 2), fact.getCell(defaultWorksheetIndex, 3, 2, 10)) - - # Edit the type of series - chartType=ChartType() - series.setType(chartType.ScatterWithStraightLinesAndMarkers) - - # Changing the chart series marker - - markerStyleType=MarkerStyleType() - series.getMarker().setSize(10) - series.getMarker().setSymbol(markerStyleType.Star) - - # Take second chart series - series = chart.getChartData().getSeries().get_Item(1) - - # Add point (5:2) there. - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 5), fact.getCell(defaultWorksheetIndex, 2, 4, 2)) - - # Add point (3:1) - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 3), fact.getCell(defaultWorksheetIndex, 3, 4, 1)) - - # Add point (2:2) - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 4, 3, 2), fact.getCell(defaultWorksheetIndex, 4, 4, 2)) - - # Add point (5:1) - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 5, 3, 5), fact.getCell(defaultWorksheetIndex, 5, 4, 1)) - - # Changing the chart series marker - - markerStyleType1=MarkerStyleType() - - series.getMarker().setSize(10) - series.getMarker().setSymbol(markerStyleType1.Circle) - - save_format = SaveFormat() - pres.save(dataDir + "AsposeScatterChart.pptx", save_format.Pptx) - +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import ChartType +from com.aspose.slides import LineDashStyle +from com.aspose.slides import LineArrowheadLength +from com.aspose.slides import LineArrowheadStyle +from com.aspose.slides import PresetColor +from com.aspose.slides import FillType +from com.aspose.slides import NullableBool +from com.aspose.slides import MarkerStyleType +from java.awt import color + +class CreateChart : + + def __init__(self): + # Creating Normal Charts + self.create_normal_chart() + + # Creating Scattered Chart with multiple series and different series markers + self.create_scatter_chart() + + + def create_normal_chart(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/CreateChart' + + pres = Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + chartType=ChartType() + # Add chart with default data + chart = sld.getShapes().addChart(chartType.ClusteredColumn, 0, 0, 500, 500) + + nullableBool=NullableBool() + + # Setting chart Title + # chart.ChartTitle.TextFrameForOverriding.Text = "Sample Title" + chart.getChartTitle().addTextFrameForOverriding("Sample Title") + chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(nullableBool.True) + chart.getChartTitle().setHeight (20) + chart.hasTitle(True) + + # Set first series to Show Values + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(True) + + # Setting the index of chart data sheet + defaultWorksheetIndex = 0 + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete default generated series and categories + chart.getChartData().getSeries().clear() + chart.getChartData().getCategories().clear() + s = chart.getChartData().getSeries().size() + s = chart.getChartData().getCategories().size() + + # Adding series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 1, "Series 1"), chart.getType()) + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 2, "Series 2"), chart.getType()) + + # Adding categories + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "Caetegoty 1")) + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 2, 0, "Caetegoty 2")) + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 3, 0, "Caetegoty 3")) + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)) + + # Setting fill color for series + fillType=FillType() + color=Color() + + + series.getFormat().getFill().setFillType(fillType.Solid) + series.getFormat().getFill().getSolidFillColor().setColor(color.RED) + + + # Take second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 2, 30)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 2, 10)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 2, 60)) + + # Setting fill color for series + + fillType1=FillType() + color1=Color() + + series.getFormat().getFill().setFillType(fillType1.Solid) + series.getFormat().getFill().getSolidFillColor().setColor(color1.GREEN) + + # create custom labels for each of categories for series + # first label will be show Category name + lbl = series.getDataPoints().get_Item(0).getLabel() + lbl.getDataLabelFormat().setShowCategoryName(True) + + lbl = series.getDataPoints().get_Item(1).getLabel() + lbl.getDataLabelFormat().setShowSeriesName(True) + + # Show value for third label + lbl = series.getDataPoints().get_Item(2).getLabel() + lbl.getDataLabelFormat().setShowValue(True) + lbl.getDataLabelFormat().setShowSeriesName(True) + lbl.getDataLabelFormat().setSeparator ("/") + + # Save presentation with chart + save_format = SaveFormat() + pres.save(dataDir + "NormalChart.pptx", save_format.Pptx) + + print "Created normal chart, please check the output file.".PHP_EOL + + def create_scatter_chart(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/CreateChart' + + pres = Presentation() + + slide = pres.getSlides().get_Item(0) + + chartType=ChartType() + + # Creating the default chart + chart = slide.getShapes().addChart(chartType.ScatterWithSmoothLines, 0, 0, 400, 400) + + # Getting the default chart data worksheet index + defaultWorksheetIndex = 0 + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete demo series + chart.getChartData().getSeries().clear() + + # Add series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 1, "Series 1"), chart.getType()) + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 3, "Series 2"), chart.getType()) + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Add point (1:3) there. + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 1), fact.getCell(defaultWorksheetIndex, 2, 2, 3)) + + # Add point (2:10) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 2), fact.getCell(defaultWorksheetIndex, 3, 2, 10)) + + # Edit the type of series + chartType=ChartType() + series.setType(chartType.ScatterWithStraightLinesAndMarkers) + + # Changing the chart series marker + + markerStyleType=MarkerStyleType() + series.getMarker().setSize(10) + series.getMarker().setSymbol(markerStyleType.Star) + + # Take second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Add point (5:2) there. + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 5), fact.getCell(defaultWorksheetIndex, 2, 4, 2)) + + # Add point (3:1) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 3), fact.getCell(defaultWorksheetIndex, 3, 4, 1)) + + # Add point (2:2) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 4, 3, 2), fact.getCell(defaultWorksheetIndex, 4, 4, 2)) + + # Add point (5:1) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 5, 3, 5), fact.getCell(defaultWorksheetIndex, 5, 4, 1)) + + # Changing the chart series marker + + markerStyleType1=MarkerStyleType() + + series.getMarker().setSize(10) + series.getMarker().setSymbol(markerStyleType1.Circle) + + save_format = SaveFormat() + pres.save(dataDir + "AsposeScatterChart.pptx", save_format.Pptx) + print "Created scatter chart, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ErrorBars.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ErrorBars.py index 0e74196a..3869064f 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ErrorBars.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ErrorBars.py @@ -1,101 +1,101 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat -from com.aspose.slides import ErrorBarValueType -from com.aspose.slides import ErrorBarType -from com.aspose.slides import DataSourceType - -class ErrorBars: - - def __init__(self): - - # Adding Fixed Error Bar Value for Chart - self.add_fixed_error_bar_value() - - # Adding Custom Error Bar Value for Chart - self.add_custom_error_bar_value() - - def add_fixed_error_bar_value(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ErrorBars' - - pres = Presentation() - - # Creating a bubble chart - chartType=ChartType - chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.Bubble, 50, 50, 400, 300, True) - - # Adding Error bars and setting its format - error_bar_x = chart.getChartData().getSeries().get_Item(0).getErrorBarsXFormat() - error_bar_y = chart.getChartData().getSeries().get_Item(0).getErrorBarsYFormat() - - - errorBarValueType = ErrorBarValueType - errorBarType = ErrorBarType - - error_bar_x.setValueType(errorBarValueType.Fixed) - - error_bar_x.setValue(0.1) - - error_bar_y.setValueType(errorBarValueType.Percentage) - error_bar_y.setValue(5) - error_bar_x.setType(errorBarType.Plus) - error_bar_y.getFormat().getLine().setWidth(2.0) - #error_bar_x.hasEndCap(True) - - # Save presentation with chart - save_format = SaveFormat - pres.save(dataDir + "ErrorBar.pptx", save_format.Pptx) - - print "Added fixed error bar value for chart, please check the output file." - - def add_custom_error_bar_value(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ErrorBars' - - pres = Presentation() - - slide = pres.getSlides().get_Item(0) - - # Creating a bubble chart - chartType = ChartType - chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.Bubble, 50, 50, 400, 300, True) - - # Adding custom Error bars and setting its format - error_bar_value_type = ErrorBarValueType - series = chart.getChartData().getSeries().get_Item(0) - error_bar_x = series.getErrorBarsXFormat() - error_bar_y = series.getErrorBarsYFormat() - - #error_bar_x.isVisible(True) - #error_bar_y.isVisible(True) - - error_bar_x.setValueType(error_bar_value_type.Custom) - error_bar_y.setValueType(error_bar_value_type.Custom) - - #Accessing chart series data point and setting error bars values for individual point - data_source_type = DataSourceType - points = series.getDataPoints() - points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForXPlusValues(data_source_type.DoubleLiterals) - points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForXMinusValues(data_source_type.DoubleLiterals) - points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForYPlusValues(data_source_type.DoubleLiterals) - points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForYMinusValues(data_source_type.DoubleLiterals) - - # Setting error bars for chart series points - i = 0 - while i < points.size(): - points.get_Item(i).getErrorBarsCustomValues().getXMinus().setAsLiteralDouble(i + 1) - points.get_Item(i).getErrorBarsCustomValues().getXPlus().setAsLiteralDouble(i + 1) - points.get_Item(i).getErrorBarsCustomValues().getYMinus().setAsLiteralDouble(i + 1) - points.get_Item(i).getErrorBarsCustomValues().getYPlus().setAsLiteralDouble(i + 1) - i+=1 - - - save_format = SaveFormat - pres.save(dataDir + "ErrorBarsCustomValues.pptx", save_format.Pptx) - - print "Added custom error bars values for chart, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat +from com.aspose.slides import ErrorBarValueType +from com.aspose.slides import ErrorBarType +from com.aspose.slides import DataSourceType + +class ErrorBars: + + def __init__(self): + + # Adding Fixed Error Bar Value for Chart + self.add_fixed_error_bar_value() + + # Adding Custom Error Bar Value for Chart + self.add_custom_error_bar_value() + + def add_fixed_error_bar_value(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ErrorBars' + + pres = Presentation() + + # Creating a bubble chart + chartType=ChartType + chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.Bubble, 50, 50, 400, 300, True) + + # Adding Error bars and setting its format + error_bar_x = chart.getChartData().getSeries().get_Item(0).getErrorBarsXFormat() + error_bar_y = chart.getChartData().getSeries().get_Item(0).getErrorBarsYFormat() + + + errorBarValueType = ErrorBarValueType + errorBarType = ErrorBarType + + error_bar_x.setValueType(errorBarValueType.Fixed) + + error_bar_x.setValue(0.1) + + error_bar_y.setValueType(errorBarValueType.Percentage) + error_bar_y.setValue(5) + error_bar_x.setType(errorBarType.Plus) + error_bar_y.getFormat().getLine().setWidth(2.0) + #error_bar_x.hasEndCap(True) + + # Save presentation with chart + save_format = SaveFormat + pres.save(dataDir + "ErrorBar.pptx", save_format.Pptx) + + print "Added fixed error bar value for chart, please check the output file." + + def add_custom_error_bar_value(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ErrorBars' + + pres = Presentation() + + slide = pres.getSlides().get_Item(0) + + # Creating a bubble chart + chartType = ChartType + chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.Bubble, 50, 50, 400, 300, True) + + # Adding custom Error bars and setting its format + error_bar_value_type = ErrorBarValueType + series = chart.getChartData().getSeries().get_Item(0) + error_bar_x = series.getErrorBarsXFormat() + error_bar_y = series.getErrorBarsYFormat() + + #error_bar_x.isVisible(True) + #error_bar_y.isVisible(True) + + error_bar_x.setValueType(error_bar_value_type.Custom) + error_bar_y.setValueType(error_bar_value_type.Custom) + + #Accessing chart series data point and setting error bars values for individual point + data_source_type = DataSourceType + points = series.getDataPoints() + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForXPlusValues(data_source_type.DoubleLiterals) + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForXMinusValues(data_source_type.DoubleLiterals) + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForYPlusValues(data_source_type.DoubleLiterals) + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForYMinusValues(data_source_type.DoubleLiterals) + + # Setting error bars for chart series points + i = 0 + while i < points.size(): + points.get_Item(i).getErrorBarsCustomValues().getXMinus().setAsLiteralDouble(i + 1) + points.get_Item(i).getErrorBarsCustomValues().getXPlus().setAsLiteralDouble(i + 1) + points.get_Item(i).getErrorBarsCustomValues().getYMinus().setAsLiteralDouble(i + 1) + points.get_Item(i).getErrorBarsCustomValues().getYPlus().setAsLiteralDouble(i + 1) + i+=1 + + + save_format = SaveFormat + pres.save(dataDir + "ErrorBarsCustomValues.pptx", save_format.Pptx) + + print "Added custom error bars values for chart, please check the output file." + +if __name__ == '__main__': ErrorBars() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ExistingChart.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ExistingChart.py index 38367c6c..8f56624d 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ExistingChart.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ExistingChart.py @@ -1,73 +1,73 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat - -class ExistingChart: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ExistingChart/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + "AsposeChart.pptx") - - # Access first slide - sld = pres.getSlides().get_Item(0) - - # Add chart with default data - chart = sld.getShapes().get_Item(0) - - # Setting the index of chart data sheet - defaultWorksheetIndex = 0 - - # Getting the chart data worksheet - fact = chart.getChartData().getChartDataWorkbook() - - # Changing chart Category Name - fact.getCell(defaultWorksheetIndex, 1, 0, "Modified Category 1") - fact.getCell(defaultWorksheetIndex, 2, 0, "Modified Category 2") - - - # Take first chart series - series = chart.getChartData().getSeries().get_Item(0) - - # Now updating series data - fact.getCell(defaultWorksheetIndex, 0, 1, "New_Series1") # modifying series name - series.getDataPoints().get_Item(0).getValue().setData(90) - series.getDataPoints().get_Item(1).getValue().setData(123) - series.getDataPoints().get_Item(2).getValue().setData(44) - - # Take Second chart series - series = chart.getChartData().getSeries().get_Item(1) - - # Now updating series data - fact.getCell(defaultWorksheetIndex, 0, 2, "New_Series2") #modifying series name - series.getDataPoints().get_Item(0).getValue().setData(23) - series.getDataPoints().get_Item(1).getValue().setData(67) - series.getDataPoints().get_Item(2).getValue().setData(99) - - - # Now, Adding a series - chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 3, "Series 3"), chart.getType()) - - # Take 3rd chart series - series = chart.getChartData().getSeries().get_Item(2) - - # Now populating series data - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 3, 20)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 50)) - series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 30)) - - chartType=ChartType - chart.setType(chartType.ClusteredCylinder) - - - # Saving the presentation to HTML format - save_format = SaveFormat - pres.save(dataDir + "AsposeChartModified.pptx", save_format.Pptx) - - print "Updated chart, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat + +class ExistingChart: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ExistingChart/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + "AsposeChart.pptx") + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + chart = sld.getShapes().get_Item(0) + + # Setting the index of chart data sheet + defaultWorksheetIndex = 0 + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Changing chart Category Name + fact.getCell(defaultWorksheetIndex, 1, 0, "Modified Category 1") + fact.getCell(defaultWorksheetIndex, 2, 0, "Modified Category 2") + + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Now updating series data + fact.getCell(defaultWorksheetIndex, 0, 1, "New_Series1") # modifying series name + series.getDataPoints().get_Item(0).getValue().setData(90) + series.getDataPoints().get_Item(1).getValue().setData(123) + series.getDataPoints().get_Item(2).getValue().setData(44) + + # Take Second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Now updating series data + fact.getCell(defaultWorksheetIndex, 0, 2, "New_Series2") #modifying series name + series.getDataPoints().get_Item(0).getValue().setData(23) + series.getDataPoints().get_Item(1).getValue().setData(67) + series.getDataPoints().get_Item(2).getValue().setData(99) + + + # Now, Adding a series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 3, "Series 3"), chart.getType()) + + # Take 3rd chart series + series = chart.getChartData().getSeries().get_Item(2) + + # Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 3, 20)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 50)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 30)) + + chartType=ChartType + chart.setType(chartType.ClusteredCylinder) + + + # Saving the presentation to HTML format + save_format = SaveFormat + pres.save(dataDir + "AsposeChartModified.pptx", save_format.Pptx) + + print "Updated chart, please check the output file." + +if __name__ == '__main__': ExistingChart() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/FormattingChartEntities.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/FormattingChartEntities.py index 6c0dc16b..ec7ec5f6 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/FormattingChartEntities.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/FormattingChartEntities.py @@ -1,195 +1,195 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat -from com.aspose.slides import FillType -from com.aspose.slides import NullableBool -from com.aspose.slides import LineDashStyle -from java.awt import Color -from com.aspose.slides import DisplayUnitType -from com.aspose.slides import FontData -from com.aspose.slides import PresetColor -from com.aspose.slides import TickLabelPositionType -from com.aspose.slides import LineStyle - -class FormattingChartEntities: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithCharts/FormattingChartEntities/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Accessing the first slide - slide = pres.getSlides().get_Item(0) - - # Adding the sample chart - chartType=ChartType - chart = slide.getShapes().addChart(chartType.LineWithMarkers, 50, 50, 500, 400) - - # Setting Chart Titile - chart.hasTitle() - chart.getChartTitle().addTextFrameForOverriding("") - chartTitle = chart.getChartTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) - chartTitle.setText("Sample Chart") - - fillType=FillType - color=Color - nullableBool=NullableBool - lineDashStyle=LineDashStyle - - chartTitle.getPortionFormat().getFillFormat().setFillType(fillType.Solid) - chartTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GRAY) - chartTitle.getPortionFormat().setFontHeight (20) - chartTitle.getPortionFormat().setFontBold(nullableBool.True) - chartTitle.getPortionFormat().setFontItalic(nullableBool.True) - - # Setting Major grid lines format for value axis - chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) - chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.BLUE) - chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setWidth(5) - chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setDashStyle(lineDashStyle.DashDot) - - # Setting Minor grid lines format for value axis - chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) - chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.RED) - chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().setWidth(3) - - # Setting value axis number format - - displayUnitType=DisplayUnitType - chart.getAxes().getVerticalAxis().isNumberFormatLinkedToSource() - chart.getAxes().getVerticalAxis().setDisplayUnit(displayUnitType.Thousands) - chart.getAxes().getVerticalAxis().setNumberFormat("0.0%") - - # Setting chart maximum, minimum values - chart.getAxes().getVerticalAxis().isAutomaticMajorUnit() - chart.getAxes().getVerticalAxis().isAutomaticMaxValue() - chart.getAxes().getVerticalAxis().isAutomaticMinorUnit() - chart.getAxes().getVerticalAxis().isAutomaticMinValue() - - chart.getAxes().getVerticalAxis().setMaxValue(15) - chart.getAxes().getVerticalAxis().setMinValue(-2) - chart.getAxes().getVerticalAxis().setMinorUnit(0.5) - chart.getAxes().getVerticalAxis().setMajorUnit(2.0) - - # Setting Value Axis Text Properties - - fontData=FontData - presetColor=PresetColor - - txtVal = chart.getAxes().getVerticalAxis().getTextFormat().getPortionFormat() - txtVal.setFontBold(nullableBool.True) - txtVal.setFontHeight(16) - txtVal.setFontItalic(nullableBool.True) - txtVal.getFillFormat().setFillType(fillType.Solid) - txtVal.getFillFormat().getSolidFillColor().setColor(Color(presetColor.DarkGreen)) - txtVal.setLatinFont(FontData("Times New Roman")) - - # Setting value axis title - chart.getAxes().getVerticalAxis().hasTitle() - chart.getAxes().getVerticalAxis().getTitle().addTextFrameForOverriding("") - valtitle = chart.getAxes().getVerticalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) - valtitle.setText("Primary Axis") - valtitle.getPortionFormat().getFillFormat().setFillType(fillType.Solid) - valtitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GRAY) - valtitle.getPortionFormat().setFontHeight(20) - valtitle.getPortionFormat().setFontBold(nullableBool.True) - valtitle.getPortionFormat().setFontItalic(nullableBool.True) - - # Setting Major grid lines format for Category axis - chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) - chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.GREEN) - chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().setWidth(5) - - # Setting Minor grid lines format for Category axis - chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) - chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.YELLOW) - chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().setWidth(3) - - #Setting Category Axis Text Properties - txtCat = chart.getAxes().getHorizontalAxis().getTextFormat().getPortionFormat() - txtCat.setFontBold(nullableBool.True) - txtCat.setFontHeight(16) - txtCat.setFontItalic(nullableBool.True) - txtCat.getFillFormat().setFillType(fillType.Solid) - txtCat.getFillFormat().getSolidFillColor().setColor(color.BLUE) - txtCat.setLatinFont(FontData("Arial")) - - # Setting Category Titile - chart.getAxes().getHorizontalAxis().hasTitle() - chart.getAxes().getHorizontalAxis().getTitle().addTextFrameForOverriding("") - - catTitle = chart.getAxes().getHorizontalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) - catTitle.setText("Sample Category") - catTitle.getPortionFormat().getFillFormat().setFillType(fillType.Solid) - catTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GRAY) - catTitle.getPortionFormat().setFontHeight(20) - catTitle.getPortionFormat().setFontBold(nullableBool.True) - catTitle.getPortionFormat().setFontItalic(nullableBool.True) - - # Setting category axis lable position - tickLabelPositionType = TickLabelPositionType - chart.getAxes().getHorizontalAxis().setTickLabelPosition(tickLabelPositionType.Low) - - # Setting category axis lable rotation angle - chart.getAxes().getHorizontalAxis().setTickLabelRotationAngle(45) - - # Setting Legends Text Properties - txtleg = chart.getLegend().getTextFormat().getPortionFormat() - txtleg.setFontBold(nullableBool.True) - txtleg.setFontHeight(16) - txtleg.setFontItalic(nullableBool.True) - txtleg.getFillFormat().setFillType(fillType.Solid) - txtleg.getFillFormat().getSolidFillColor().setColor(Color(presetColor.DarkRed)) - - # Set show chart legends without overlapping chart - chart.getLegend().setOverlay(True) - #chart.ChartData.Series[0].PlotOnSecondAxis=True - chart.getChartData().getSeries().get_Item(0).setPlotOnSecondAxis(True) - - # Setting secondary value axis - lineStyle = LineStyle - chart.getAxes().getSecondaryVerticalAxis().isVisible() - chart.getAxes().getSecondaryVerticalAxis().getFormat().getLine().setStyle(lineStyle.ThickBetweenThin) - chart.getAxes().getSecondaryVerticalAxis().getFormat().getLine().setWidth(20) - - # Setting secondary value axis Number format - chart.getAxes().getSecondaryVerticalAxis().isNumberFormatLinkedToSource() - displayUnitType=DisplayUnitType - chart.getAxes().getSecondaryVerticalAxis().setDisplayUnit(displayUnitType.Hundreds) - chart.getAxes().getSecondaryVerticalAxis().setNumberFormat ("0.0%") - - # Setting chart maximum, minimum values - chart.getAxes().getSecondaryVerticalAxis().isAutomaticMajorUnit() - chart.getAxes().getSecondaryVerticalAxis().isAutomaticMaxValue() - chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinorUnit() - chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinValue() - - chart.getAxes().getSecondaryVerticalAxis().setMaxValue(20) - chart.getAxes().getSecondaryVerticalAxis().setMinValue(-5) - chart.getAxes().getSecondaryVerticalAxis().setMinorUnit(0.5) - chart.getAxes().getSecondaryVerticalAxis().setMajorUnit(2.0) - - - # Setting chart back wall color - chart.getBackWall().setThickness(1) - chart.getBackWall().getFormat().getFill().setFillType(fillType.Solid) - chart.getBackWall().getFormat().getFill().getSolidFillColor().setColor(color.ORANGE) - - chart.getFloor().getFormat().getFill().setFillType(fillType.Solid) - chart.getFloor().getFormat().getFill().getSolidFillColor().setColor(color.RED) - - # Setting Plot area color - chart.getPlotArea().getFormat().getFill().setFillType(fillType.Solid) - chart.getPlotArea().getFormat().getFill().getSolidFillColor().setColor(Color(presetColor.LightCyan)) - - # Save Presentation - save_format = SaveFormat - pres.save(dataDir + "FormattedChart.pptx", save_format.Pptx) - - print "Formatted chart entities, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat +from com.aspose.slides import FillType +from com.aspose.slides import NullableBool +from com.aspose.slides import LineDashStyle +from java.awt import Color +from com.aspose.slides import DisplayUnitType +from com.aspose.slides import FontData +from com.aspose.slides import PresetColor +from com.aspose.slides import TickLabelPositionType +from com.aspose.slides import LineStyle + +class FormattingChartEntities: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithCharts/FormattingChartEntities/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Accessing the first slide + slide = pres.getSlides().get_Item(0) + + # Adding the sample chart + chartType=ChartType + chart = slide.getShapes().addChart(chartType.LineWithMarkers, 50, 50, 500, 400) + + # Setting Chart Titile + chart.hasTitle() + chart.getChartTitle().addTextFrameForOverriding("") + chartTitle = chart.getChartTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) + chartTitle.setText("Sample Chart") + + fillType=FillType + color=Color + nullableBool=NullableBool + lineDashStyle=LineDashStyle + + chartTitle.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + chartTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GRAY) + chartTitle.getPortionFormat().setFontHeight (20) + chartTitle.getPortionFormat().setFontBold(nullableBool.True) + chartTitle.getPortionFormat().setFontItalic(nullableBool.True) + + # Setting Major grid lines format for value axis + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.BLUE) + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setWidth(5) + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setDashStyle(lineDashStyle.DashDot) + + # Setting Minor grid lines format for value axis + chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) + chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.RED) + chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().setWidth(3) + + # Setting value axis number format + + displayUnitType=DisplayUnitType + chart.getAxes().getVerticalAxis().isNumberFormatLinkedToSource() + chart.getAxes().getVerticalAxis().setDisplayUnit(displayUnitType.Thousands) + chart.getAxes().getVerticalAxis().setNumberFormat("0.0%") + + # Setting chart maximum, minimum values + chart.getAxes().getVerticalAxis().isAutomaticMajorUnit() + chart.getAxes().getVerticalAxis().isAutomaticMaxValue() + chart.getAxes().getVerticalAxis().isAutomaticMinorUnit() + chart.getAxes().getVerticalAxis().isAutomaticMinValue() + + chart.getAxes().getVerticalAxis().setMaxValue(15) + chart.getAxes().getVerticalAxis().setMinValue(-2) + chart.getAxes().getVerticalAxis().setMinorUnit(0.5) + chart.getAxes().getVerticalAxis().setMajorUnit(2.0) + + # Setting Value Axis Text Properties + + fontData=FontData + presetColor=PresetColor + + txtVal = chart.getAxes().getVerticalAxis().getTextFormat().getPortionFormat() + txtVal.setFontBold(nullableBool.True) + txtVal.setFontHeight(16) + txtVal.setFontItalic(nullableBool.True) + txtVal.getFillFormat().setFillType(fillType.Solid) + txtVal.getFillFormat().getSolidFillColor().setColor(Color(presetColor.DarkGreen)) + txtVal.setLatinFont(FontData("Times New Roman")) + + # Setting value axis title + chart.getAxes().getVerticalAxis().hasTitle() + chart.getAxes().getVerticalAxis().getTitle().addTextFrameForOverriding("") + valtitle = chart.getAxes().getVerticalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) + valtitle.setText("Primary Axis") + valtitle.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + valtitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GRAY) + valtitle.getPortionFormat().setFontHeight(20) + valtitle.getPortionFormat().setFontBold(nullableBool.True) + valtitle.getPortionFormat().setFontItalic(nullableBool.True) + + # Setting Major grid lines format for Category axis + chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) + chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.GREEN) + chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().setWidth(5) + + # Setting Minor grid lines format for Category axis + chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) + chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.YELLOW) + chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().setWidth(3) + + #Setting Category Axis Text Properties + txtCat = chart.getAxes().getHorizontalAxis().getTextFormat().getPortionFormat() + txtCat.setFontBold(nullableBool.True) + txtCat.setFontHeight(16) + txtCat.setFontItalic(nullableBool.True) + txtCat.getFillFormat().setFillType(fillType.Solid) + txtCat.getFillFormat().getSolidFillColor().setColor(color.BLUE) + txtCat.setLatinFont(FontData("Arial")) + + # Setting Category Titile + chart.getAxes().getHorizontalAxis().hasTitle() + chart.getAxes().getHorizontalAxis().getTitle().addTextFrameForOverriding("") + + catTitle = chart.getAxes().getHorizontalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) + catTitle.setText("Sample Category") + catTitle.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + catTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GRAY) + catTitle.getPortionFormat().setFontHeight(20) + catTitle.getPortionFormat().setFontBold(nullableBool.True) + catTitle.getPortionFormat().setFontItalic(nullableBool.True) + + # Setting category axis lable position + tickLabelPositionType = TickLabelPositionType + chart.getAxes().getHorizontalAxis().setTickLabelPosition(tickLabelPositionType.Low) + + # Setting category axis lable rotation angle + chart.getAxes().getHorizontalAxis().setTickLabelRotationAngle(45) + + # Setting Legends Text Properties + txtleg = chart.getLegend().getTextFormat().getPortionFormat() + txtleg.setFontBold(nullableBool.True) + txtleg.setFontHeight(16) + txtleg.setFontItalic(nullableBool.True) + txtleg.getFillFormat().setFillType(fillType.Solid) + txtleg.getFillFormat().getSolidFillColor().setColor(Color(presetColor.DarkRed)) + + # Set show chart legends without overlapping chart + chart.getLegend().setOverlay(True) + #chart.ChartData.Series[0].PlotOnSecondAxis=True + chart.getChartData().getSeries().get_Item(0).setPlotOnSecondAxis(True) + + # Setting secondary value axis + lineStyle = LineStyle + chart.getAxes().getSecondaryVerticalAxis().isVisible() + chart.getAxes().getSecondaryVerticalAxis().getFormat().getLine().setStyle(lineStyle.ThickBetweenThin) + chart.getAxes().getSecondaryVerticalAxis().getFormat().getLine().setWidth(20) + + # Setting secondary value axis Number format + chart.getAxes().getSecondaryVerticalAxis().isNumberFormatLinkedToSource() + displayUnitType=DisplayUnitType + chart.getAxes().getSecondaryVerticalAxis().setDisplayUnit(displayUnitType.Hundreds) + chart.getAxes().getSecondaryVerticalAxis().setNumberFormat ("0.0%") + + # Setting chart maximum, minimum values + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMajorUnit() + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMaxValue() + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinorUnit() + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinValue() + + chart.getAxes().getSecondaryVerticalAxis().setMaxValue(20) + chart.getAxes().getSecondaryVerticalAxis().setMinValue(-5) + chart.getAxes().getSecondaryVerticalAxis().setMinorUnit(0.5) + chart.getAxes().getSecondaryVerticalAxis().setMajorUnit(2.0) + + + # Setting chart back wall color + chart.getBackWall().setThickness(1) + chart.getBackWall().getFormat().getFill().setFillType(fillType.Solid) + chart.getBackWall().getFormat().getFill().getSolidFillColor().setColor(color.ORANGE) + + chart.getFloor().getFormat().getFill().setFillType(fillType.Solid) + chart.getFloor().getFormat().getFill().getSolidFillColor().setColor(color.RED) + + # Setting Plot area color + chart.getPlotArea().getFormat().getFill().setFillType(fillType.Solid) + chart.getPlotArea().getFormat().getFill().getSolidFillColor().setColor(Color(presetColor.LightCyan)) + + # Save Presentation + save_format = SaveFormat + pres.save(dataDir + "FormattedChart.pptx", save_format.Pptx) + + print "Formatted chart entities, please check the output file." + +if __name__ == '__main__': FormattingChartEntities() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetLabelDistance.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetLabelDistance.py index ae3271e3..ce353c64 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetLabelDistance.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetLabelDistance.py @@ -1,32 +1,32 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat - -class SetLabelDistance: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithCharts/SetLabelDistance/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Access first slide - sld = pres.getSlides().get_Item(0) - - # Adding a chart on slide - chartType=ChartType - ch = sld.getShapes().addChart(chartType.ClusteredColumn, 20, 20, 500, 300) - - # Setting the position of label from axis - ch.getAxes().getHorizontalAxis().setLabelOffset(500) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "Position.pptx", save_format.Pptx) - - print "Set label distance, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat + +class SetLabelDistance: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithCharts/SetLabelDistance/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Adding a chart on slide + chartType=ChartType + ch = sld.getShapes().addChart(chartType.ClusteredColumn, 20, 20, 500, 300) + + # Setting the position of label from axis + ch.getAxes().getHorizontalAxis().setLabelOffset(500) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "Position.pptx", save_format.Pptx) + + print "Set label distance, please check the output file." + +if __name__ == '__main__': SetLabelDistance() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetPieChartColors.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetPieChartColors.py index 875b5601..871a930b 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetPieChartColors.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetPieChartColors.py @@ -1,132 +1,132 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat -from com.aspose.slides import NullableBool -from com.aspose.slides import FillType -from com.aspose.slides import LineStyle -from java.awt import Color -from com.aspose.slides import LineDashStyle -from com.aspose.slides import PresetColor - -class SetPieChartColors: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithCharts/SetPieChartColors/' - - pres = Presentation() - - # Access first slide - sld = pres.getSlides().get_Item(0) - - # Add chart with default data - chart_type = ChartType - chart = sld.getShapes().addChart(chart_type.Pie, 100, 100, 400, 400) - - nullableBool=NullableBool - - # Setting chart Title - chart.getChartTitle().addTextFrameForOverriding("Sample Title") - chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(nullableBool.True) - chart.getChartTitle().setHeight(20) - chart.hasTitle() - - # Set first series to Show Values - chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(True) - - # Setting the index of chart data sheet - defaultWorksheetIndex = 0 - - # Getting the chart data worksheet - fact = chart.getChartData().getChartDataWorkbook() - - # Delete default generated series and categories - chart.getChartData().getSeries().clear() - chart.getChartData().getCategories().clear() - - # Adding categories - chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "First Qtr")) - chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "2nd Qtr")) - chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "3rd Qtr")) - - # Adding series - series = chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()) - - # Now populating series data - series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)) - series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)) - series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)) - - # Not working in version - # Adding points and setting sector color - chart.getChartData().getSeriesGroups().get_Item(0).isColorVaried() - - fill_type = FillType - line_style = LineStyle - color = Color - line_dash_style = LineDashStyle - preset_color = PresetColor - - point = series.getDataPoints().get_Item(0) - point.getFormat().getFill().setFillType(fill_type.Solid) - point.getFormat().getFill().getSolidFillColor().setColor(color.CYAN) - - # Setting Sector border - point.getFormat().getLine().getFillFormat().setFillType(fill_type.Solid) - point.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.GRAY) - point.getFormat().getLine().setWidth(3.0) - point.getFormat().getLine().setStyle(line_style.ThinThick) - point.getFormat().getLine().setDashStyle(line_dash_style.DashDot) - - - point1 = series.getDataPoints().get_Item(1) - point1.getFormat().getFill().setFillType(fill_type.Solid) - point1.getFormat().getFill().getSolidFillColor().setColor(Color(preset_color.Brown)) - - # Setting Sector border - point1.getFormat().getLine().getFillFormat().setFillType(fill_type.Solid) - point1.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.BLUE) - point1.getFormat().getLine().setWidth(3.0) - point1.getFormat().getLine().setStyle(line_style.Single) - point1.getFormat().getLine().setDashStyle(line_dash_style.LargeDashDot) - - point2 = series.getDataPoints().get_Item(2) - point2.getFormat().getFill().setFillType(fill_type.Solid) - point2.getFormat().getFill().getSolidFillColor().setColor(Color(preset_color.Coral)) - - # Setting Sector border - point2.getFormat().getLine().getFillFormat().setFillType(fill_type.Solid) - point2.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.RED) - point2.getFormat().getLine().setWidth(2.0) - point2.getFormat().getLine().setStyle(line_style.ThinThin) - point2.getFormat().getLine().setDashStyle(line_dash_style.LargeDashDotDot) - - # Create custom labels for each of categories for series - lbl1 = series.getDataPoints().get_Item(0).getLabel() - - lbl1.getDataLabelFormat().setShowValue(True) - - lbl2 = series.getDataPoints().get_Item(1).getLabel() - lbl2.getDataLabelFormat().setShowValue (True) - lbl2.getDataLabelFormat().setShowLegendKey(True) - lbl2.getDataLabelFormat().setShowPercentage(True) - - lbl3 = series.getDataPoints().get_Item(2).getLabel() - lbl3.getDataLabelFormat().setShowSeriesName(True) - lbl3.getDataLabelFormat().setShowPercentage (True) - - # Showing Leader Lines for Chart - series.getLabels().getDefaultDataLabelFormat().setShowLeaderLines(True) - - # Setting Rotation Angle for Pie Chart Sectors - chart.getChartData().getSeriesGroups().get_Item(0).setFirstSliceAngle(180) - - # Save presentation with chart - save_format = SaveFormat - pres.save(dataDir + "AsposePieChart.pptx", save_format.Pptx) - - print "Set pie chart sector colors, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat +from com.aspose.slides import NullableBool +from com.aspose.slides import FillType +from com.aspose.slides import LineStyle +from java.awt import Color +from com.aspose.slides import LineDashStyle +from com.aspose.slides import PresetColor + +class SetPieChartColors: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithCharts/SetPieChartColors/' + + pres = Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + chart_type = ChartType + chart = sld.getShapes().addChart(chart_type.Pie, 100, 100, 400, 400) + + nullableBool=NullableBool + + # Setting chart Title + chart.getChartTitle().addTextFrameForOverriding("Sample Title") + chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(nullableBool.True) + chart.getChartTitle().setHeight(20) + chart.hasTitle() + + # Set first series to Show Values + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(True) + + # Setting the index of chart data sheet + defaultWorksheetIndex = 0 + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete default generated series and categories + chart.getChartData().getSeries().clear() + chart.getChartData().getCategories().clear() + + # Adding categories + chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "First Qtr")) + chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "2nd Qtr")) + chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "3rd Qtr")) + + # Adding series + series = chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()) + + # Now populating series data + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)) + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)) + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)) + + # Not working in version + # Adding points and setting sector color + chart.getChartData().getSeriesGroups().get_Item(0).isColorVaried() + + fill_type = FillType + line_style = LineStyle + color = Color + line_dash_style = LineDashStyle + preset_color = PresetColor + + point = series.getDataPoints().get_Item(0) + point.getFormat().getFill().setFillType(fill_type.Solid) + point.getFormat().getFill().getSolidFillColor().setColor(color.CYAN) + + # Setting Sector border + point.getFormat().getLine().getFillFormat().setFillType(fill_type.Solid) + point.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.GRAY) + point.getFormat().getLine().setWidth(3.0) + point.getFormat().getLine().setStyle(line_style.ThinThick) + point.getFormat().getLine().setDashStyle(line_dash_style.DashDot) + + + point1 = series.getDataPoints().get_Item(1) + point1.getFormat().getFill().setFillType(fill_type.Solid) + point1.getFormat().getFill().getSolidFillColor().setColor(Color(preset_color.Brown)) + + # Setting Sector border + point1.getFormat().getLine().getFillFormat().setFillType(fill_type.Solid) + point1.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.BLUE) + point1.getFormat().getLine().setWidth(3.0) + point1.getFormat().getLine().setStyle(line_style.Single) + point1.getFormat().getLine().setDashStyle(line_dash_style.LargeDashDot) + + point2 = series.getDataPoints().get_Item(2) + point2.getFormat().getFill().setFillType(fill_type.Solid) + point2.getFormat().getFill().getSolidFillColor().setColor(Color(preset_color.Coral)) + + # Setting Sector border + point2.getFormat().getLine().getFillFormat().setFillType(fill_type.Solid) + point2.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.RED) + point2.getFormat().getLine().setWidth(2.0) + point2.getFormat().getLine().setStyle(line_style.ThinThin) + point2.getFormat().getLine().setDashStyle(line_dash_style.LargeDashDotDot) + + # Create custom labels for each of categories for series + lbl1 = series.getDataPoints().get_Item(0).getLabel() + + lbl1.getDataLabelFormat().setShowValue(True) + + lbl2 = series.getDataPoints().get_Item(1).getLabel() + lbl2.getDataLabelFormat().setShowValue (True) + lbl2.getDataLabelFormat().setShowLegendKey(True) + lbl2.getDataLabelFormat().setShowPercentage(True) + + lbl3 = series.getDataPoints().get_Item(2).getLabel() + lbl3.getDataLabelFormat().setShowSeriesName(True) + lbl3.getDataLabelFormat().setShowPercentage (True) + + # Showing Leader Lines for Chart + series.getLabels().getDefaultDataLabelFormat().setShowLeaderLines(True) + + # Setting Rotation Angle for Pie Chart Sectors + chart.getChartData().getSeriesGroups().get_Item(0).setFirstSliceAngle(180) + + # Save presentation with chart + save_format = SaveFormat + pres.save(dataDir + "AsposePieChart.pptx", save_format.Pptx) + + print "Set pie chart sector colors, please check the output file." + +if __name__ == '__main__': SetPieChartColors() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToHtml.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToHtml.py index 2e9c0ab0..40a857bc 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToHtml.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToHtml.py @@ -1,30 +1,30 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import HtmlOptions -from com.aspose.slides import SaveFormat -from com.aspose.slides import HtmlFormatter - -class ConvertingToHtml: - - def __init__(self): - - self.convert_to_html() - - def convert_to_html(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToHtml/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - html_opt = HtmlOptions() - html_formatter = HtmlFormatter - html_opt.setHtmlFormatter(html_formatter.createDocumentFormatter("",False)) - - # Saving the presentation to HTML format - save_format = SaveFormat - pres.save(dataDir + "Aspose.html", save_format.Html, html_opt) - - print "Document has been converted, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import HtmlOptions +from com.aspose.slides import SaveFormat +from com.aspose.slides import HtmlFormatter + +class ConvertingToHtml: + + def __init__(self): + + self.convert_to_html() + + def convert_to_html(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToHtml/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + html_opt = HtmlOptions() + html_formatter = HtmlFormatter + html_opt.setHtmlFormatter(html_formatter.createDocumentFormatter("",False)) + + # Saving the presentation to HTML format + save_format = SaveFormat + pres.save(dataDir + "Aspose.html", save_format.Html, html_opt) + + print "Document has been converted, please check the output file." + +if __name__ == '__main__': ConvertingToHtml() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToNotes.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToNotes.py index 9192d8b6..968eeec2 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToNotes.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToNotes.py @@ -1,43 +1,43 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class ConvertingToNotes: - - def __init__(self): - - # Converting Presentation to TIFF Notes - self.convert_to_tiff_notes() - - # Converting Presentation to TIFF Notes - self.convert_to_pdf_notes() - - def convert_to_tiff_notes(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToNotes/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "Notes.tiff", save_format.TiffNotes) - - print "Document has been converted, please check the output file." - - def convert_to_pdf_notes(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToNotes/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "Notes.pdf", save_format.pdf) - - print "Document has been converted, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class ConvertingToNotes: + + def __init__(self): + + # Converting Presentation to TIFF Notes + self.convert_to_tiff_notes() + + # Converting Presentation to TIFF Notes + self.convert_to_pdf_notes() + + def convert_to_tiff_notes(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToNotes/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "Notes.tiff", save_format.TiffNotes) + + print "Document has been converted, please check the output file." + + def convert_to_pdf_notes(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToNotes/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "Notes.pdf", save_format.pdf) + + print "Document has been converted, please check the output file." + + +if __name__ == '__main__': ConvertingToNotes() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToPdf.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToPdf.py index 71231082..c87ee664 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToPdf.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToPdf.py @@ -1,22 +1,22 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class ConvertingToPdf: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToPdf/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Saving the PPTX presentation to Pdf format - save_format = SaveFormat - pres.save(dataDir + "Aspose.pdf", save_format.Pdf) - - print "Document has been converted, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class ConvertingToPdf: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToPdf/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Saving the PPTX presentation to Pdf format + save_format = SaveFormat + pres.save(dataDir + "Aspose.pdf", save_format.Pdf) + + print "Document has been converted, please check the output file." + + +if __name__ == '__main__': ConvertingToPdf() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToTiff.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToTiff.py index c26510a0..d0f65507 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToTiff.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToTiff.py @@ -1,62 +1,62 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import TiffOptions -from com.aspose.slides import TiffCompressionTypes -from java.awt import Dimension - -class ConvertingToTiff: - - def __init__(self): - - # Converting Presentation to TIFF with default size - self.convert_with_default_size() - - # Converting Presentation to TIFF with custom size - self.convert_with_custom_size() - - - def convert_with_default_size(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToTiff/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Saving the PPTX presentation to Tiff format - save_format = SaveFormat - pres.save(dataDir + "Aspose.tiff", save_format.Tiff) - - print "Document has been converted, please check the output file." - - def convert_with_custom_size(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToTiff/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Instantiate the TiffOptions class - opts = TiffOptions - - # Setting compression type - tiff_compression_types = TiffCompressionTypes - opts.setCompressionType (tiff_compression_types.Default) - - #Setting image DPI - opts.setDpiX(200) - opts.setDpiY(100) - - # Set Image Size - opts.setImageSize(Dimension(1728, 1078)) - - # Save the presentation to TIFF with specified image size - save_format = SaveFormat - pres.save(dataDir + "Aspose-Custom-Size.tiff", save_format.Tiff,opts) - - print "Document has been converted, please check the output file." - - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import TiffOptions +from com.aspose.slides import TiffCompressionTypes +from java.awt import Dimension + +class ConvertingToTiff: + + def __init__(self): + + # Converting Presentation to TIFF with default size + self.convert_with_default_size() + + # Converting Presentation to TIFF with custom size + self.convert_with_custom_size() + + + def convert_with_default_size(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToTiff/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Saving the PPTX presentation to Tiff format + save_format = SaveFormat + pres.save(dataDir + "Aspose.tiff", save_format.Tiff) + + print "Document has been converted, please check the output file." + + def convert_with_custom_size(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToTiff/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Instantiate the TiffOptions class + opts = TiffOptions + + # Setting compression type + tiff_compression_types = TiffCompressionTypes + opts.setCompressionType (tiff_compression_types.Default) + + #Setting image DPI + opts.setDpiX(200) + opts.setDpiY(100) + + # Set Image Size + opts.setImageSize(Dimension(1728, 1078)) + + # Save the presentation to TIFF with specified image size + save_format = SaveFormat + pres.save(dataDir + "Aspose-Custom-Size.tiff", save_format.Tiff,opts) + + print "Document has been converted, please check the output file." + + + +if __name__ == '__main__': ConvertingToTiff() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToXps.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToXps.py index 3636f4c4..9d576f73 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToXps.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToXps.py @@ -1,50 +1,50 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import XpsOptions - -class ConvertingToXps: - - def __init__(self): - - # Converting Presentation to TIFF with default size - self.convert_with_default_size() - - # Converting Presentation to TIFF with custom size - self.convert_with_custom_size() - - def convert_with_default_size(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToXps/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Saving the presentation to XPS format - save_format = SaveFormat - pres.save(dataDir + "Aspose.xps", save_format.Xps) - - print "Document has been converted, please check the output file." - - def convert_with_custom_size(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToXps/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Instantiate the TiffOptions class - opts = XpsOptions - - # Save MetaFiles as PNG - opts.SaveMetafilesAsPng = True - - # Save the presentation to TIFF with specified image size - save_format = SaveFormat - pres.save(dataDir + "Aspose-Custom-Size.xps", save_format.Xps, opts) - - print "Document has been converted, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import XpsOptions + +class ConvertingToXps: + + def __init__(self): + + # Converting Presentation to TIFF with default size + self.convert_with_default_size() + + # Converting Presentation to TIFF with custom size + self.convert_with_custom_size() + + def convert_with_default_size(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToXps/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Saving the presentation to XPS format + save_format = SaveFormat + pres.save(dataDir + "Aspose.xps", save_format.Xps) + + print "Document has been converted, please check the output file." + + def convert_with_custom_size(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToXps/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Instantiate the TiffOptions class + opts = XpsOptions + + # Save MetaFiles as PNG + opts.SaveMetafilesAsPng = True + + # Save the presentation to TIFF with specified image size + save_format = SaveFormat + pres.save(dataDir + "Aspose-Custom-Size.xps", save_format.Xps, opts) + + print "Document has been converted, please check the output file." + + +if __name__ == '__main__': ConvertingToXps() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/OdpToPptx.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/OdpToPptx.py index 97d40eae..24fed1d6 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/OdpToPptx.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/OdpToPptx.py @@ -1,24 +1,24 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import XpsOptions - -class OdpToPptx: - - def __init__(self): - - - dataDir = Settings.dataDir + 'WorkingWithPresentation/OdpToPptx/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Source.odp") - - # Saving the PPTX presentation to PPTX format - save_format = SaveFormat - pres.save(dataDir + "Source.pptx", save_format.Pptx) - - print "Document has been converted, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import XpsOptions + +class OdpToPptx: + + def __init__(self): + + + dataDir = Settings.dataDir + 'WorkingWithPresentation/OdpToPptx/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Source.odp") + + # Saving the PPTX presentation to PPTX format + save_format = SaveFormat + pres.save(dataDir + "Source.pptx", save_format.Pptx) + + print "Document has been converted, please check the output file." + + +if __name__ == '__main__': OdpToPptx() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/PptToPptx.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/PptToPptx.py index 6acdf201..1e423738 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/PptToPptx.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/PptToPptx.py @@ -1,24 +1,24 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import XpsOptions - -class PptToPptx: - - def __init__(self): - - - dataDir = Settings.dataDir + 'WorkingWithPresentation/PptToPptx/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Presentation1.ppt") - - # Saving the PPTX presentation to PPTX format - save_format = SaveFormat - pres.save(dataDir + "Aspose.pptx", save_format.Pptx) - - print "Document has been converted, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import XpsOptions + +class PptToPptx: + + def __init__(self): + + + dataDir = Settings.dataDir + 'WorkingWithPresentation/PptToPptx/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Presentation1.ppt") + + # Saving the PPTX presentation to PPTX format + save_format = SaveFormat + pres.save(dataDir + "Aspose.pptx", save_format.Pptx) + + print "Document has been converted, please check the output file." + + +if __name__ == '__main__': PptToPptx() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Properties.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Properties.py index 85610081..29613a34 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Properties.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Properties.py @@ -1,124 +1,124 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import XpsOptions - -class Properties: - - def __init__(self): - - - # Accessing Built-in Properties - self.get_properties() - - # Modifying Built-in Properties - self.update_properties() - - # Adding Custom Document Properties - self.add_custom_properties() - - # Removing Document Properties - self.remove_property() - - def get_properties(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' - - # Instantiate the Presentation class that represents the presentation - pres = Presentation(dataDir + "HelloWorld.pptx") - - # Create a reference to IDocumentProperties object associated with Presentation - dp = pres.getDocumentProperties() - - # Display the builtin properties - print "Category : " + dp.getCategory() - print "Current Status : " + dp.getContentStatus() - print "Creation Date : " - dp.getCreatedTime() - print "Author : " + dp.getAuthor() - print "Description : " + dp.getComments() - print "KeyWords : " + dp.getKeywords() - print "Last Modified By : " + dp.getLastSavedBy() - print "Supervisor : " + dp.getManager() - print "Modified Date : " - dp.getLastSavedTime() - print "Presentation Format : " - dp.getPresentationFormat() - print "Last Print Date : " - dp.getLastPrinted() - print "Is Shared between producers : " - dp.getSharedDoc() - print "Subject : " - dp.getSubject() - print "Title : " - dp.getTitle() - - def update_properties(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' - - # Instantiate the Presentation class that represents the presentation - pres = Presentation(dataDir + "HelloWorld.pptx") - - # Create a reference to IDocumentProperties object associated with Presentation - dp = pres.getDocumentProperties() - - # Set the builtin properties - dp.setAuthor ("Aspose.Slides for Java") - dp.setTitle ("Modifying Presentation Properties") - dp.setSubject ( "Aspose Subject") - dp.setComments ( "Aspose Description") - dp.setManager ( "Aspose Manager") - - # Save your presentation to a file - save_format = SaveFormat - pres.save(dataDir + "DocProps.pptx", save_format.Pptx) - - print "Properties have been updated, Please check output file." - - def add_custom_properties(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' - - #Instantiate the Presentation class that represents the presentation - pres = Presentation(dataDir + "HelloWorld.pptx") - - # Getting Document Properties - dp = pres.getDocumentProperties() - - # Adding Custom properties - dp.set_Item("New Custom" , 12) - dp.set_Item("My Name","Mudassir") - dp.set_Item("Custom", 124) - - # Saving presentation - save_format = SaveFormat - pres.save(dataDir + "CustomDemo.pptx", save_format.Pptx) - - print "Added custom properties, please check output file." - - - def remove_property(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' - - # Instantiate the Presentation class that represents the presentation - pres = Presentation(dataDir + "HelloWorld.pptx") - - # Getting Document Properties - dp = pres.getDocumentProperties() - - # Getting property name at particular index - property_name = dp.getPropertyName(2) - - # Removing selected property - dp.remove(property_name) - - # Saving presentation - save_format = SaveFormat - pres.save(dataDir + "RemoveDP.pptx", save_format.Pptx) - - print "Remove document property, please check output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import XpsOptions + +class Properties: + + def __init__(self): + + + # Accessing Built-in Properties + self.get_properties() + + # Modifying Built-in Properties + self.update_properties() + + # Adding Custom Document Properties + self.add_custom_properties() + + # Removing Document Properties + self.remove_property() + + def get_properties(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' + + # Instantiate the Presentation class that represents the presentation + pres = Presentation(dataDir + "HelloWorld.pptx") + + # Create a reference to IDocumentProperties object associated with Presentation + dp = pres.getDocumentProperties() + + # Display the builtin properties + print "Category : " + dp.getCategory() + print "Current Status : " + dp.getContentStatus() + print "Creation Date : " + dp.getCreatedTime() + print "Author : " + dp.getAuthor() + print "Description : " + dp.getComments() + print "KeyWords : " + dp.getKeywords() + print "Last Modified By : " + dp.getLastSavedBy() + print "Supervisor : " + dp.getManager() + print "Modified Date : " + dp.getLastSavedTime() + print "Presentation Format : " + dp.getPresentationFormat() + print "Last Print Date : " + dp.getLastPrinted() + print "Is Shared between producers : " + dp.getSharedDoc() + print "Subject : " + dp.getSubject() + print "Title : " + dp.getTitle() + + def update_properties(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' + + # Instantiate the Presentation class that represents the presentation + pres = Presentation(dataDir + "HelloWorld.pptx") + + # Create a reference to IDocumentProperties object associated with Presentation + dp = pres.getDocumentProperties() + + # Set the builtin properties + dp.setAuthor ("Aspose.Slides for Java") + dp.setTitle ("Modifying Presentation Properties") + dp.setSubject ( "Aspose Subject") + dp.setComments ( "Aspose Description") + dp.setManager ( "Aspose Manager") + + # Save your presentation to a file + save_format = SaveFormat + pres.save(dataDir + "DocProps.pptx", save_format.Pptx) + + print "Properties have been updated, Please check output file." + + def add_custom_properties(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' + + #Instantiate the Presentation class that represents the presentation + pres = Presentation(dataDir + "HelloWorld.pptx") + + # Getting Document Properties + dp = pres.getDocumentProperties() + + # Adding Custom properties + dp.set_Item("New Custom" , 12) + dp.set_Item("My Name","Mudassir") + dp.set_Item("Custom", 124) + + # Saving presentation + save_format = SaveFormat + pres.save(dataDir + "CustomDemo.pptx", save_format.Pptx) + + print "Added custom properties, please check output file." + + + def remove_property(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' + + # Instantiate the Presentation class that represents the presentation + pres = Presentation(dataDir + "HelloWorld.pptx") + + # Getting Document Properties + dp = pres.getDocumentProperties() + + # Getting property name at particular index + property_name = dp.getPropertyName(2) + + # Removing selected property + dp.remove(property_name) + + # Saving presentation + save_format = SaveFormat + pres.save(dataDir + "RemoveDP.pptx", save_format.Pptx) + + print "Remove document property, please check output file." + +if __name__ == '__main__': Properties() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Zoom.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Zoom.py index fdfa8c11..8f751c06 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Zoom.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Zoom.py @@ -1,26 +1,26 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import XpsOptions - -class Zoom: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/Zoom/' - - # Create an instance of Presentation class - pres = Presentation() - - # Setting View Properties of Presentation - pres.getViewProperties().getSlideViewProperties().setScale(50) # zoom value in percentages for slide view - pres.getViewProperties().getNotesViewProperties().setScale(50) # .Scale = 50 //zoom value in percentages for notes view - - # Save the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "Zoom.pptx", save_format.Pptx) - - print "Set zoom value, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import XpsOptions + +class Zoom: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/Zoom/' + + # Create an instance of Presentation class + pres = Presentation() + + # Setting View Properties of Presentation + pres.getViewProperties().getSlideViewProperties().setScale(50) # zoom value in percentages for slide view + pres.getViewProperties().getNotesViewProperties().setScale(50) # .Scale = 50 //zoom value in percentages for notes view + + # Save the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "Zoom.pptx", save_format.Pptx) + + print "Set zoom value, please check the output file." + +if __name__ == '__main__': Zoom() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/AddingLineShape.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/AddingLineShape.py index 671123b5..efafe8f4 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/AddingLineShape.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/AddingLineShape.py @@ -1,88 +1,88 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import LineStyle -from com.aspose.slides import LineDashStyle -from com.aspose.slides import LineArrowheadLength -from com.aspose.slides import LineArrowheadStyle -from com.aspose.slides import PresetColor -from com.aspose.slides import FillType -from java.awt import Color - -class AddingLineShape: - - def __init__(self): - - # Adding Plain Line to Slide - self.add_plain_line() - - # Adding Arrow Shaped Line to Slide - self.add_arrow_line() - - def add_plain_line(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/AddingLineShape/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add an autoshape of type line - shapeType = ShapeType - sld.getShapes().addAutoShape(shapeType.Line, 50, 150, 300, 0) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "LineShape.pptx", save_format.Pptx) - - print "Added plain line to slide, please check the output file." - - def add_arrow_line(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/AddingLineShape/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add an autoshape of type line - shapeType = ShapeType - shp = sld.getShapes().addAutoShape(shapeType.Line, 50, 150, 300, 0) - - # Apply some formatting on the line - lineStyle = LineStyle - shp.getLineFormat().setStyle(lineStyle.ThickBetweenThin) - shp.getLineFormat().setWidth(10) - - lineDashStyle = LineDashStyle - shp.getLineFormat().setDashStyle(lineDashStyle.DashDot) - - lineArrowheadLength = LineArrowheadLength - lineArrowheadStyle = LineArrowheadStyle - fillType = FillType - color = Color - presetColor = PresetColor - - shp.getLineFormat().setBeginArrowheadLength(lineArrowheadLength.Short) - shp.getLineFormat().setBeginArrowheadStyle(lineArrowheadStyle.Oval) - - shp.getLineFormat().setEndArrowheadLength(lineArrowheadLength.Long) - shp.getLineFormat().setEndArrowheadStyle(lineArrowheadStyle.Triangle) - - shp.getLineFormat().getFillFormat().setFillType(fillType.Solid) - shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color(presetColor.Maroon)) - - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "ArrowShape.pptx", save_format.Pptx) - - print "Added arrow shape line to slide, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import LineStyle +from com.aspose.slides import LineDashStyle +from com.aspose.slides import LineArrowheadLength +from com.aspose.slides import LineArrowheadStyle +from com.aspose.slides import PresetColor +from com.aspose.slides import FillType +from java.awt import Color + +class AddingLineShape: + + def __init__(self): + + # Adding Plain Line to Slide + self.add_plain_line() + + # Adding Arrow Shaped Line to Slide + self.add_arrow_line() + + def add_plain_line(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/AddingLineShape/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add an autoshape of type line + shapeType = ShapeType + sld.getShapes().addAutoShape(shapeType.Line, 50, 150, 300, 0) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "LineShape.pptx", save_format.Pptx) + + print "Added plain line to slide, please check the output file." + + def add_arrow_line(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/AddingLineShape/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add an autoshape of type line + shapeType = ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Line, 50, 150, 300, 0) + + # Apply some formatting on the line + lineStyle = LineStyle + shp.getLineFormat().setStyle(lineStyle.ThickBetweenThin) + shp.getLineFormat().setWidth(10) + + lineDashStyle = LineDashStyle + shp.getLineFormat().setDashStyle(lineDashStyle.DashDot) + + lineArrowheadLength = LineArrowheadLength + lineArrowheadStyle = LineArrowheadStyle + fillType = FillType + color = Color + presetColor = PresetColor + + shp.getLineFormat().setBeginArrowheadLength(lineArrowheadLength.Short) + shp.getLineFormat().setBeginArrowheadStyle(lineArrowheadStyle.Oval) + + shp.getLineFormat().setEndArrowheadLength(lineArrowheadLength.Long) + shp.getLineFormat().setEndArrowheadStyle(lineArrowheadStyle.Triangle) + + shp.getLineFormat().getFillFormat().setFillType(fillType.Solid) + shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color(presetColor.Maroon)) + + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "ArrowShape.pptx", save_format.Pptx) + + print "Added arrow shape line to slide, please check the output file." + +if __name__ == '__main__': AddingLineShape() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FillingShapes.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FillingShapes.py index 7fa18c60..39807cde 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FillingShapes.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FillingShapes.py @@ -1,121 +1,121 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import PatternStyle -from com.aspose.slides import PictureFillMode -from java.awt import Color -from java.io import File -from java.io import FileInputStream - -class FillingShapes: - - def __init__(self): - - # Filling Shapes with Pattern - self.fill_shapes_with_pattern() - - # Filling Shapes with Picture - self.fill_shapes_with_picture() - - # Filling Shapes with Solid Color - self.fill_shapes_with_solid_color() - - def fill_shapes_with_pattern(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/FillingShapes/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType = ShapeType - shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) - - # Set the fill type to Pattern - fillType = FillType - shp.getFillFormat().setFillType(fillType.Pattern) - - # Set the pattern style - patternStyle = PatternStyle - shp.getFillFormat().getPatternFormat().setPatternStyle(patternStyle.Trellis) - - # Set the pattern back and fore colors - color = Color - shp.getFillFormat().getPatternFormat().getBackColor().setColor(color.LIGHT_GRAY) - shp.getFillFormat().getPatternFormat().getForeColor().setColor(color.YELLOW) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "RectShpPatt.pptx", save_format.Pptx) - - print "Filled shapes with Pattern, please check the output file." - - def fill_shapes_with_picture(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/FillingShapes/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType = ShapeType - shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) - - # Set the fill type to Picture - fillType = FillType - shp.getFillFormat().setFillType(fillType.Picture) - - # Set the picture fill mode - pictureFillMode = PictureFillMode - shp.getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Tile) - - # Set the picture - imgx = pres.getImages().addImage(FileInputStream(File(dataDir + "night.jpg"))) - - shp.getFillFormat().getPictureFillFormat().getPicture().setImage(imgx) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "RectShpPic.pptx", save_format.Pptx) - - print "Filled shapes with Picture, please check the output file." - - - def fill_shapes_with_solid_color(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/FillingShapes/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType = ShapeType - shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) - - # Set the fill type to Solid - fillType = FillType - shp.getFillFormat().setFillType(fillType.Solid) - - # Set the color of the rectangle - color = Color - shp.getFillFormat().getSolidFillColor().setColor(color.YELLOW) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "RectShpSolid.pptx", save_format.Pptx) - - print "Filled shapes with Solid Color, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import PatternStyle +from com.aspose.slides import PictureFillMode +from java.awt import Color +from java.io import File +from java.io import FileInputStream + +class FillingShapes: + + def __init__(self): + + # Filling Shapes with Pattern + self.fill_shapes_with_pattern() + + # Filling Shapes with Picture + self.fill_shapes_with_picture() + + # Filling Shapes with Solid Color + self.fill_shapes_with_solid_color() + + def fill_shapes_with_pattern(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/FillingShapes/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill type to Pattern + fillType = FillType + shp.getFillFormat().setFillType(fillType.Pattern) + + # Set the pattern style + patternStyle = PatternStyle + shp.getFillFormat().getPatternFormat().setPatternStyle(patternStyle.Trellis) + + # Set the pattern back and fore colors + color = Color + shp.getFillFormat().getPatternFormat().getBackColor().setColor(color.LIGHT_GRAY) + shp.getFillFormat().getPatternFormat().getForeColor().setColor(color.YELLOW) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "RectShpPatt.pptx", save_format.Pptx) + + print "Filled shapes with Pattern, please check the output file." + + def fill_shapes_with_picture(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/FillingShapes/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill type to Picture + fillType = FillType + shp.getFillFormat().setFillType(fillType.Picture) + + # Set the picture fill mode + pictureFillMode = PictureFillMode + shp.getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Tile) + + # Set the picture + imgx = pres.getImages().addImage(FileInputStream(File(dataDir + "night.jpg"))) + + shp.getFillFormat().getPictureFillFormat().getPicture().setImage(imgx) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "RectShpPic.pptx", save_format.Pptx) + + print "Filled shapes with Picture, please check the output file." + + + def fill_shapes_with_solid_color(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/FillingShapes/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill type to Solid + fillType = FillType + shp.getFillFormat().setFillType(fillType.Solid) + + # Set the color of the rectangle + color = Color + shp.getFillFormat().getSolidFillColor().setColor(color.YELLOW) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "RectShpSolid.pptx", save_format.Pptx) + + print "Filled shapes with Solid Color, please check the output file." + +if __name__ == '__main__': FillingShapes() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FindShape.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FindShape.py index 0377c897..c6bb5d95 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FindShape.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FindShape.py @@ -1,40 +1,40 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import XpsOptions - -class FindShape: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithShapes/FindShape/' - - # Create an instance of Presentation class - pres = Presentation(dataDir + 'demo.pptx') - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - shape = self.find_shape(slide) - - print "Shape: " . shape - - def find_shape(slide, alttext): - - #Iterating through all shapes inside the slide - - i = 0 - slide_size = slide.getShapes().size() - - while i < slide_size: - # If the alternative text of the slide matches with the required one then return the shape - if (slide.getShapes().get_Item(i).getAlternativeText() == alttext): - return slide.getShapes().get_Item(i) - - i+=1 - - return nil - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import XpsOptions + +class FindShape: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithShapes/FindShape/' + + # Create an instance of Presentation class + pres = Presentation(dataDir + 'demo.pptx') + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + shape = self.find_shape(slide) + + print "Shape: " . shape + + def find_shape(slide, alttext): + + #Iterating through all shapes inside the slide + + i = 0 + slide_size = slide.getShapes().size() + + while i < slide_size: + # If the alternative text of the slide matches with the required one then return the shape + if (slide.getShapes().get_Item(i).getAlternativeText() == alttext): + return slide.getShapes().get_Item(i) + + i+=1 + + return nil + + +if __name__ == '__main__': FindShape() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FormatLines.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FormatLines.py index 971f76d7..fe2ff780 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FormatLines.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FormatLines.py @@ -1,118 +1,118 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import LineStyle -from com.aspose.slides import LineDashStyle -from com.aspose.slides import LineJoinStyle - -from java.awt import Color - -class FormatLines: - - def __init__(self): - - # Formatting the Lines of Shapes - self.format_lines() - - # Formatting the Join Styles - self.format_join_styles() - - def format_lines(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/FormatLines/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType = ShapeType - shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) - - # Set the fill color of the rectangle shape - fillType = FillType - color = Color - shp.getFillFormat().setFillType(fillType.Solid) - shp.getFillFormat().getSolidFillColor().setColor(color.WHITE) - - # Apply some formatting on the line of the rectangle - - lineStyle = LineStyle - shp.getLineFormat().setStyle(lineStyle.ThickThin) - shp.getLineFormat().setWidth(7) - - lineDashStyle = LineDashStyle - shp.getLineFormat().setDashStyle(lineDashStyle.Dash) - - # set the color of the line of rectangle - shp.getLineFormat().getFillFormat().setFillType(fillType.Solid) - shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "RectShpLn.pptx", save_format.Pptx) - - print "Formatted lines, please check the output file." - - def format_join_styles(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/FormatLines/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add three autoshapes of rectangle type - shape_type = ShapeType - shp1 = sld.getShapes().addAutoShape(shape_type.Rectangle, 50, 100, 150, 75) - shp2 = sld.getShapes().addAutoShape(shape_type.Rectangle, 300, 100, 150, 75) - shp3 = sld.getShapes().addAutoShape(shape_type.Rectangle, 50, 250, 150, 75) - - # Set the fill color of the rectangle shape - fill_type = FillType - color = Color - shp1.getFillFormat().setFillType(fill_type.Solid) - shp1.getFillFormat().getSolidFillColor().setColor(color.BLACK) - shp2.getFillFormat().setFillType(fill_type.Solid) - shp2.getFillFormat().getSolidFillColor().setColor(color.BLACK) - shp3.getFillFormat().setFillType(fill_type.Solid) - shp3.getFillFormat().getSolidFillColor().setColor(color.BLACK) - - # Set the line width - shp1.getLineFormat().setWidth(15) - shp2.getLineFormat().setWidth(15) - shp3.getLineFormat().setWidth (15) - - # Set the color of the line of rectangle - shp1.getLineFormat().getFillFormat().setFillType(fill_type.Solid) - shp1.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) - shp2.getLineFormat().getFillFormat().setFillType(fill_type.Solid) - shp2.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) - shp3.getLineFormat().getFillFormat().setFillType(fill_type.Solid) - shp3.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) - - # Set the Join Style - line_join_style = LineJoinStyle - shp1.getLineFormat().setJoinStyle(line_join_style.Miter) - shp2.getLineFormat().setJoinStyle(line_join_style.Bevel) - shp3.getLineFormat().setJoinStyle(line_join_style.Round) - - # Add text to each rectangle - shp1.getTextFrame().setText ("This is Miter Join Style") - shp2.getTextFrame().setText( "This is Bevel Join Style") - shp3.getTextFrame().setText ("This is Round Join Style") - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "RectShpLnJoin.pptx", save_format.Pptx) - - print "Formatted join styles, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import LineStyle +from com.aspose.slides import LineDashStyle +from com.aspose.slides import LineJoinStyle + +from java.awt import Color + +class FormatLines: + + def __init__(self): + + # Formatting the Lines of Shapes + self.format_lines() + + # Formatting the Join Styles + self.format_join_styles() + + def format_lines(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/FormatLines/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill color of the rectangle shape + fillType = FillType + color = Color + shp.getFillFormat().setFillType(fillType.Solid) + shp.getFillFormat().getSolidFillColor().setColor(color.WHITE) + + # Apply some formatting on the line of the rectangle + + lineStyle = LineStyle + shp.getLineFormat().setStyle(lineStyle.ThickThin) + shp.getLineFormat().setWidth(7) + + lineDashStyle = LineDashStyle + shp.getLineFormat().setDashStyle(lineDashStyle.Dash) + + # set the color of the line of rectangle + shp.getLineFormat().getFillFormat().setFillType(fillType.Solid) + shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "RectShpLn.pptx", save_format.Pptx) + + print "Formatted lines, please check the output file." + + def format_join_styles(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/FormatLines/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add three autoshapes of rectangle type + shape_type = ShapeType + shp1 = sld.getShapes().addAutoShape(shape_type.Rectangle, 50, 100, 150, 75) + shp2 = sld.getShapes().addAutoShape(shape_type.Rectangle, 300, 100, 150, 75) + shp3 = sld.getShapes().addAutoShape(shape_type.Rectangle, 50, 250, 150, 75) + + # Set the fill color of the rectangle shape + fill_type = FillType + color = Color + shp1.getFillFormat().setFillType(fill_type.Solid) + shp1.getFillFormat().getSolidFillColor().setColor(color.BLACK) + shp2.getFillFormat().setFillType(fill_type.Solid) + shp2.getFillFormat().getSolidFillColor().setColor(color.BLACK) + shp3.getFillFormat().setFillType(fill_type.Solid) + shp3.getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Set the line width + shp1.getLineFormat().setWidth(15) + shp2.getLineFormat().setWidth(15) + shp3.getLineFormat().setWidth (15) + + # Set the color of the line of rectangle + shp1.getLineFormat().getFillFormat().setFillType(fill_type.Solid) + shp1.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + shp2.getLineFormat().getFillFormat().setFillType(fill_type.Solid) + shp2.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + shp3.getLineFormat().getFillFormat().setFillType(fill_type.Solid) + shp3.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + + # Set the Join Style + line_join_style = LineJoinStyle + shp1.getLineFormat().setJoinStyle(line_join_style.Miter) + shp2.getLineFormat().setJoinStyle(line_join_style.Bevel) + shp3.getLineFormat().setJoinStyle(line_join_style.Round) + + # Add text to each rectangle + shp1.getTextFrame().setText ("This is Miter Join Style") + shp2.getTextFrame().setText( "This is Bevel Join Style") + shp3.getTextFrame().setText ("This is Round Join Style") + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "RectShpLnJoin.pptx", save_format.Pptx) + + print "Formatted join styles, please check the output file." + +if __name__ == '__main__': FormatLines() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/Frame.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/Frame.py index 3c6b7461..0e1efe28 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/Frame.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/Frame.py @@ -1,106 +1,106 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import AudioPlayModePreset -from com.aspose.slides import AudioVolumeMode -from com.aspose.slides import VideoPlayModePreset - -from java.io import FileInputStream -from java.io import File - -class Frame: - - def __init__(self): - - # Formatting the Lines of Shapes - self.add_picture_frame() - - # Formatting the Join Styles - self.add_audio_frame() - - # Adding Audio Frame to Slide - self.add_audio_frame() - - self.add_video_frame() - - def add_picture_frame(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/Frame/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sId = pres.getSlides().get_Item(0) - - # Instantiate the Image class - imgx = pres.getImages().addImage(FileInputStream(File(dataDir + "aspose-logo.jpg"))) - - # Add Picture Frame with height and width equivalent of Picture - shapeType = ShapeType - sId.getShapes().addPictureFrame(shapeType.Rectangle, 50, 150, imgx.getWidth(), imgx.getHeight(), imgx) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "RectPicFrame.pptx", save_format.Pptx) - - print "Added picture frame to slide, please check the output file." - - def add_audio_frame(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/Frame/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sId = pres.getSlides().get_Item(0) - - # Load the wav sound file to stram - fstr = FileInputStream(File(dataDir + "Bass-Drum.wav")) - - # Add Audio Frame - af = sId.getShapes().addAudioFrameEmbedded(50, 150, 100, 100, fstr) - - # Set Play Mode and Volume of the Audio - audioPlayModePreset = AudioPlayModePreset - audioVolumeMode = AudioVolumeMode - af.setPlayMode(audioPlayModePreset.Auto) - af.setVolume(audioVolumeMode.Loud) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "AudioFrameEmbed.pptx", save_format.Pptx) - - print "Added audio frame to slide, please check the output file." - - def add_video_frame(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/Frame/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sId = pres.getSlides().get_Item(0) - - # Add Video Frame - vf = sId.getShapes().addVideoFrame(50, 150, 300, 150, dataDir + "Wildlife.mp4") - - # Set Play Mode and Volume of the Video - videoPlayModePreset = VideoPlayModePreset - audioVolumeMode = AudioVolumeMode - - vf.setPlayMode(videoPlayModePreset.Auto) - vf.setVolume(audioVolumeMode.Loud) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "VideoFrame.pptx", save_format.Pptx) - - print "Added video frame to slide, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import AudioPlayModePreset +from com.aspose.slides import AudioVolumeMode +from com.aspose.slides import VideoPlayModePreset + +from java.io import FileInputStream +from java.io import File + +class Frame: + + def __init__(self): + + # Formatting the Lines of Shapes + self.add_picture_frame() + + # Formatting the Join Styles + self.add_audio_frame() + + # Adding Audio Frame to Slide + self.add_audio_frame() + + self.add_video_frame() + + def add_picture_frame(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/Frame/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sId = pres.getSlides().get_Item(0) + + # Instantiate the Image class + imgx = pres.getImages().addImage(FileInputStream(File(dataDir + "aspose-logo.jpg"))) + + # Add Picture Frame with height and width equivalent of Picture + shapeType = ShapeType + sId.getShapes().addPictureFrame(shapeType.Rectangle, 50, 150, imgx.getWidth(), imgx.getHeight(), imgx) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "RectPicFrame.pptx", save_format.Pptx) + + print "Added picture frame to slide, please check the output file." + + def add_audio_frame(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/Frame/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sId = pres.getSlides().get_Item(0) + + # Load the wav sound file to stram + fstr = FileInputStream(File(dataDir + "Bass-Drum.wav")) + + # Add Audio Frame + af = sId.getShapes().addAudioFrameEmbedded(50, 150, 100, 100, fstr) + + # Set Play Mode and Volume of the Audio + audioPlayModePreset = AudioPlayModePreset + audioVolumeMode = AudioVolumeMode + af.setPlayMode(audioPlayModePreset.Auto) + af.setVolume(audioVolumeMode.Loud) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "AudioFrameEmbed.pptx", save_format.Pptx) + + print "Added audio frame to slide, please check the output file." + + def add_video_frame(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/Frame/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sId = pres.getSlides().get_Item(0) + + # Add Video Frame + vf = sId.getShapes().addVideoFrame(50, 150, 300, 150, dataDir + "Wildlife.mp4") + + # Set Play Mode and Volume of the Video + videoPlayModePreset = VideoPlayModePreset + audioVolumeMode = AudioVolumeMode + + vf.setPlayMode(videoPlayModePreset.Auto) + vf.setVolume(audioVolumeMode.Loud) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "VideoFrame.pptx", save_format.Pptx) + + print "Added video frame to slide, please check the output file." + + +if __name__ == '__main__': Frame() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/RotatingShapes.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/RotatingShapes.py index 13d0cd40..5942bb6f 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/RotatingShapes.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/RotatingShapes.py @@ -1,33 +1,33 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType - - -class RotatingShapes: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithShapes/RotatingShapes/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType = ShapeType - shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) - - # Rotate the shape to 90 degree - shp.setRotation(90) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "RectShpRot.pptx", save_format.Pptx) - - print "Rotated shape, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType + + +class RotatingShapes: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithShapes/RotatingShapes/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Rotate the shape to 90 degree + shp.setRotation(90) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "RectShpRot.pptx", save_format.Pptx) + + print "Rotated shape, please check the output file." + +if __name__ == '__main__': RotatingShapes() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AccessSlides.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AccessSlides.py index 83d26fef..c1ad0fda 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AccessSlides.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AccessSlides.py @@ -1,45 +1,45 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class AccessSlides: - - def __init__(self): - - # Formatting the Lines of Shapes - self.get_slide_by_index() - - # Formatting the Join Styles - self.get_slide_by_id() - - def get_slide_by_index(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/AccessSlides/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'Aspose.pptx') - - # Accessing a slide using its slide index - slide = pres.getSlides().get_Item(0) - - print "Slide: " - print slide - - def get_slide_by_id(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/AccessSlides/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'Aspose.pptx') - - # Getting Slide ID - id = pres.getSlides().get_Item(0).getSlideId() - - # Accessing Slide by ID - slide = pres.getSlideById(id) - - print "Slide: " - print slide - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class AccessSlides: + + def __init__(self): + + # Formatting the Lines of Shapes + self.get_slide_by_index() + + # Formatting the Join Styles + self.get_slide_by_id() + + def get_slide_by_index(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/AccessSlides/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'Aspose.pptx') + + # Accessing a slide using its slide index + slide = pres.getSlides().get_Item(0) + + print "Slide: " + print slide + + def get_slide_by_id(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/AccessSlides/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'Aspose.pptx') + + # Getting Slide ID + id = pres.getSlides().get_Item(0).getSlideId() + + # Accessing Slide by ID + slide = pres.getSlideById(id) + + print "Slide: " + print slide + +if __name__ == '__main__': AccessSlides() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AddSlides.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AddSlides.py index 73c35dcd..2ea278bf 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AddSlides.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AddSlides.py @@ -1,35 +1,35 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class AddSlides: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/AddSlides/' - - # Instantiate Presentation class that represents the presentation file - pres =Presentation() - - # Instantiate SlideCollection calss - slides = pres.getSlides() - - i = 0 - while i < pres.getLayoutSlides().size(): - - # Add an empty slide to the Slides collection - slides.addEmptySlide(pres.getLayoutSlides().get_Item(i)) - i+=1 - - - - #Do some work on the newly added slide - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "EmptySlide.pptx", save_format.Pptx) - - print "Document has been created, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class AddSlides: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/AddSlides/' + + # Instantiate Presentation class that represents the presentation file + pres =Presentation() + + # Instantiate SlideCollection calss + slides = pres.getSlides() + + i = 0 + while i < pres.getLayoutSlides().size(): + + # Add an empty slide to the Slides collection + slides.addEmptySlide(pres.getLayoutSlides().get_Item(i)) + i+=1 + + + + #Do some work on the newly added slide + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "EmptySlide.pptx", save_format.Pptx) + + print "Document has been created, please check the output file." + +if __name__ == '__main__': AddSlides() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Background.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Background.py index c588a854..2632182c 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Background.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Background.py @@ -1,103 +1,103 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import BackgroundType -from com.aspose.slides import FillType -from com.aspose.slides import PictureFillMode -from java.awt import Color -from java.io import File -from java.io import FileInputStream - - -class Background: - - def __init__(self): - - # Setting the Background Color of a Master Slide - self.set_background_color_of_master_slide() - - # Setting the Background Color of a Normal Slide - self.set_background_color_of_normal_slide() - - # Setting the Slide Background to an Image - self.set_image_as_background_color() - - def set_background_color_of_master_slide(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Background/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Set the background color of the Master Slide to Forest Green - backgroundType = BackgroundType - fillType = FillType - color = Color - - pres.getMasters().get_Item(0).getBackground().setType(backgroundType.OwnBackground) - pres.getMasters().get_Item(0).getBackground().getFillFormat().setFillType(fillType.Solid) - pres.getMasters().get_Item(0).getBackground().getFillFormat().getSolidFillColor().setColor(color.GREEN) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "MasterBG.pptx", save_format.Pptx) - - print "Set background color of master slide, please check the output file." - - def set_background_color_of_normal_slide(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Background/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Set the background color of the Normal slide to Blue - - backgroundType = BackgroundType - fillType = FillType - color = Color - - pres.getSlides().get_Item(0).getBackground().setType(backgroundType.OwnBackground) - pres.getSlides().get_Item(0).getBackground().getFillFormat().setFillType(fillType.Solid) - pres.getSlides().get_Item(0).getBackground().getFillFormat().getSolidFillColor().setColor(color.BLUE) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "ContentBG.pptx", save_format.Pptx) - - print "Set background color of normal slide, please check the output file." - - def set_image_as_background_color(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Background/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Set the background with Image - - backgroundType = BackgroundType - fillType = FillType - pictureFillMode = PictureFillMode - - pres.getSlides().get_Item(0).getBackground().setType(backgroundType.OwnBackground) - pres.getSlides().get_Item(0).getBackground().getFillFormat().setFillType(fillType.Picture) - pres.getSlides().get_Item(0).getBackground().getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Stretch) - - # Set the picture - imgx = pres.getImages().addImage(FileInputStream(File(dataDir + 'night.jpg'))) - - # Image imgx = pres.getImages().addImage(image) - # Add image to presentation's images collection - - pres.getSlides().get_Item(0).getBackground().getFillFormat().getPictureFillFormat().getPicture().setImage(imgx) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "ContentBG_Image.pptx", save_format.Pptx) - - print "Set image as background, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import BackgroundType +from com.aspose.slides import FillType +from com.aspose.slides import PictureFillMode +from java.awt import Color +from java.io import File +from java.io import FileInputStream + + +class Background: + + def __init__(self): + + # Setting the Background Color of a Master Slide + self.set_background_color_of_master_slide() + + # Setting the Background Color of a Normal Slide + self.set_background_color_of_normal_slide() + + # Setting the Slide Background to an Image + self.set_image_as_background_color() + + def set_background_color_of_master_slide(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Background/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Set the background color of the Master Slide to Forest Green + backgroundType = BackgroundType + fillType = FillType + color = Color + + pres.getMasters().get_Item(0).getBackground().setType(backgroundType.OwnBackground) + pres.getMasters().get_Item(0).getBackground().getFillFormat().setFillType(fillType.Solid) + pres.getMasters().get_Item(0).getBackground().getFillFormat().getSolidFillColor().setColor(color.GREEN) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "MasterBG.pptx", save_format.Pptx) + + print "Set background color of master slide, please check the output file." + + def set_background_color_of_normal_slide(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Background/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Set the background color of the Normal slide to Blue + + backgroundType = BackgroundType + fillType = FillType + color = Color + + pres.getSlides().get_Item(0).getBackground().setType(backgroundType.OwnBackground) + pres.getSlides().get_Item(0).getBackground().getFillFormat().setFillType(fillType.Solid) + pres.getSlides().get_Item(0).getBackground().getFillFormat().getSolidFillColor().setColor(color.BLUE) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "ContentBG.pptx", save_format.Pptx) + + print "Set background color of normal slide, please check the output file." + + def set_image_as_background_color(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Background/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Set the background with Image + + backgroundType = BackgroundType + fillType = FillType + pictureFillMode = PictureFillMode + + pres.getSlides().get_Item(0).getBackground().setType(backgroundType.OwnBackground) + pres.getSlides().get_Item(0).getBackground().getFillFormat().setFillType(fillType.Picture) + pres.getSlides().get_Item(0).getBackground().getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Stretch) + + # Set the picture + imgx = pres.getImages().addImage(FileInputStream(File(dataDir + 'night.jpg'))) + + # Image imgx = pres.getImages().addImage(image) + # Add image to presentation's images collection + + pres.getSlides().get_Item(0).getBackground().getFillFormat().getPictureFillFormat().getPicture().setImage(imgx) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "ContentBG_Image.pptx", save_format.Pptx) + + print "Set image as background, please check the output file." + + +if __name__ == '__main__': Background() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/ChangingPosition.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/ChangingPosition.py index 5bc77f43..3b778af8 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/ChangingPosition.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/ChangingPosition.py @@ -1,27 +1,27 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class ChangingPosition: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'Aspose.pptx') - - # Get the slide whose position is to be changed - slide = pres.getSlides().get_Item(0) - - # Set the position for the slide - slide.setSlideNumber(2) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "Aspose_Position.pptx", save_format.Pptx) - - print "Changes slide position, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class ChangingPosition: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'Aspose.pptx') + + # Get the slide whose position is to be changed + slide = pres.getSlides().get_Item(0) + + # Set the position for the slide + slide.setSlideNumber(2) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "Aspose_Position.pptx", save_format.Pptx) + + print "Changes slide position, please check the output file." + +if __name__ == '__main__': ChangingPosition() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CloneSlides.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CloneSlides.py index a94cfccc..f678c836 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CloneSlides.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CloneSlides.py @@ -1,77 +1,77 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class ChangingPosition: - - def __init__(self): - - # Within the Same Presentation from One Position to the End - self.clone_to_end_of_presentation() - - # From One Position to Anther within the Same Presentation - self.clone_to_aonther_position() - - # In Another Presentation at the End of the Existing Slides - self.clone_to_other_presentation_at_end_of_existing_slide() - - def clone_to_end_of_presentation(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' - - # Instantiate Presentation class that represents the presentation file - - pres = Presentation(dataDir + 'Aspose.pptx') - - # Clone the desired slide to the end of the collection of slides in the same presentation - slides = pres.getSlides() - slides.addClone(pres.getSlides().get_Item(0)) - - # Saving the presentation file - save_format = SaveFormat - pres.save(dataDir + "Aspose_Cloned.pptx", save_format.Pptx) - - print "Slide has been cloned, please check the output file." - - def clone_to_aonther_position(dataDir): - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'Aspose.pptx') - - # Clone the desired slide to the end of the collection of slides in the same presentation - slides = pres.getSlides() - - # Clone the desired slide to the specified index in the same presentation - slides.insertClone(2, pres.getSlides().get_Item(1)) - - # Saving the presentation file - save_format = SaveFormat - pres.save(dataDir + "Aspose_Cloned.pptx", save_format.Pptx) - - print "Slide has been cloned, please check the output file." - - def clone_to_other_presentation_at_end_of_existing_slide(dataDir): - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' - - # Instantiate Presentation class that represents the presentation file - src_pres = Presentation(dataDir + 'Aspose.pptx') - - # Instantiate Presentation class for destination PPTX (where slide is to be cloned) - dest_pres = Presentation() - - # Clone the desired slide from the source presentation to the end of the collection of slides in destination presentation - slds = dest_pres.getSlides() - - slds.addClone(src_pres.getSlides().get_Item(0)) - - # Saving the presentation file - save_format = SaveFormat - dest_pres.save(dataDir + "Aspose_dest2.pptx", save_format.Pptx) - - print "Slide has been cloned, please check the output file." - - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class ChangingPosition: + + def __init__(self): + + # Within the Same Presentation from One Position to the End + self.clone_to_end_of_presentation() + + # From One Position to Anther within the Same Presentation + self.clone_to_aonther_position() + + # In Another Presentation at the End of the Existing Slides + self.clone_to_other_presentation_at_end_of_existing_slide() + + def clone_to_end_of_presentation(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' + + # Instantiate Presentation class that represents the presentation file + + pres = Presentation(dataDir + 'Aspose.pptx') + + # Clone the desired slide to the end of the collection of slides in the same presentation + slides = pres.getSlides() + slides.addClone(pres.getSlides().get_Item(0)) + + # Saving the presentation file + save_format = SaveFormat + pres.save(dataDir + "Aspose_Cloned.pptx", save_format.Pptx) + + print "Slide has been cloned, please check the output file." + + def clone_to_aonther_position(dataDir): + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'Aspose.pptx') + + # Clone the desired slide to the end of the collection of slides in the same presentation + slides = pres.getSlides() + + # Clone the desired slide to the specified index in the same presentation + slides.insertClone(2, pres.getSlides().get_Item(1)) + + # Saving the presentation file + save_format = SaveFormat + pres.save(dataDir + "Aspose_Cloned.pptx", save_format.Pptx) + + print "Slide has been cloned, please check the output file." + + def clone_to_other_presentation_at_end_of_existing_slide(dataDir): + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' + + # Instantiate Presentation class that represents the presentation file + src_pres = Presentation(dataDir + 'Aspose.pptx') + + # Instantiate Presentation class for destination PPTX (where slide is to be cloned) + dest_pres = Presentation() + + # Clone the desired slide from the source presentation to the end of the collection of slides in destination presentation + slds = dest_pres.getSlides() + + slds.addClone(src_pres.getSlides().get_Item(0)) + + # Saving the presentation file + save_format = SaveFormat + dest_pres.save(dataDir + "Aspose_dest2.pptx", save_format.Pptx) + + print "Slide has been cloned, please check the output file." + + + +if __name__ == '__main__': ChangingPosition() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CreatingSvg.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CreatingSvg.py index b98d2519..eba02df7 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CreatingSvg.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CreatingSvg.py @@ -1,33 +1,33 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from java.io import FileOutputStream - -class CreatingSvg: - - def __init__(self): - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/CreatingSvg/' - - ## Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.pptx') - - # Getting last slide index - last_slide_position = pres.getSlides().size() - - #Iterating through every presentation slide and generating SVG image - i = 0 - while i < last_slide_position: - - # Accessing Slides - slide = pres.getSlides().get_Item(i) - - # Getting and saving the slide SVG image - slide.writeAsSvg(FileOutputStream(dataDir + "SvgImage#{i}.svg")) - - i+=1 - - print "Created SVG images, please check output files." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from java.io import FileOutputStream + +class CreatingSvg: + + def __init__(self): + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/CreatingSvg/' + + ## Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.pptx') + + # Getting last slide index + last_slide_position = pres.getSlides().size() + + #Iterating through every presentation slide and generating SVG image + i = 0 + while i < last_slide_position: + + # Accessing Slides + slide = pres.getSlides().get_Item(i) + + # Getting and saving the slide SVG image + slide.writeAsSvg(FileOutputStream(dataDir + "SvgImage#{i}.svg")) + + i+=1 + + print "Created SVG images, please check output files." + + +if __name__ == '__main__': CreatingSvg() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Hyperlinks.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Hyperlinks.py index 4c8e2bcf..d84c3b6e 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Hyperlinks.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Hyperlinks.py @@ -1,23 +1,23 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class Hyperlinks: - - def __init__(self): - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Hyperlinks/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.pptx') - - # Removing the hyperlinks from presentation - pres.getHyperlinkQueries().removeAllHyperlinks() - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "Hyperlinks.pptx", save_format.Pptx) - - print "Removed hyperlinks successfully, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class Hyperlinks: + + def __init__(self): + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Hyperlinks/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.pptx') + + # Removing the hyperlinks from presentation + pres.getHyperlinkQueries().removeAllHyperlinks() + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "Hyperlinks.pptx", save_format.Pptx) + + print "Removed hyperlinks successfully, please check the output file." + +if __name__ == '__main__': Hyperlinks() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/RemoveSlides.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/RemoveSlides.py index e2078007..885c5264 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/RemoveSlides.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/RemoveSlides.py @@ -1,52 +1,52 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from java.io import FileOutputStream - -class RemoveSlides: - - def __init__(self): - - # Using Slides Collection to Remove Slide by Index - self.remove_slide_by_index() - - # Using Slides Collection to Remove Slide by ID - self.remove_slide_by_id() - - def remove_slide_by_index(dataDir): - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/RemoveSlides/' - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'Aspose.pptx') - - # Accessing a slide using its slide index - slide = pres.getSlides().get_Item(0) - - # Removing a slide using its reference - pres.getSlides().remove(slide) - - # Saving the presentation file - save_format = SaveFormat - pres.save(dataDir + "Modified.pptx", save_format.Pptx) - - print "Removed slide by Index, please check the output file." - - def remove_slide_by_id(dataDir): - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/RemoveSlides/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'Aspose.pptx') - - # Removing a slide using its slide index - pres.getSlides().removeAt(1) - - # Saving the presentation file - save_format = SaveFormat - pres.save(dataDir + "Modified.pptx", save_format.Pptx) - - print "Removed slide by ID, please check the output file." - - - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from java.io import FileOutputStream + +class RemoveSlides: + + def __init__(self): + + # Using Slides Collection to Remove Slide by Index + self.remove_slide_by_index() + + # Using Slides Collection to Remove Slide by ID + self.remove_slide_by_id() + + def remove_slide_by_index(dataDir): + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/RemoveSlides/' + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'Aspose.pptx') + + # Accessing a slide using its slide index + slide = pres.getSlides().get_Item(0) + + # Removing a slide using its reference + pres.getSlides().remove(slide) + + # Saving the presentation file + save_format = SaveFormat + pres.save(dataDir + "Modified.pptx", save_format.Pptx) + + print "Removed slide by Index, please check the output file." + + def remove_slide_by_id(dataDir): + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/RemoveSlides/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'Aspose.pptx') + + # Removing a slide using its slide index + pres.getSlides().removeAt(1) + + # Saving the presentation file + save_format = SaveFormat + pres.save(dataDir + "Modified.pptx", save_format.Pptx) + + print "Removed slide by ID, please check the output file." + + + + +if __name__ == '__main__': RemoveSlides() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/SizeAndLayout.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/SizeAndLayout.py index e888cbab..57980b23 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/SizeAndLayout.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/SizeAndLayout.py @@ -1,64 +1,64 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import SlideSizeType -from com.aspose.slides import PdfOptions - -class SizeAndLayout: - - def __init__(self): - - # Setting the Size and Type of a slide - self.set_size_and_type() - - # Setting the page size when generating PDF - self.set_page_size_for_pdf() - - def set_size_and_type(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/SizeAndLayout/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.pptx') - aux_pres = Presentation() - - slide = pres.getSlides().get_Item(0) - - # Set the slide size of generated presentations to that of source - aux_pres.getSlideSize().setType(pres.getSlideSize().getType()) - aux_pres.getSlideSize().setSize(pres.getSlideSize().getSize()) - - # Clone required slide - aux_pres.getSlides().addClone(pres.getSlides().get_Item(0)) - aux_pres.getSlides().removeAt(0) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "Slide_Size_Type.pptx", save_format.Pptx) - - print "Set slide size and type, please check the output file." - - def set_page_size_for_pdf(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/SizeAndLayout/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Set SlideSize.Type Property - slideSizeType = SlideSizeType - pres.getSlideSize().setType(slideSizeType.A4Paper) - - # Set different properties of PDF Options - opts = PdfOptions() - opts.setSufficientResolution(600) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "Export.pdf", save_format.Pdf, opts) - - print "Set page size for pdf, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import SlideSizeType +from com.aspose.slides import PdfOptions + +class SizeAndLayout: + + def __init__(self): + + # Setting the Size and Type of a slide + self.set_size_and_type() + + # Setting the page size when generating PDF + self.set_page_size_for_pdf() + + def set_size_and_type(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/SizeAndLayout/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.pptx') + aux_pres = Presentation() + + slide = pres.getSlides().get_Item(0) + + # Set the slide size of generated presentations to that of source + aux_pres.getSlideSize().setType(pres.getSlideSize().getType()) + aux_pres.getSlideSize().setSize(pres.getSlideSize().getSize()) + + # Clone required slide + aux_pres.getSlides().addClone(pres.getSlides().get_Item(0)) + aux_pres.getSlides().removeAt(0) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "Slide_Size_Type.pptx", save_format.Pptx) + + print "Set slide size and type, please check the output file." + + def set_page_size_for_pdf(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/SizeAndLayout/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Set SlideSize.Type Property + slideSizeType = SlideSizeType + pres.getSlideSize().setType(slideSizeType.A4Paper) + + # Set different properties of PDF Options + opts = PdfOptions() + opts.setSufficientResolution(600) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "Export.pdf", save_format.Pdf, opts) + + print "Set page size for pdf, please check the output file." + + +if __name__ == '__main__': SizeAndLayout() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Thumbnail.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Thumbnail.py index 94c833c5..f04d1c77 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Thumbnail.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Thumbnail.py @@ -1,119 +1,119 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -from javax import ImageIO -from java.io import File - -class Thumbnail: - - def __init__(self): - - # Generating a Thumbnail from a Slide - self.create_thumbnail() - - # Generating a Thumbnail from a Slide with User Defined Dimensions - self.create_thumbnail_custom_size() - - # Generating a Thumbnail from a Slide in Notes Slides View - self.create_thumbnail_in_notes_slides_view() - - # Generating a Thumbnail of User Defined Window from a Slide - self.create_thumbnail_of_user_defined_window() - - def create_thumbnail(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Thumbnail/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.pptx') - - # Access the first slide - slide = pres.getSlides().get_Item(0) - - # Create a full scale image - image = slide.getThumbnail() - - # Save the image to disk in JPEG format - imageIO = ImageIO - - imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) - - print "Created thumbnail, please check the output file." . PHP_EOL - - - def create_thumbnail_custom_size(dataDir): - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.pptx') - - # Access the first slide - slide = pres.getSlides().get_Item(0) - - # User defined dimension - desired_x = 1200 - desired_y = 800 - - # Getting scaled value of X and Y - scale_x = (1.0 / java_values(pres.getSlideSize().getSize().getWidth())) * desired_x - scale_y = (1.0 / java_values(pres.getSlideSize().getSize().getHeight())) * desired_y - - # Create a full scale image - image = slide.getThumbnail(scale_x, scale_y) - - # Save the image to disk in JPEG format - - imageIO = ImageIO() - imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) - - print "Created thumbnail with custom size, please check the output file.". PHP_EOL - - def create_thumbnail_in_notes_slides_view(dataDir): - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.pptx') - - # Access the first slide - slide = pres.getSlides().get_Item(0) - - # User defined dimension - desired_x = 1200 - desired_y = 800 - - # Getting scaled value of X and Y - scale_x = (1.0 / java_values(pres.getSlideSize().getSize().getWidth())) * desired_x - scale_y = (1.0 / java_values(pres.getSlideSize().getSize().getHeight())) * desired_y - - # Create a full scale image - image = slide.getNotesSlide().getThumbnail(scale_x, scale_y) - - # Save the image to disk in JPEG format - imageIO = ImageIO() - imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) - - print "Created thumbnail in notes slides view, please check the output file." . PHP_EOL - - def create_thumbnail_of_user_defined_window(dataDir): - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.pptx') - - # Access the first slide - slide = pres.getSlides().get_Item(0) - - # Create a full scale image - image = slide.getThumbnail(1,1) - - # Getting the image of desired window inside generated slide thumnbnail - # BufferedImage window = image.getSubimage(windowX, windowY, windowsWidth, windowHeight) - window_image = image.getSubimage(100, 100, 200, 200) - - # Save the image to disk in JPEG format - imageIO = ImageIO() - imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) - - print "Created thumbnail of user defined window, please check the output file." . PHP_EOL - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +from javax import ImageIO +from java.io import File + +class Thumbnail: + + def __init__(self): + + # Generating a Thumbnail from a Slide + self.create_thumbnail() + + # Generating a Thumbnail from a Slide with User Defined Dimensions + self.create_thumbnail_custom_size() + + # Generating a Thumbnail from a Slide in Notes Slides View + self.create_thumbnail_in_notes_slides_view() + + # Generating a Thumbnail of User Defined Window from a Slide + self.create_thumbnail_of_user_defined_window() + + def create_thumbnail(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Thumbnail/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.pptx') + + # Access the first slide + slide = pres.getSlides().get_Item(0) + + # Create a full scale image + image = slide.getThumbnail() + + # Save the image to disk in JPEG format + imageIO = ImageIO + + imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail, please check the output file." . PHP_EOL + + + def create_thumbnail_custom_size(dataDir): + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.pptx') + + # Access the first slide + slide = pres.getSlides().get_Item(0) + + # User defined dimension + desired_x = 1200 + desired_y = 800 + + # Getting scaled value of X and Y + scale_x = (1.0 / java_values(pres.getSlideSize().getSize().getWidth())) * desired_x + scale_y = (1.0 / java_values(pres.getSlideSize().getSize().getHeight())) * desired_y + + # Create a full scale image + image = slide.getThumbnail(scale_x, scale_y) + + # Save the image to disk in JPEG format + + imageIO = ImageIO() + imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail with custom size, please check the output file.". PHP_EOL + + def create_thumbnail_in_notes_slides_view(dataDir): + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.pptx') + + # Access the first slide + slide = pres.getSlides().get_Item(0) + + # User defined dimension + desired_x = 1200 + desired_y = 800 + + # Getting scaled value of X and Y + scale_x = (1.0 / java_values(pres.getSlideSize().getSize().getWidth())) * desired_x + scale_y = (1.0 / java_values(pres.getSlideSize().getSize().getHeight())) * desired_y + + # Create a full scale image + image = slide.getNotesSlide().getThumbnail(scale_x, scale_y) + + # Save the image to disk in JPEG format + imageIO = ImageIO() + imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail in notes slides view, please check the output file." . PHP_EOL + + def create_thumbnail_of_user_defined_window(dataDir): + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.pptx') + + # Access the first slide + slide = pres.getSlides().get_Item(0) + + # Create a full scale image + image = slide.getThumbnail(1,1) + + # Getting the image of desired window inside generated slide thumnbnail + # BufferedImage window = image.getSubimage(windowX, windowY, windowsWidth, windowHeight) + window_image = image.getSubimage(100, 100, 200, 200) + + # Save the image to disk in JPEG format + imageIO = ImageIO() + imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail of user defined window, please check the output file." . PHP_EOL + + +if __name__ == '__main__': Thumbnail() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Transitions.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Transitions.py index 19e37f66..de3f85d9 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Transitions.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Transitions.py @@ -1,31 +1,31 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import TransitionType - -class Transitions: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Transitions/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.pptx') - - transition_type = TransitionType - - # Apply circle type transition on slide 1 - pres.getSlides().get_Item(0).getSlideShowTransition().setType(transition_type.Circle) - - # Apply comb type transition on slide 2 - pres.getSlides().get_Item(1).getSlideShowTransition().setType(transition_type.Comb) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "SimpleTransition.pptx", save_format.Pptx) - - print "Done with simple transition, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import TransitionType + +class Transitions: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Transitions/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.pptx') + + transition_type = TransitionType + + # Apply circle type transition on slide 1 + pres.getSlides().get_Item(0).getSlideShowTransition().setType(transition_type.Circle) + + # Apply comb type transition on slide 2 + pres.getSlides().get_Item(1).getSlideShowTransition().setType(transition_type.Comb) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "SimpleTransition.pptx", save_format.Pptx) + + print "Done with simple transition, please check the output file." + + +if __name__ == '__main__': Transitions() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/AddSmartArt.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/AddSmartArt.py index 1ed427c4..80db4f8d 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/AddSmartArt.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/AddSmartArt.py @@ -1,34 +1,34 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import SmartArtLayoutType - -class AddSmartArt: - - def __init__(self): - - self.create_smartart_shape() - - def create_smartart_shape(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSmartArt/AddSmartArt/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Add Smart Art Shape - smartArtLayoutType=SmartArtLayoutType - smart = slide.getShapes().addSmartArt(0, 0, 400, 400, smartArtLayoutType.BasicBlockList) - - # Write the presentation as a PPTX file - saveFormat=SaveFormat - pres.save(dataDir + "SimpleSmartArt.pptx", saveFormat.Pptx) - - print "Created smartart shape, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import SmartArtLayoutType + +class AddSmartArt: + + def __init__(self): + + self.create_smartart_shape() + + def create_smartart_shape(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSmartArt/AddSmartArt/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add Smart Art Shape + smartArtLayoutType=SmartArtLayoutType + smart = slide.getShapes().addSmartArt(0, 0, 400, 400, smartArtLayoutType.BasicBlockList) + + # Write the presentation as a PPTX file + saveFormat=SaveFormat + pres.save(dataDir + "SimpleSmartArt.pptx", saveFormat.Pptx) + + print "Created smartart shape, please check the output file." + + +if __name__ == '__main__': AddSmartArt() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/FillFormat.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/FillFormat.py index b7b67f99..0a5adb06 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/FillFormat.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/FillFormat.py @@ -1,46 +1,46 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import SmartArtLayoutType -from com.aspose.slides import FillType - -from java.awt import Color - -class FillFormat: - - def __init__(self): - - self.create_smartart_shape() - - def create_smartart_shape(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSmartArt/FillFormat/' - - # Create an instance of Presentation class - pres =Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Adding SmartArt shape and nodes - smartArtLayoutType=SmartArtLayoutType - chevron = slide.getShapes().addSmartArt(10, 10, 800, 60, smartArtLayoutType.ClosedChevronProcess) - node = chevron.getAllNodes().addNode() - node.getTextFrame().setText("Some text") - - # Setting node fill color - color=Color - fillType=FillType - item = node.getShapes().get_Item(0) - item.getFillFormat().setFillType(fillType.Solid) - item.getFillFormat().getSolidFillColor().setColor(color.RED) - - # Write the presentation as a PPTX file - saveFormat=SaveFormat - pres.save(dataDir + "FillFormat.pptx", saveFormat.Pptx) - - print "Set fill format for smartart node, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import SmartArtLayoutType +from com.aspose.slides import FillType + +from java.awt import Color + +class FillFormat: + + def __init__(self): + + self.create_smartart_shape() + + def create_smartart_shape(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSmartArt/FillFormat/' + + # Create an instance of Presentation class + pres =Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Adding SmartArt shape and nodes + smartArtLayoutType=SmartArtLayoutType + chevron = slide.getShapes().addSmartArt(10, 10, 800, 60, smartArtLayoutType.ClosedChevronProcess) + node = chevron.getAllNodes().addNode() + node.getTextFrame().setText("Some text") + + # Setting node fill color + color=Color + fillType=FillType + item = node.getShapes().get_Item(0) + item.getFillFormat().setFillType(fillType.Solid) + item.getFillFormat().getSolidFillColor().setColor(color.RED) + + # Write the presentation as a PPTX file + saveFormat=SaveFormat + pres.save(dataDir + "FillFormat.pptx", saveFormat.Pptx) + + print "Set fill format for smartart node, please check the output file." + + +if __name__ == '__main__': FillFormat() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AddImage.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AddImage.py index 2c5394a3..4e84078d 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AddImage.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AddImage.py @@ -1,49 +1,49 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import TextAnchorType -from com.aspose.slides import FillType -from com.aspose.slides import TextVerticalType - -from javax import ImageIO - -from java.awt import Color - -class AddImage: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithTables/AddImage/' - - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Define co lumns with widths and rows with heights - dbl_cols = [150,150,150,150] - dbl_rows = [100,100,100,100,90] - - # Add table shape to slide - tbl = sld.getShapes().addTable(50, 50, dbl_cols, dbl_rows) - - # Creating a Buffered Image object to hold the image file - imageIO = ImageIO() - image = imageIO.read(File(dataDir + "aspose-logo.jpg")) - imgx1 = pres.getImages().addImage(image) - - fillType=FillType() - pictureFillMode=PictureFillMode() - tbl.get_Item(0,0).getFillFormat().setFillType(fillType.Picture) - tbl.get_Item(0,0).getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Stretch) - tbl.get_Item(0,0).getFillFormat().getPictureFillFormat().getPicture().setImage(imgx1) - - # Write the presentation as a PPTX file - save_format = SaveFormat() - pres.save(dataDir + "AddImage.pptx", save_format.Pptx) - - print "Added image, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import TextAnchorType +from com.aspose.slides import FillType +from com.aspose.slides import TextVerticalType + +from javax import ImageIO + +from java.awt import Color + +class AddImage: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithTables/AddImage/' + + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Define co lumns with widths and rows with heights + dbl_cols = [150,150,150,150] + dbl_rows = [100,100,100,100,90] + + # Add table shape to slide + tbl = sld.getShapes().addTable(50, 50, dbl_cols, dbl_rows) + + # Creating a Buffered Image object to hold the image file + imageIO = ImageIO() + image = imageIO.read(File(dataDir + "aspose-logo.jpg")) + imgx1 = pres.getImages().addImage(image) + + fillType=FillType() + pictureFillMode=PictureFillMode() + tbl.get_Item(0,0).getFillFormat().setFillType(fillType.Picture) + tbl.get_Item(0,0).getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Stretch) + tbl.get_Item(0,0).getFillFormat().getPictureFillFormat().getPicture().setImage(imgx1) + + # Write the presentation as a PPTX file + save_format = SaveFormat() + pres.save(dataDir + "AddImage.pptx", save_format.Pptx) + + print "Added image, please check the output file." + + +if __name__ == '__main__': AddImage() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AlignText.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AlignText.py index 8056fa93..d0638b9f 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AlignText.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AlignText.py @@ -1,66 +1,66 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import TextAnchorType -from com.aspose.slides import FillType -from com.aspose.slides import TextVerticalType - -from Javax.imageio import ImageIO - -from java.awt import Color - -class AlignText: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithTables/AlignText/' - - pres = Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Define columns with widths and rows with heights - dbl_cols = [120, 120, 120, 120] - dbl_rows = [100, 100, 100, 100] - - # Add table shape to slide - tbl = slide.getShapes().addTable(100, 50, dbl_cols, dbl_rows) - - # Add text to the merged cell - tbl.getRows().get_Item(0).get_Item(1).getTextFrame().setText("10") - tbl.getRows().get_Item(0).get_Item(2).getTextFrame().setText("20") - tbl.getRows().get_Item(0).get_Item(3).getTextFrame().setText("30") - - # Accessing the text frame - txt_frame = tbl.getRows().get_Item(0).get_Item(0).getTextFrame() - - # Create the Paragraph object for text frame - para = txt_frame.getParagraphs().get_Item(0) - - # Create Portion object for paragraph - - fillType=FillType() - color=Color() - - portion = para.getPortions().get_Item(0) - portion.setText("Text here") - portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) - portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) - - # Aligning the text vertically - textVerticalType=TextVerticalType() - cell = tbl.getRows().get_Item(0).get_Item(0) - textAnchorType=TextAnchorType() - cell.setTextAnchorType(textAnchorType.Center) - cell.setTextVerticalType(textVerticalType.Vertical270) - - # Write the presentation as a PPTX file - save_format = SaveFormat() - pres.save(dataDir + "AlignText.pptx", save_format.Pptx) - - print "Aligned Text, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import TextAnchorType +from com.aspose.slides import FillType +from com.aspose.slides import TextVerticalType + +from Javax.imageio import ImageIO + +from java.awt import Color + +class AlignText: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithTables/AlignText/' + + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Define columns with widths and rows with heights + dbl_cols = [120, 120, 120, 120] + dbl_rows = [100, 100, 100, 100] + + # Add table shape to slide + tbl = slide.getShapes().addTable(100, 50, dbl_cols, dbl_rows) + + # Add text to the merged cell + tbl.getRows().get_Item(0).get_Item(1).getTextFrame().setText("10") + tbl.getRows().get_Item(0).get_Item(2).getTextFrame().setText("20") + tbl.getRows().get_Item(0).get_Item(3).getTextFrame().setText("30") + + # Accessing the text frame + txt_frame = tbl.getRows().get_Item(0).get_Item(0).getTextFrame() + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + + fillType=FillType() + color=Color() + + portion = para.getPortions().get_Item(0) + portion.setText("Text here") + portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Aligning the text vertically + textVerticalType=TextVerticalType() + cell = tbl.getRows().get_Item(0).get_Item(0) + textAnchorType=TextAnchorType() + cell.setTextAnchorType(textAnchorType.Center) + cell.setTextVerticalType(textVerticalType.Vertical270) + + # Write the presentation as a PPTX file + save_format = SaveFormat() + pres.save(dataDir + "AlignText.pptx", save_format.Pptx) + + print "Aligned Text, please check the output file." + + +if __name__ == '__main__': AlignText() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/CreateTextBox.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/CreateTextBox.py index b0cb4172..30642046 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/CreateTextBox.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/CreateTextBox.py @@ -1,88 +1,88 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType - - -class CreateTextBox: - - def __init__(self): - - # Creating a TextBox on Slide - self.create_textbox() - - # Creating a TextBox with Hyperlink - self.create_textbox_with_hyperlink() - - def create_textbox(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/CreateTextBox/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType=ShapeType - shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 150, 50) - - # Add TextFrame to the Rectangle - shp.addTextFrame(" ") - - # Accessing the text frame - txt_frame = shp.getTextFrame() - - # Create the Paragraph object for text frame - para = txt_frame.getParagraphs().get_Item(0) - - # Create Portion object for paragraph - portion = para.getPortions().get_Item(0) - - # Set Text - portion.setText("Aspose TextBox") - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "TextBox.pptx", save_format.Pptx) - - print "Created TextBox, please check the output file." - - def create_textbox_with_hyperlink(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/CreateTextBox/' - - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType=ShapeType - pptxShape = sld.getShapes().addAutoShape(shapeType.Rectangle, 150, 150, 150, 50) - - # Cast the shape to AutoShape - pptxAutoShape = pptxShape - - # Access ITextFrame associated with the AutoShape - pptxAutoShape.addTextFrame("") - - text_frame = pptxAutoShape.getTextFrame() - - # Add some text to the frame - text_frame.getParagraphs().get_Item(0).getPortions().get_Item(0).setText("Aspose.Slides") - - #Set Hyperlink for the portion text - hypman = text_frame.getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getHyperlinkManager() - hypman.setExternalHyperlinkClick("http://www.aspose.com") - - # Write the presentation as a PPTX file - save_format =SaveFormat - pres.save(dataDir + "hLinkPPTX.pptx", save_format.Pptx) - - print "Created TextBox with Hyperlink, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType + + +class CreateTextBox: + + def __init__(self): + + # Creating a TextBox on Slide + self.create_textbox() + + # Creating a TextBox with Hyperlink + self.create_textbox_with_hyperlink() + + def create_textbox(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/CreateTextBox/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType=ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 150, 50) + + # Add TextFrame to the Rectangle + shp.addTextFrame(" ") + + # Accessing the text frame + txt_frame = shp.getTextFrame() + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + portion = para.getPortions().get_Item(0) + + # Set Text + portion.setText("Aspose TextBox") + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "TextBox.pptx", save_format.Pptx) + + print "Created TextBox, please check the output file." + + def create_textbox_with_hyperlink(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/CreateTextBox/' + + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType=ShapeType + pptxShape = sld.getShapes().addAutoShape(shapeType.Rectangle, 150, 150, 150, 50) + + # Cast the shape to AutoShape + pptxAutoShape = pptxShape + + # Access ITextFrame associated with the AutoShape + pptxAutoShape.addTextFrame("") + + text_frame = pptxAutoShape.getTextFrame() + + # Add some text to the frame + text_frame.getParagraphs().get_Item(0).getPortions().get_Item(0).setText("Aspose.Slides") + + #Set Hyperlink for the portion text + hypman = text_frame.getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getHyperlinkManager() + hypman.setExternalHyperlinkClick("http://www.aspose.com") + + # Write the presentation as a PPTX file + save_format =SaveFormat + pres.save(dataDir + "hLinkPPTX.pptx", save_format.Pptx) + + print "Created TextBox with Hyperlink, please check the output file." + + +if __name__ == '__main__': CreateTextBox() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ManageText.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ManageText.py index db67ac45..44c035c7 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ManageText.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ManageText.py @@ -1,151 +1,151 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import TextAutofitType -from com.aspose.slides import TextAnchorType -from com.aspose.slides import TextVerticalType -from java.awt import Color - -class ManageText: - - def __init__(self): - - # Setting the AutofitType property of text frame - self.set_autofittype_of_text() - - # Setting the anchor of TextFrame - self.set_anchor_of_text() - - # Rotating the text - self.rotate_text() - - def set_autofittype_of_text(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/ManageText/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Add an AutoShape of Rectangle type - shapeType=ShapeType - ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 350, 350) - - # Add TextFrame to the Rectangle - fillType=FillType - ashp.addTextFrame(" ") - ashp.getFillFormat().setFillType(fillType.NoFill) - - # Accessing the text frame - txt_frame = ashp.getTextFrame() - - # Setting text autofit type - textAutofitType=TextAutofitType - txt_frame.getTextFrameFormat().setAutofitType(textAutofitType.Shape) - - # Create the Paragraph object for text frame - para = txt_frame.getParagraphs().get_Item(0) - - # Create Portion object for paragraph - color=Color - portion = para.getPortions().get_Item(0) - portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.") - portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) - portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "formatText.pptx", save_format.Pptx) - - print "Set autofittype of text, please check the output file." - - def set_anchor_of_text(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/ManageText/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Add an AutoShape of Rectangle type - shapeType=ShapeType - ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 350, 350) - - # Add TextFrame to the Rectangle - fillType=FillType - ashp.addTextFrame(" ") - ashp.getFillFormat().setFillType(fillType.NoFill) - - # Accessing the text frame - txt_frame = ashp.getTextFrame() - - # Setting text anchoring to bottom - textAnchorType=TextAnchorType - txt_frame.getTextFrameFormat().setAnchoringType(textAnchorType.Bottom) - - # Create the Paragraph object for text frame - para = txt_frame.getParagraphs().get_Item(0) - - # Create Portion object for paragraph - color=Color - portion = para.getPortions().get_Item(0) - portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.") - portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) - portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "AnchorText.pptx", save_format.Pptx) - - print "Set anchor of text, please check the output file." - - def rotate_text(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/ManageText/' - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Add an AutoShape of Rectangle type - shapeType=ShapeType - ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 350, 350) - - # Add TextFrame to the Rectangle - fillType=FillType - ashp.addTextFrame(" ") - ashp.getFillFormat().setFillType(fillType.NoFill) - - # Accessing the text frame - txt_frame = ashp.getTextFrame() - - # Setting text Vertical type - textVerticalType=TextVerticalType - txt_frame.getTextFrameFormat().setTextVerticalType(textVerticalType.Vertical270) - - # Create the Paragraph object for text frame - para = txt_frame.getParagraphs().get_Item(0) - - # Create Portion object for paragraph - portion = para.getPortions().get_Item(0) - color=Color - portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.") - portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) - portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "VerticleText.pptx", save_format.Pptx) - - print "Done with text rotation, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import TextAutofitType +from com.aspose.slides import TextAnchorType +from com.aspose.slides import TextVerticalType +from java.awt import Color + +class ManageText: + + def __init__(self): + + # Setting the AutofitType property of text frame + self.set_autofittype_of_text() + + # Setting the anchor of TextFrame + self.set_anchor_of_text() + + # Rotating the text + self.rotate_text() + + def set_autofittype_of_text(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/ManageText/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 350, 350) + + # Add TextFrame to the Rectangle + fillType=FillType + ashp.addTextFrame(" ") + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Accessing the text frame + txt_frame = ashp.getTextFrame() + + # Setting text autofit type + textAutofitType=TextAutofitType + txt_frame.getTextFrameFormat().setAutofitType(textAutofitType.Shape) + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + color=Color + portion = para.getPortions().get_Item(0) + portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.") + portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "formatText.pptx", save_format.Pptx) + + print "Set autofittype of text, please check the output file." + + def set_anchor_of_text(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/ManageText/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 350, 350) + + # Add TextFrame to the Rectangle + fillType=FillType + ashp.addTextFrame(" ") + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Accessing the text frame + txt_frame = ashp.getTextFrame() + + # Setting text anchoring to bottom + textAnchorType=TextAnchorType + txt_frame.getTextFrameFormat().setAnchoringType(textAnchorType.Bottom) + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + color=Color + portion = para.getPortions().get_Item(0) + portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.") + portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "AnchorText.pptx", save_format.Pptx) + + print "Set anchor of text, please check the output file." + + def rotate_text(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/ManageText/' + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 350, 350) + + # Add TextFrame to the Rectangle + fillType=FillType + ashp.addTextFrame(" ") + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Accessing the text frame + txt_frame = ashp.getTextFrame() + + # Setting text Vertical type + textVerticalType=TextVerticalType + txt_frame.getTextFrameFormat().setTextVerticalType(textVerticalType.Vertical270) + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + portion = para.getPortions().get_Item(0) + color=Color + portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.") + portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "VerticleText.pptx", save_format.Pptx) + + print "Done with text rotation, please check the output file." + + +if __name__ == '__main__': ManageText() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ReplaceText.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ReplaceText.py index 89c41d36..a310652f 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ReplaceText.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ReplaceText.py @@ -1,29 +1,29 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class ReplaceText: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithText/ReplaceText/' - - # Create an instance of Presentation class - pres = Presentation(dataDir + 'Welcome.pptx') - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Change the text of each placeholder - shp = sld.getShapes().get_Item(0) - shp.getTextFrame().setText("This is Placeholder") - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "Welcome_PH.pptx", save_format.Pptx) - - print "Replaced text, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class ReplaceText: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithText/ReplaceText/' + + # Create an instance of Presentation class + pres = Presentation(dataDir + 'Welcome.pptx') + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Change the text of each placeholder + shp = sld.getShapes().get_Item(0) + shp.getTextFrame().setText("This is Placeholder") + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "Welcome_PH.pptx", save_format.Pptx) + + print "Replaced text, please check the output file." + + +if __name__ == '__main__': ReplaceText() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ShadowEffects.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ShadowEffects.py index 6f9997f5..53f4b012 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ShadowEffects.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ShadowEffects.py @@ -1,57 +1,57 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import RectangleAlignment -from java.awt import Color - - - - -class ShadowEffects: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithText/ShadowEffects/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Add an AutoShape of Rectangle type - shapeType=ShapeType - shp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 150, 50) - - # Add TextFrame to the Rectangle - shp.addTextFrame("Aspose TextBox") - - # Disable shape fill in case we want to get shadow of text - fillType=FillType - shp.getFillFormat().setFillType(fillType.NoFill) - - # Add outer shadow and set all necessary parameters - shp.getEffectFormat().enableOuterShadowEffect() - shadow = shp.getEffectFormat().getOuterShadowEffect() - shadow.setBlurRadius(4.0) - shadow.setDirection(45) - shadow.setDistance(3) - - rectangleAlignment=RectangleAlignment - - color=Color - - shadow.setRectangleAlign(rectangleAlignment.TopLeft) - shadow.getShadowColor().setColor(color.black) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "OutShadow.pptx", save_format.Pptx) - - print "Applied shadow effects on text, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import RectangleAlignment +from java.awt import Color + + + + +class ShadowEffects: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithText/ShadowEffects/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + shp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 150, 50) + + # Add TextFrame to the Rectangle + shp.addTextFrame("Aspose TextBox") + + # Disable shape fill in case we want to get shadow of text + fillType=FillType + shp.getFillFormat().setFillType(fillType.NoFill) + + # Add outer shadow and set all necessary parameters + shp.getEffectFormat().enableOuterShadowEffect() + shadow = shp.getEffectFormat().getOuterShadowEffect() + shadow.setBlurRadius(4.0) + shadow.setDirection(45) + shadow.setDistance(3) + + rectangleAlignment=RectangleAlignment + + color=Color + + shadow.setRectangleAlign(rectangleAlignment.TopLeft) + shadow.getShadowColor().setColor(color.black) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "OutShadow.pptx", save_format.Pptx) + + print "Applied shadow effects on text, please check the output file." + + +if __name__ == '__main__': ShadowEffects() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/TextFont.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/TextFont.py index b3af2619..fa69890c 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/TextFont.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/TextFont.py @@ -1,156 +1,156 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import FontData -from com.aspose.slides import NullableBool -from com.aspose.slides import TextUnderlineType -from com.aspose.slides import LoadFormat -from com.aspose.slides import LoadOptions - - -from java.awt import Color - - -class TextFont: - - def __init__(self): - - # Managing Font Related Properties - self.font_properties() - - # Managing Font Family of Text - self.font_family_of_text() - - # Using Default Fonts for Rendering Presentation - self.set_default_font_for_rendering() - - def font_properties(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/TextFont/' - # Create an instance of Presentation class - pres = Presentation(dataDir + 'Welcome.pptx') - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Accessing the first and second placeholder in the slide and typecasting it as AutoShape - tf1 = slide.getShapes().get_Item(0).getTextFrame() - tf2 = slide.getShapes().get_Item(1).getTextFrame() - - # Accessing the first Paragraph - para1 = tf1.getParagraphs().get_Item(0) - para2 = tf2.getParagraphs().get_Item(0) - - # Accessing the first portion - port1 = para1.getPortions().get_Item(0) - port2 = para2.getPortions().get_Item(0) - - # Define fonts - fd1 = FontData("Elephant") - fd2 = FontData("Castellar") - - # Assign fonts to portion - port1.getPortionFormat().setLatinFont(fd1) - port2.getPortionFormat().setLatinFont(fd2) - - # Set font to Bold - nullableBool=NullableBool - port1.getPortionFormat().setFontBold(nullableBool.True) - port2.getPortionFormat().setFontBold(nullableBool.True) - - # Set font to Italic - port1.getPortionFormat().setFontItalic(nullableBool.True) - port2.getPortionFormat().setFontItalic(nullableBool.True) - - # Set font color - fillType=FillType - color=Color - port1.getPortionFormat().getFillFormat().setFillType(fillType.Solid) - port1.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) - port2.getPortionFormat().getFillFormat().setFillType(fillType.Solid) - port2.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GREEN) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "WelcomeFont.pptx", save_format.Pptx) - - print "Done with font properties, please check the output file." - - def font_family_of_text(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/TextFont/' - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add an AutoShape of Rectangle type - shapeType=ShapeType - ashp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 50, 200, 50) - - # Remove any fill style associated with the AutoShape - fillType=FillType - ashp.getFillFormat().setFillType(fillType.NoFill) - - # Access the TextFrame associated with the AutoShape - tf = ashp.getTextFrame() - tf.setText("Aspose TextBox") - - # Access the Portion associated with the TextFrame - port = tf.getParagraphs().get_Item(0).getPortions().get_Item(0) - - # Set the Font for the Portion - port.getPortionFormat().setLatinFont(FontData("Times New Roman")) - - # Set Bold property of the Font - nullableBool=NullableBool - port.getPortionFormat().setFontBold(nullableBool.True) - - # Set Italic property of the Font - port.getPortionFormat().setFontItalic(nullableBool.True) - - # Set Underline property of the Font - textUnderlineType=TextUnderlineType - port.getPortionFormat().setFontUnderline(textUnderlineType.Single) - - # Set the Height of the Font - port.getPortionFormat().setFontHeight(25) - - # Set the color of the Font - color=Color - port.getPortionFormat().getFillFormat().setFillType(fillType.Solid) - port.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "FontFamilyOfText.pptx", save_format.Pptx) - - print "Done with font family for text, please check the output file." - - - def set_default_font_for_rendering(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/TextFont/' - # Use load options to define the default regualr and asian fonts - - loadFormat = LoadFormat - lo = LoadOptions(loadFormat.Auto) - lo.setDefaultRegularFont("Wingdings") - lo.setDefaultAsianFont("Wingdings") - - # Create an instance of Presentation class - pres = Presentation(dataDir + 'input.pptx') - - # Generate PDF - save_format = SaveFormat - pres.save(dataDir + "output.pdf", save_format.Pdf) - - print "Done with font family for text, please check the output file." - - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import FontData +from com.aspose.slides import NullableBool +from com.aspose.slides import TextUnderlineType +from com.aspose.slides import LoadFormat +from com.aspose.slides import LoadOptions + + +from java.awt import Color + + +class TextFont: + + def __init__(self): + + # Managing Font Related Properties + self.font_properties() + + # Managing Font Family of Text + self.font_family_of_text() + + # Using Default Fonts for Rendering Presentation + self.set_default_font_for_rendering() + + def font_properties(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/TextFont/' + # Create an instance of Presentation class + pres = Presentation(dataDir + 'Welcome.pptx') + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Accessing the first and second placeholder in the slide and typecasting it as AutoShape + tf1 = slide.getShapes().get_Item(0).getTextFrame() + tf2 = slide.getShapes().get_Item(1).getTextFrame() + + # Accessing the first Paragraph + para1 = tf1.getParagraphs().get_Item(0) + para2 = tf2.getParagraphs().get_Item(0) + + # Accessing the first portion + port1 = para1.getPortions().get_Item(0) + port2 = para2.getPortions().get_Item(0) + + # Define fonts + fd1 = FontData("Elephant") + fd2 = FontData("Castellar") + + # Assign fonts to portion + port1.getPortionFormat().setLatinFont(fd1) + port2.getPortionFormat().setLatinFont(fd2) + + # Set font to Bold + nullableBool=NullableBool + port1.getPortionFormat().setFontBold(nullableBool.True) + port2.getPortionFormat().setFontBold(nullableBool.True) + + # Set font to Italic + port1.getPortionFormat().setFontItalic(nullableBool.True) + port2.getPortionFormat().setFontItalic(nullableBool.True) + + # Set font color + fillType=FillType + color=Color + port1.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + port1.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + port2.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + port2.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GREEN) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "WelcomeFont.pptx", save_format.Pptx) + + print "Done with font properties, please check the output file." + + def font_family_of_text(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/TextFont/' + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + ashp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 50, 200, 50) + + # Remove any fill style associated with the AutoShape + fillType=FillType + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Access the TextFrame associated with the AutoShape + tf = ashp.getTextFrame() + tf.setText("Aspose TextBox") + + # Access the Portion associated with the TextFrame + port = tf.getParagraphs().get_Item(0).getPortions().get_Item(0) + + # Set the Font for the Portion + port.getPortionFormat().setLatinFont(FontData("Times New Roman")) + + # Set Bold property of the Font + nullableBool=NullableBool + port.getPortionFormat().setFontBold(nullableBool.True) + + # Set Italic property of the Font + port.getPortionFormat().setFontItalic(nullableBool.True) + + # Set Underline property of the Font + textUnderlineType=TextUnderlineType + port.getPortionFormat().setFontUnderline(textUnderlineType.Single) + + # Set the Height of the Font + port.getPortionFormat().setFontHeight(25) + + # Set the color of the Font + color=Color + port.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + port.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "FontFamilyOfText.pptx", save_format.Pptx) + + print "Done with font family for text, please check the output file." + + + def set_default_font_for_rendering(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/TextFont/' + # Use load options to define the default regualr and asian fonts + + loadFormat = LoadFormat + lo = LoadOptions(loadFormat.Auto) + lo.setDefaultRegularFont("Wingdings") + lo.setDefaultAsianFont("Wingdings") + + # Create an instance of Presentation class + pres = Presentation(dataDir + 'input.pptx') + + # Generate PDF + save_format = SaveFormat + pres.save(dataDir + "output.pdf", save_format.Pdf) + + print "Done with font family for text, please check the output file." + + + +if __name__ == '__main__': TextFont() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/WordArt.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/WordArt.py index 6d56a4c5..68b82ed6 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/WordArt.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/WordArt.py @@ -1,62 +1,62 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import RectangleAlignment -from com.aspose.slides import ColorType -from com.aspose.slides import SchemeColor - -from java.awt import Color - -class WordArt: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithText/WordArt/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Add an AutoShape of Rectangle type - shapeType=ShapeType - fillType=FillType - ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 400, 300) - ashp.getFillFormat().setFillType(fillType.NoFill) - - # Add TextFrame to the Rectangle - ashp.addTextFrame("Aspose TextBox") - port = ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0) - pf = port.getPortionFormat() - pf.setFontHeight(50) - - # Enable InnerShadowEffect - ef = pf.getEffectFormat() - ef.enableInnerShadowEffect() - - # Set all necessary parameters - ef.getInnerShadowEffect().setBlurRadius(8.0) - ef.getInnerShadowEffect().setDirection(90) - ef.getInnerShadowEffect().setDistance(6.0) - ef.getInnerShadowEffect().getShadowColor().setB(189) - - # Set ColorType as Scheme - colorType=ColorType - ef.getInnerShadowEffect().getShadowColor().setColorType(colorType.Scheme) - - # Set Scheme Color - schemeColor=SchemeColor - ef.getInnerShadowEffect().getShadowColor().setSchemeColor(schemeColor.Accent1) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "WordArt.pptx", save_format.Pptx) - - print "Done with word art, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import RectangleAlignment +from com.aspose.slides import ColorType +from com.aspose.slides import SchemeColor + +from java.awt import Color + +class WordArt: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithText/WordArt/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + fillType=FillType + ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 400, 300) + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Add TextFrame to the Rectangle + ashp.addTextFrame("Aspose TextBox") + port = ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0) + pf = port.getPortionFormat() + pf.setFontHeight(50) + + # Enable InnerShadowEffect + ef = pf.getEffectFormat() + ef.enableInnerShadowEffect() + + # Set all necessary parameters + ef.getInnerShadowEffect().setBlurRadius(8.0) + ef.getInnerShadowEffect().setDirection(90) + ef.getInnerShadowEffect().setDistance(6.0) + ef.getInnerShadowEffect().getShadowColor().setB(189) + + # Set ColorType as Scheme + colorType=ColorType + ef.getInnerShadowEffect().getShadowColor().setColorType(colorType.Scheme) + + # Set Scheme Color + schemeColor=SchemeColor + ef.getInnerShadowEffect().getShadowColor().setSchemeColor(schemeColor.Accent1) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "WordArt.pptx", save_format.Pptx) + + print "Done with word art, please check the output file." + + +if __name__ == '__main__': WordArt() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/IntroductionToPresentation/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/IntroductionToPresentation/__init__.py new file mode 100644 index 00000000..889ccb2b --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/IntroductionToPresentation/__init__.py @@ -0,0 +1,47 @@ +__author__ = 'fahadadeel' +import jpype + +class HelloWorld: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.Color=jpype.JPackage("java.awt.Color") + + def main(self): + + # Instantiate Presentation + pres = self.Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shape_type = self.ShapeType + slide_shapes = slide.getShapes() + ashp = slide_shapes().addAutoShape(shape_type.Rectangle, 150, 75, 150, 50) + + # Add ITextFrame to the Rectangle + ashp.addTextFrame("Hello World") + + # Change the text color to Black (which is White by default) + fill_type = self.FillType() + color = self.Color() + ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().setFillType(fill_type.Solid) + ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Change the line color of the rectangle to White + ashp.getShapeStyle().getLineColor().setColor(color.WHITE) + + # Remove any fill formatting in the shape + ashp.getFillFormat().setFillType(fill_type.NoFill) + + # Save the presentation to disk + save_format = self.SaveFormat + pres.save(self.dataDir + "HelloWorld.pptx", save_format.Pptx) + + print "Document has been saved, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/IntroductionToPresentation/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/IntroductionToPresentation/__init__.pyc new file mode 100644 index 00000000..061b226e Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/IntroductionToPresentation/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/README.md b/Plugins/Aspose-Slides-Java-for-Python/README.md new file mode 100644 index 00000000..07cfa81e --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/README.md @@ -0,0 +1,14 @@ +## Aspose.Slides Java for Python + +Aspose.Slides Java for Python is a project that demonstrates / provides the Aspose.Slides for Java API usage examples in Python. + +## Download + +* To download Aspose.Slides for Java API to be used with these examples, Please navigate to [Aspose.Slides for Java](http://maven.aspose.com/repository/simple/ext-release-local/com/aspose/aspose-slides/) +* Place downloaded jar file into "lib" directory. + +## Documentation + +For most complete documentation of the project, check [Aspose.Slides Java For Python confluence wiki](https://docs.aspose.com/display/slidesjava/Aspose.Slides+Java+for+Python). + + diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithCharts/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithCharts/__init__.py new file mode 100644 index 00000000..9c331034 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithCharts/__init__.py @@ -0,0 +1,993 @@ +__author__ = 'fahadadeel' +import jpype + +class CreateChart: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.NullableBool=jpype.JClass("com.aspose.slides.NullableBool") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.MarkerStyleType=jpype.JClass("com.aspose.slides.MarkerStyleType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + # Creating Normal Charts + self.create_normal_chart() + + # Creating Scattered Chart with multiple series and different series markers + self.create_scatter_chart() + + def create_normal_chart(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + chartTye = self.ChartType + chart = sld.getShapes().addChart(chartTye.ClusteredColumn, 0, 0, 500, 500) + + # Setting chart Title + # chart.ChartTitle.TextFrameForOverriding.Text = "Sample Title" + chart.getChartTitle().addTextFrameForOverriding("Sample Title") + nullableBool = self.NullableBool() + chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(nullableBool.True) + chart.getChartTitle().setHeight (20) + chart.hasTitle(True) + + # Set first series to Show Values + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(True) + + # Setting the index of chart data sheet + defaultWorksheetIndex = 0 + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete default generated series and categories + chart.getChartData().getSeries().clear() + chart.getChartData().getCategories().clear() + s = chart.getChartData().getSeries().size() + s = chart.getChartData().getCategories().size() + + # Adding self.series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 1, "Series 1"), chart.getType()) + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 2, "Series 2"), chart.getType()) + + # Adding self.categories + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "Caetegoty 1")) + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 2, 0, "Caetegoty 2")) + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 3, 0, "Caetegoty 3")) + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)) + + # Setting fill color for series + fillType=self.FillType() + color=self.Color() + series.getFormat().getFill().setFillType(fillType.Solid) + series.getFormat().getFill().getSolidFillColor().setColor(color.RED) + + + # Take second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 2, 30)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 2, 10)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 2, 60)) + + # Setting fill color for series + fillType=self.FillType() + color=self.Color() + series.getFormat().getFill().setFillType(fillType.Solid) + series.getFormat().getFill().getSolidFillColor().setColor(color.GREEN) + + # create custom labels for each of categories for self.series + # first label will be show Category name + lbl = series.getDataPoints().get_Item(0).getLabel() + lbl.getDataLabelFormat().setShowCategoryName(True) + + lbl = series.getDataPoints().get_Item(1).getLabel() + lbl.getDataLabelFormat().setShowSeriesName(True) + + # Show value for third label + lbl = series.getDataPoints().get_Item(2).getLabel() + lbl.getDataLabelFormat().setShowValue(True) + lbl.getDataLabelFormat().setShowSeriesName(True) + lbl.getDataLabelFormat().setSeparator ("/") + + # Save presentation with chart + + saveFormat = self.SaveFormat + pres.save(self.dataDir + "NormalChart.pptx", saveFormat.Pptx) + + print "Created normal chart, please check the output file." . PHP_EOL + + def create_scatter_chart(self): + pres = self.Presentation + + slide = pres.getSlides().get_Item(0) + + chartType=self.ChartType() + + # Creating the default chart + chart = slide.getShapes().addChart(chartType.ScatterWithSmoothLines, 0, 0, 400, 400) + + # Getting the default chart data worksheet index + defaultWorksheetIndex = 0 + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete demo series + chart.getChartData().getSeries().clear() + + # Add self.series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 1, "Series 1"), chart.getType()) + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 3, "Series 2"), chart.getType()) + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Add self.point (1:3) there. + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 1), fact.getCell(defaultWorksheetIndex, 2, 2, 3)) + + # Add self.point (2:10) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 2), fact.getCell(defaultWorksheetIndex, 3, 2, 10)) + + # Edit the type of series + chartType=self.ChartType() + series.setType(chartType.ScatterWithStraightLinesAndMarkers) + + # Changing the chart series marker + + markerStyleType=self.MarkerStyleType() + series.getMarker().setSize(10) + series.getMarker().setSymbol(markerStyleType.Star) + + # Take second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Add self.point (5:2) there. + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 5), fact.getCell(defaultWorksheetIndex, 2, 4, 2)) + + # Add self.point (3:1) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 3), fact.getCell(defaultWorksheetIndex, 3, 4, 1)) + + # Add self.point (2:2) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 4, 3, 2), fact.getCell(defaultWorksheetIndex, 4, 4, 2)) + + # Add self.point (5:1) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 5, 3, 5), fact.getCell(defaultWorksheetIndex, 5, 4, 1)) + + # Changing the chart series marker + + markerStyleType1=self.MarkerStyleType() + + series.getMarker().setSize(10) + series.getMarker().setSymbol(markerStyleType1.Circle) + + save_format = self.SaveFormat + pres.save(self.dataDir + "AsposeScatterChart.pptx", save_format.Pptx) + + print "Created scatter chart, please check the output file." + + +class ChartLegend: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.NullableBool=jpype.JClass("com.aspose.slides.NullableBool") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.MarkerStyleType=jpype.JClass("com.aspose.slides.MarkerStyleType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.Color=jpype.JClass("java.awt.Color") + + + def main(self): + + # Setting Custom Location and Size for Chart legend + self.set_location_and_size() + + def set_location_and_size(self): + + # Creating empty presentation + pres = self.Presentation() + + # Get reference of the slide + slide = pres.getSlides().get_Item(0) + + # Add a clustered column chart on the slide + + chartType=self.ChartType + + chart = slide.getShapes.addChart(chartType.ClusteredColumn, 50, 50, 500, 500) + + # Set Legend Properties + chart.getLegend().setX(50 / chart.getWidth()) + chart.getLegend().setY (50 / chart.getHeight()) + chart.getLegend().setWidth(100 / chart.getWidth()) + chart.getLegend().setHeight(100 / chart.getHeight()) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Legend.pptx", save_format.Pptx) + + print "Set custom location and size of chart legend, please check the output file." + + +class ChartProperties: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Setting the RotationX, RotationY and DepthPercents properties of 3D Chart. + self.set_rotation_and_depth() + + # Setting the GapWidth property of Chart Series + self.set_gapwidth() + + + def set_rotation_and_depth(self): + + pres = self.Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + charType=self.ChartType + chart = sld.getShapes().addChart(charType.StackedColumn3D, 0, 0, 500, 500) + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete default generated series and categories + chart.getChartData().getSeries().clear() + chart.getChartData().getCategories().clear() + + # Adding self.series + chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()) + chart.getChartData().getSeries().add(fact.getCell(0, 0, 2, "Series 2"), chart.getType()) + + # Adding self.categories + chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "Caetegoty 1")) + chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "Caetegoty 2")) + chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "Caetegoty 3")) + + # Set Rotation3D properties + chart.getRotation3D().setRightAngleAxes(True) + chart.getRotation3D().setRotationX(40) + chart.getRotation3D().setRotationY(270) + chart.getRotation3D().setDepthPercents(150) + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 1, 20)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 1, 50)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 1, 30)) + + # Take second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 2, 30)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 2, 10)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 2, 60)) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "3Drotation.pptx", save_format.Pptx) + + print "Done with rotation, please check the output file." + + + def set_gapwidth(self): + + pres = self.Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + charType=self.ChartType() + chart = sld.getShapes().addChart(charType.StackedColumn3D, 0, 0, 500, 500) + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete default generated series and categories + chart.getChartData().getSeries().clear() + chart.getChartData().getCategories().clear() + + # Adding self.series + chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()) + chart.getChartData().getSeries().add(fact.getCell(0, 0, 2, "Series 2"), chart.getType()) + + # Adding self.categories + chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "Caetegoty 1")) + chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "Caetegoty 2")) + chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "Caetegoty 3")) + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 1, 20)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 1, 50)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 1, 30)) + + # Take second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 2, 30)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 2, 10)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 2, 60)) + + # Set GapWidth value + series.getParentSeriesGroup().setGapWidth(75) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "SetGapWidth.pptx", save_format.Pptx) + + print "Set Gapwidth property of chart series, please check the output file." + + +class ChartSeries: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Adding Chart Series Overlap for Charts + self.add_overlap_for_chart() + + def add_overlap_for_chart(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Adding chart + chartType = self.ChartType + + chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.ClusteredColumn, 50, 50, 600, 400, True) + + series = chart.getChartData().getSeries() + if (series.get_Item(0).getOverlap() == 0): + # Setting series overlap + series . get_Item(0) . getParentSeriesGroup().setOverlap(-30) + + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Overlap.pptx", save_format.Pptx) + + print "Added chart series overlap for charts, please check the output file." + +class ChartTrendLines: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.TrendlineType=jpype.JClass("com.aspose.slides.TrendlineType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.Color=jpype.JClass("java.awt.Color") + + + def main(self): + + # Creating empty presentation + pres =self.Presentation() + + # Creating a clustered column chart + chartType=self.ChartType + chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.ClusteredColumn, 20, 20, 500, 400) + + # Adding ponential trend line for chart series 1 + trendlineType=self.TrendlineType() + tredLinep = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(trendlineType.Exponential) + tredLinep.setDisplayEquation(False) + tredLinep.setDisplayRSquaredValue(False) + + # Adding Linear trend line for chart series 1 + fillType=self.FillType() + color=self.Color() + + tredLineLin = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(trendlineType.Linear) + tredLineLin.setTrendlineType(trendlineType.Linear) + tredLineLin.getFormat().getLine().getFillFormat().setFillType(fillType.Solid) + tredLineLin.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.RED) + + + # Adding Logarithmic trend line for chart series 2 + tredLineLog = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(trendlineType.Logarithmic) + tredLineLog.setTrendlineType(trendlineType.Logarithmic) + tredLineLog.addTextFrameForOverriding("self.log trend line") + + # Adding MovingAverage trend line for chart series 2 + tredLineMovAvg = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(trendlineType.MovingAverage) + tredLineMovAvg.setTrendlineType(trendlineType.MovingAverage) + tredLineMovAvg.setPeriod(3) + tredLineMovAvg.setTrendlineName("self.TrendLine Name") + + # Adding Polynomial trend line for chart series 3 + tredLinePol = chart.getChartData().getSeries().get_Item(2).getTrendLines().add(trendlineType.Polynomial) + tredLinePol.setTrendlineType(trendlineType.Polynomial) + tredLinePol.setForward(1) + tredLinePol.setOrder(3) + + # Adding Power trend line for chart series 3 + tredLinePower = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(trendlineType.Power) + tredLinePower.setTrendlineType(trendlineType.Power) + tredLinePower.setBackward(1) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "ChartTrendLines.pptx", save_format.Pptx) + + print "Done with chart trend lines, please check the output file." + +class ErrorBars: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ErrorBarValueType=jpype.JClass("com.aspose.slides.ErrorBarValueType") + self.DataSourceType=jpype.JClass("com.aspose.slides.DataSourceType") + self.ErrorBarType=jpype.JClass("com.aspose.slides.ErrorBarType") + + + def main(self): + # Adding Fixed Error Bar Value for Chart + self.add_fixed_error_bar_value() + + # Adding Custom Error Bar Value for Chart + self.add_custom_error_bar_value() + + def add_fixed_error_bar_value(self): + + pres = self.Presentation() + + # Creating a bubble chart + chartType=self.ChartType + chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.Bubble, 50, 50, 400, 300, True) + + # Adding Error bars and setting its format + error_bar_x = chart.getChartData().getSeries().get_Item(0).getErrorBarsXFormat() + error_bar_y = chart.getChartData().getSeries().get_Item(0).getErrorBarsYFormat() + + + + #error_bar_x.isVisible(True) + #error_bar_y.isVisible(True) + + errorBarValueType = self.ErrorBarValueType() + errorBarType = self.ErrorBarType() + + error_bar_x.setValueType(errorBarValueType.Fixed) + + error_bar_x.setValue(0.1) + + error_bar_y.setValueType(errorBarValueType.Percentage) + error_bar_y.setValue(5) + error_bar_x.setType(errorBarType.Plus) + error_bar_y.getFormat().getLine().setWidth(2.0) + #error_bar_x.hasEndCap(True) + + # Save presentation with chart + save_format = self.SaveFormat + pres.save(self.dataDir + "ErrorBar.pptx", save_format.Pptx) + + print "Added fixed error bar value for chart, please check the output file." + + def add_custom_error_bar_value(self): + + pres = self.Presentation() + + slide = pres.getSlides().get_Item(0) + + # Creating a bubble chart + chartType = self.ChartType() + chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.Bubble, 50, 50, 400, 300, True) + + # Adding custom Error bars and setting its format + error_bar_value_type = self.ErrorBarValueType() + series = chart.getChartData().getSeries().get_Item(0) + error_bar_x = series.getErrorBarsXFormat() + error_bar_y = series.getErrorBarsYFormat() + + #error_bar_x.isVisible(True) + #error_bar_y.isVisible(True) + + error_bar_x.setValueType(error_bar_value_type.Custom) + error_bar_y.setValueType(error_bar_value_type.Custom) + + #Accessing chart series data point and setting error bars values for individual point + data_source_type = self.DataSourceType() + points = series.getDataPoints() + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForXPlusValues(data_source_type.DoubleLiterals) + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForXMinusValues(data_source_type.DoubleLiterals) + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForYPlusValues(data_source_type.DoubleLiterals) + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForYMinusValues(data_source_type.DoubleLiterals) + + # Setting error bars for chart series points + i = 0 + while (i < points.size()): + points.get_Item(i).getErrorBarsCustomValues().getXMinus().setAsLiteralDouble(i + 1) + points.get_Item(i).getErrorBarsCustomValues().getXPlus().setAsLiteralDouble(i + 1) + points.get_Item(i).getErrorBarsCustomValues().getYMinus().setAsLiteralDouble(i + 1) + points.get_Item(i).getErrorBarsCustomValues().getYPlus().setAsLiteralDouble(i + 1) + i+=1 + + + save_format = self.SaveFormat + pres.save(self.dataDir + "ErrorBarsCustomValues.pptx", save_format.Pptx) + + print "Added custom error bars values for chart, please check the output file." + +class ExistingChart: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ErrorBarValueType=jpype.JClass("com.aspose.slides.ErrorBarValueType") + self.DataSourceType=jpype.JClass("com.aspose.slides.DataSourceType") + self.ErrorBarType=jpype.JClass("com.aspose.slides.ErrorBarType") + + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + "AsposeChart.pptx") + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + chart = sld.getShapes().get_Item(0) + + # Setting the index of chart data sheet + defaultWorksheetIndex = 0 + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Changing chart Category Name + fact.getCell(defaultWorksheetIndex, 1, 0, "Modified Category 1") + fact.getCell(defaultWorksheetIndex, 2, 0, "Modified Category 2") + + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Now updating series data + fact.getCell(defaultWorksheetIndex, 0, 1, "New_Series1") # modifying series name + series.getDataPoints().get_Item(0).getValue().setData(90) + series.getDataPoints().get_Item(1).getValue().setData(123) + series.getDataPoints().get_Item(2).getValue().setData(44) + + # Take Second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Now updating series data + fact.getCell(defaultWorksheetIndex, 0, 2, "New_Series2") #modifying series name + series.getDataPoints().get_Item(0).getValue().setData(23) + series.getDataPoints().get_Item(1).getValue().setData(67) + series.getDataPoints().get_Item(2).getValue().setData(99) + + + # Now, Adding a self.series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 3, "Series 3"), chart.getType()) + + # Take 3rd chart series + series = chart.getChartData().getSeries().get_Item(2) + + # Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 3, 20)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 50)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 30)) + + chartType=self.ChartType + chart.setType(chartType.ClusteredCylinder) + + + # Saving the presentation to HTML format + save_format = self.SaveFormat + pres.save(self.dataDir + "AsposeChartModified.pptx", save_format.Pptx) + + print "Updated chart, please check the output file." + +class FormattingChartEntities: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.Color=jpype.JClass("java.awt.Color") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.NullableBool=jpype.JClass("com.aspose.slides.NullableBool") + self.LineDashStyle=jpype.JClass("com.aspose.slides.LineDashStyle") + self.DisplayUnitType=jpype.JClass("com.aspose.slides.DisplayUnitType") + self.FontData=jpype.JClass("com.aspose.slides.FontData") + self.PresetColor=jpype.JClass("com.aspose.slides.PresetColor") + self.TickLabelPositionType=jpype.JClass("com.aspose.slides.TickLabelPositionType") + self.LineStyle=jpype.JClass("com.aspose.slides.LineStyle") + + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Accessing the first slide + slide = pres.getSlides().get_Item(0) + + # Adding the sample chart + chartType=self.ChartType + chart = slide.getShapes().addChart(chartType.LineWithMarkers, 50, 50, 500, 400) + + # Setting Chart Titile + chart.hasTitle(True) + chart.getChartTitle().addTextFrameForOverriding("") + chartTitle = chart.getChartTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) + chartTitle.setText("Sample Chart") + + fillType=self.FillType() + color=self.Color() + nullableBool=self.NullableBool() + lineDashStyle=self.LineDashStyle() + + chartTitle.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + chartTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GRAY) + chartTitle.getPortionFormat().setFontHeight (20) + chartTitle.getPortionFormat().setFontBold(nullableBool.True) + chartTitle.getPortionFormat().setFontItalic(nullableBool.True) + + # Setting Major grid lines format for value axis + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.BLUE) + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setWidth(5) + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setDashStyle(lineDashStyle.DashDot) + + # Setting Minor grid lines format for value axis + chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) + chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.RED) + chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().setWidth(3) + + # Setting value axis number format + + displayUnitType=self.DisplayUnitType() + chart.getAxes().getVerticalAxis().isNumberFormatLinkedToSource(False) + chart.getAxes().getVerticalAxis().setDisplayUnit(displayUnitType.Thousands) + chart.getAxes().getVerticalAxis().setNumberFormat("0.0%") + + # Setting chart maximum, minimum values + chart.getAxes().getVerticalAxis().isAutomaticMajorUnit(False) + chart.getAxes().getVerticalAxis().isAutomaticMaxValue(False) + chart.getAxes().getVerticalAxis().isAutomaticMinorUnit(False) + chart.getAxes().getVerticalAxis().isAutomaticMinValue(False) + + chart.getAxes().getVerticalAxis().setMaxValue(15) + chart.getAxes().getVerticalAxis().setMinValue(-2) + chart.getAxes().getVerticalAxis().setMinorUnit(0.5) + chart.getAxes().getVerticalAxis().setMajorUnit(2.0) + + # Setting Value Axis Text Properties + + fontData=self.FontData() + presetColor=self.PresetColor() + + txtVal = chart.getAxes().getVerticalAxis().getTextFormat().getPortionFormat() + txtVal.setFontBold(nullableBool.True) + txtVal.setFontHeight(16) + txtVal.setFontItalic(nullableBool.True) + txtVal.getFillFormat().setFillType(fillType.Solid) + txtVal.getFillFormat().getSolidFillColor().setColor(self.Color(presetColor.DarkGreen)) + txtVal.setLatinFont(self.FontData("Times self.Roman")) + + # Setting value axis title + chart.getAxes().getVerticalAxis().hasTitle(True) + chart.getAxes().getVerticalAxis().getTitle().addTextFrameForOverriding("") + valtitle = chart.getAxes().getVerticalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) + valtitle.setText("Primary Axis") + valtitle.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + valtitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GRAY) + valtitle.getPortionFormat().setFontHeight(20) + valtitle.getPortionFormat().setFontBold(nullableBool.True) + valtitle.getPortionFormat().setFontItalic(nullableBool.True) + + # Setting Major grid lines format for Category axis + chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) + chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.GREEN) + chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().setWidth(5) + + # Setting Minor grid lines format for Category axis + chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) + chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.YELLOW) + chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().setWidth(3) + + #Setting Category Axis Text Properties + txtCat = chart.getAxes().getHorizontalAxis().getTextFormat().getPortionFormat() + txtCat.setFontBold(nullableBool.True) + txtCat.setFontHeight(16) + txtCat.setFontItalic(nullableBool.True) + txtCat.getFillFormat().setFillType(fillType.Solid) + txtCat.getFillFormat().getSolidFillColor().setColor(color.BLUE) + txtCat.setLatinFont(self.FontData("Arial")) + + # Setting Category Titile + chart.getAxes().getHorizontalAxis().hasTitle(True) + chart.getAxes().getHorizontalAxis().getTitle().addTextFrameForOverriding("") + + catTitle = chart.getAxes().getHorizontalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) + catTitle.setText("Sample Category") + catTitle.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + catTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GRAY) + catTitle.getPortionFormat().setFontHeight(20) + catTitle.getPortionFormat().setFontBold(nullableBool.True) + catTitle.getPortionFormat().setFontItalic(nullableBool.True) + + # Setting category axis lable position + tickLabelPositionType = self.TickLabelPositionType() + chart.getAxes().getHorizontalAxis().setTickLabelPosition(tickLabelPositionType.Low) + + # Setting category axis lable rotation angle + chart.getAxes().getHorizontalAxis().setTickLabelRotationAngle(45) + + # Setting Legends Text Properties + txtleg = chart.getLegend().getTextFormat().getPortionFormat() + txtleg.setFontBold(nullableBool.True) + txtleg.setFontHeight(16) + txtleg.setFontItalic(nullableBool.True) + txtleg.getFillFormat().setFillType(fillType.Solid) + txtleg.getFillFormat().getSolidFillColor().setColor(self.Color(presetColor.DarkRed)) + + # Set show chart legends without overlapping chart + chart.getLegend().setOverlay(True) + #chart.ChartData.Series[0].PlotOnSecondAxis=True + chart.getChartData().getSeries().get_Item(0).setPlotOnSecondAxis(True) + + # Setting secondary value axis + lineStyle = self.LineStyle() + chart.getAxes().getSecondaryVerticalAxis().isVisible(True) + chart.getAxes().getSecondaryVerticalAxis().getFormat().getLine().setStyle(lineStyle.ThickBetweenThin) + chart.getAxes().getSecondaryVerticalAxis().getFormat().getLine().setWidth(20) + + # Setting secondary value axis Number format + chart.getAxes().getSecondaryVerticalAxis().isNumberFormatLinkedToSource(False) + displayUnitType=self.DisplayUnitType() + chart.getAxes().getSecondaryVerticalAxis().setDisplayUnit(displayUnitType.Hundreds) + chart.getAxes().getSecondaryVerticalAxis().setNumberFormat ("0.0%") + + # Setting chart maximum, minimum values + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMajorUnit(False) + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMaxValue(False) + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinorUnit(False) + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinValue(False) + + chart.getAxes().getSecondaryVerticalAxis().setMaxValue(20) + chart.getAxes().getSecondaryVerticalAxis().setMinValue(-5) + chart.getAxes().getSecondaryVerticalAxis().setMinorUnit(0.5) + chart.getAxes().getSecondaryVerticalAxis().setMajorUnit(2.0) + + + # Setting chart back wall color + chart.getBackWall().setThickness(1) + chart.getBackWall().getFormat().getFill().setFillType(fillType.Solid) + chart.getBackWall().getFormat().getFill().getSolidFillColor().setColor(color.ORANGE) + + chart.getFloor().getFormat().getFill().setFillType(fillType.Solid) + chart.getFloor().getFormat().getFill().getSolidFillColor().setColor(color.RED) + + # Setting Plot area color + chart.getPlotArea().getFormat().getFill().setFillType(fillType.Solid) + chart.getPlotArea().getFormat().getFill().getSolidFillColor().setColor(self.Color(presetColor.LightCyan)) + + # Save Presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "FormattedChart.pptx", save_format.Pptx) + + print "Formatted chart entities, please check the output file." + +class SetLabelDistance: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Adding a chart on slide + chartType=self.ChartType + ch = sld.getShapes().addChart(chartType.ClusteredColumn, 20, 20, 500, 300) + + # Setting the position of label from axis + ch.getAxes().getHorizontalAxis().setLabelOffset(500) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Position.pptx", save_format.Pptx) + + print "Set label distance, please check the output file." + + +class SetPieChartColors: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.NullableBool=jpype.JClass("com.aspose.slides.NullableBool") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.LineStyle=jpype.JClass("com.aspose.slides.LineStyle") + self.LineDashStyle=jpype.JClass("com.aspose.slides.LineDashStyle") + self.Color=jpype.JClass("java.awt.Color") + self.PresetColor=jpype.JClass("com.aspose.slides.PresetColor") + + def main(self): + + pres = self.Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + chart_type = self.ChartType + chart = sld.getShapes().addChart(chart_type.Pie, 100, 100, 400, 400) + + nullableBool=self.NullableBool() + + # Setting chart Title + chart.getChartTitle().addTextFrameForOverriding("Sample Title") + chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(nullableBool.True) + chart.getChartTitle().setHeight(20) + chart.hasTitle(True) + + # Set first series to Show Values + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(True) + + # Setting the index of chart data sheet + defaultWorksheetIndex = 0 + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete default generated series and categories + chart.getChartData().getSeries().clear() + chart.getChartData().getCategories().clear() + + # Adding self.categories + chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "First Qtr")) + chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "2nd Qtr")) + chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "3rd Qtr")) + + # Adding self.series + series = chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()) + + # Now populating series data + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)) + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)) + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)) + + # Not working in self.version + # Adding self.points and setting sector color + chart.getChartData().getSeriesGroups().get_Item(0).isColorVaried(True) + + fill_type = self.FillType() + line_style = self.LineStyle() + color = self.Color() + line_dash_style = self.LineDashStyle() + preset_color = self.PresetColor() + + point = series.getDataPoints().get_Item(0) + point.getFormat().getFill().setFillType(fill_type.Solid) + point.getFormat().getFill().getSolidFillColor().setColor(color.CYAN) + + # Setting Sector border + point.getFormat().getLine().getFillFormat().setFillType(fill_type.Solid) + point.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.GRAY) + point.getFormat().getLine().setWidth(3.0) + point.getFormat().getLine().setStyle(line_style.ThinThick) + point.getFormat().getLine().setDashStyle(line_dash_style.DashDot) + + + point1 = series.getDataPoints().get_Item(1) + point1.getFormat().getFill().setFillType(fill_type.Solid) + point1.getFormat().getFill().getSolidFillColor().setColor(self.Color(preset_color.Brown)) + + # Setting Sector border + point1.getFormat().getLine().getFillFormat().setFillType(fill_type.Solid) + point1.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.BLUE) + point1.getFormat().getLine().setWidth(3.0) + point1.getFormat().getLine().setStyle(line_style.Single) + point1.getFormat().getLine().setDashStyle(line_dash_style.LargeDashDot) + + point2 = series.getDataPoints().get_Item(2) + point2.getFormat().getFill().setFillType(fill_type.Solid) + point2.getFormat().getFill().getSolidFillColor().setColor(self.Color(preset_color.Coral)) + + # Setting Sector border + point2.getFormat().getLine().getFillFormat().setFillType(fill_type.Solid) + point2.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.RED) + point2.getFormat().getLine().setWidth(2.0) + point2.getFormat().getLine().setStyle(line_style.ThinThin) + point2.getFormat().getLine().setDashStyle(line_dash_style.LargeDashDotDot) + + # Create custom labels for each of categories for self.series + lbl1 = series.getDataPoints().get_Item(0).getLabel() + + lbl1.getDataLabelFormat().setShowValue(True) + + lbl2 = series.getDataPoints().get_Item(1).getLabel() + lbl2.getDataLabelFormat().setShowValue (True) + lbl2.getDataLabelFormat().setShowLegendKey(True) + lbl2.getDataLabelFormat().setShowPercentage(True) + + lbl3 = series.getDataPoints().get_Item(2).getLabel() + lbl3.getDataLabelFormat().setShowSeriesName(True) + lbl3.getDataLabelFormat().setShowPercentage (True) + + # Showing Leader Lines for Chart + series.getLabels().getDefaultDataLabelFormat().setShowLeaderLines(True) + + # Setting Rotation Angle for Pie Chart Sectors + chart.getChartData().getSeriesGroups().get_Item(0).setFirstSliceAngle(180) + + # Save presentation with chart + save_format = self.SaveFormat + pres.save(self.dataDir + "AsposePieChart.pptx", save_format.Pptx) + + print "Set pie chart sector colors, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithCharts/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithCharts/__init__.pyc new file mode 100644 index 00000000..d5833ef1 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithCharts/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithPresentation/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithPresentation/__init__.py new file mode 100644 index 00000000..a350a6e9 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithPresentation/__init__.py @@ -0,0 +1,385 @@ +__author__ = 'fahadadeel' +import jpype + +class ConvertingToHtml: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.HtmlOptions=jpype.JClass("com.aspose.slides.HtmlOptions") + self.HtmlFormatter=jpype.JClass("com.aspose.slides.HtmlFormatter") + + + def main(self): + + self.convert_to_html() + + + def convert_to_html(self): + + # Instantiate a Presentation object that represents a PPTX file + pres=self.Presentation + pres = pres(self.dataDir + "Aspose.pptx") + + html_opt = self.HtmlOptions() + html_formatter = self.HtmlFormatter + html_opt.setHtmlFormatter(html_formatter.createDocumentFormatter("",False)) + + # Saving the presentation to HTML format + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose.html", save_format.Html, html_opt) + + print "Document has been converted, please check the output file." + +class ConvertingToNotes: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + # Converting Presentation to TIFF Notes + self.convert_to_tiff_notes() + + # Converting Presentation to TIFF Notes + self.convert_to_pdf_notes() + + def convert_to_tiff_notes(self): + + # Instantiate a Presentation object that represents a PPTX file + pres=self.Presentation + pres = pres(self.dataDir + "Aspose.pptx") + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Notes.tiff", save_format.TiffNotes) + + print "Document has been converted, please check the output file." + + + def convert_to_pdf_notes(self): + + # Instantiate a Presentation object that represents a PPTX file + pres = self.Presentation + pres = pres(self.dataDir + "Aspose.pptx") + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Notes.pdf", save_format.pdf) + + print "Document has been converted, please check the output file." + +class ConvertingToslides: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Instantiate a Presentation object that represents a PPTX file + pres = self.presentation() + pres = pres(self.dataDir + "Aspose.pptx") + + # Saving the PPTX presentation to slides format + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose.slides", save_format.slides) + + print "Document has been converted, please check the output file." + +class ConvertingToTiff: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.TiffOptions=jpype.JClass("com.aspose.slides.TiffOptions") + self.TiffCompressionTypes=jpype.JClass("com.aspose.slides.TiffCompressionTypes") + self.Dimension=jpype.JClass("java.awt.Dimension") + + def main(self): + + # Converting Presentation to TIFF with default size + self.convert_with_default_size() + + # Converting Presentation to TIFF with custom size + self.convert_with_custom_size() + + def convert_with_default_size(self): + + pres = self.Presentation + pres = pres(self.dataDir + "Aspose.pptx") + + # Saving the PPTX presentation to Tiff format + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose.tiff", save_format.Tiff) + + print "Document has been converted, please check the output file." + + def convert_with_custom_size(self): + + # Instantiate a Presentation object that represents a PPTX file + pres= self.Presentation + pres = pres(self.dataDir + "Aspose.pptx") + + # Instantiate the TiffOptions class + opts = self.TiffOptions() + + # Setting compression type + tiff_compression_types = self.TiffCompressionTypes + opts.setCompressionType (tiff_compression_types.Default) + + #Setting image DPI + opts.setDpiX(200) + opts.setDpiY(100) + + # Set Image Size + opts.setImageSize(self.Dimension(1728, 1078)) + + # Save the presentation to TIFF with specified image size + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose-Custom-Size.tiff", save_format.Tiff,opts) + + print "Document has been converted, please check the output file." + + +class ConvertingToXps: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.XpsOptions=jpype.JClass("com.aspose.slides.XpsOptions") + + def main(self): + + # Converting Presentation to TIFF with default size + self.convert_with_default_size() + + # Converting Presentation to TIFF with custom size + self.convert_with_custom_size() + + def convert_with_default_size(self): + + # Instantiate a Presentation object that represents a PPTX file + pres=self.Presentation + pres = pres(self.dataDir + "Aspose.pptx") + + # Saving the presentation to XPS format + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose.xps", save_format.Xps) + + print "Document has been converted, please check the output file." + + def convert_with_custom_size(self): + + # Instantiate a Presentation object that represents a PPTX file + pres = self.Presentation(self.dataDir + "Aspose.pptx") + + # Instantiate the TiffOptions class + opts = self.XpsOptions() + + # Save MetaFiles as PNG + opts.SaveMetafilesAsPng = True + + # Save the presentation to TIFF with specified image size + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose-Custom-Size.xps", save_format.Xps, opts) + + print "Document has been converted, please check the output file." + + +class OdpToPptx: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + pres= self.Presentation + pres = pres(self.dataDir + "Source.odp") + + # Saving the PPTX presentation to PPTX format + save_format = self.SaveFormat + pres.save(self.dataDir + "Source.pptx", save_format.Pptx) + + print "Document has been converted, please check the output file." + +class PptToPptx: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Instantiate a Presentation object that represents a PPTX file + pres= self.Presentation + pres = pres(self.dataDir + "Presentation1.pptx") + + # Saving the PPTX presentation to PPTX format + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose.pptx", save_format.Pptx) + + print "Document has been converted, please check the output file." + +class Properties: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + self.get_properties() + + # Modifying Built-in Properties + self.update_properties() + + # Adding Custom Document Properties + self.add_custom_properties() + + # Removing Document Properties + self.remove_property() + + def get_properties(self): + + # Instantiate the Presentation class that represents the presentation + pres = self.Presentation + pres = pres(self.dataDir + "HelloWorld.pptx") + + # Create a reference to IDocumentProperties object associated with Presentation + dp = pres.getDocumentProperties() + + # Display the builtin properties + print "Category : " + dp.getCategory() + print "Current Status : " + dp.getContentStatus() + print "Creation Date : " + print dp.getCreatedTime() + print "Author : " + dp.getAuthor() + print "Description : " + dp.getComments() + print "KeyWords : " + dp.getKeywords() + print "Last Modified By : " + dp.getLastSavedBy() + print "Supervisor : " + dp.getManager() + print "Modified Date : " + print dp.getLastSavedTime() + #print "Presentation Format : " + dp.getPresentationFormat() + print "Last Print Date : " + print dp.getLastPrinted() + print "Is Shared between producers : " + print dp.getSharedDoc() + print "Subject : " + dp.getSubject() + print "Title : " + dp.getTitle() + + def update_properties(self): + + # Instantiate the Presentation class that represents the presentation + pres = self.Presentation(self.dataDir + "HelloWorld.pptx") + + # Create a reference to IDocumentProperties object associated with Presentation + dp = pres.getDocumentProperties() + + # Set the builtin properties + dp.setAuthor ("Aspose.Slides for Java") + dp.setTitle ("Modifying Presentation Properties") + dp.setSubject ( "Aspose Subject") + dp.setComments ( "Aspose Description") + dp.setManager ( "Aspose Manager") + + # Save your presentation to a file + save_format = self.SaveFormat + pres.save(self.dataDir + "DocProps.pptx", save_format.Pptx) + + print "Properties have been updated, Please check output file." + + def add_custom_properties(self): + + # Instantiate the Presentation class that represents the presentation + pres = self.Presentation(self.dataDir + "HelloWorld.pptx") + + # Getting Document Properties + dp = pres.getDocumentProperties() + + # Adding Custom properties + dp.set_Item("self.Custom" , 12) + dp.set_Item("My Name","Mudassir") + dp.set_Item("Custom", 124) + + # Saving presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "CustomDemo.pptx", save_format.Pptx) + + print "Added custom properties, please check output file." + + def remove_property(self): + + # Instantiate the Presentation class that represents the presentation + pres = self.Presentation(self.dataDir + "HelloWorld.pptx") + + # Getting Document Properties + dp = pres.getDocumentProperties() + + # Getting property name at particular index + property_name = dp.getPropertyName(1) + + # Removing selected property + dp.remove(property_name) + + # Saving presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "RemoveDP.pptx", save_format.Pptx) + + print "Remove document property, please check output file." + +class Zoom: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + pres = self.Presentation() + + pres.getViewProperties().getNotesViewProperties().setScale(50) + + # Save the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "Zoom.pptx", save_format.Pptx) + + print "Set zoom value, please check the output file." + +class ConvertingToPdf: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Instantiate a Presentation object that represents a PPTX file + pres = self.Presentation(self.dataDir + "Aspose.pptx") + + # Saving the PPTX presentation to Pdf format + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose.pdf", save_format.Pdf) + + print "Document has been converted, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithPresentation/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithPresentation/__init__.pyc new file mode 100644 index 00000000..cff871a5 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithPresentation/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithShapes/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithShapes/__init__.py new file mode 100644 index 00000000..7e98d27f --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithShapes/__init__.py @@ -0,0 +1,459 @@ +__author__ = 'fahadadeel' +import jpype + +class AddingLineShape: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.HtmlOptions=jpype.JClass("com.aspose.slides.HtmlOptions") + self.HtmlFormatter=jpype.JClass("com.aspose.slides.HtmlFormatter") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + + def main(self): + # Adding Plain Line to Slide + self.add_plain_line() + + # Adding Arrow Shaped Line to Slide + self.add_arrow_line() + + def add_plain_line(self): + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add an autoshape of type line + shapeType = self.ShapeType + sld.getShapes().addAutoShape(shapeType.Line, 50, 150, 300, 0) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "LineShape.pptx", save_format.Pptx) + + print "Added plain line to slide, please check the output file." . PHP_EOL + + def add_arrow_line(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add an autoshape of type line + shapeType = self.ShapeType() + shp = sld.getShapes().addAutoShape(shapeType.Line, 50, 150, 300, 0) + + # Apply some formatting on the line + lineStyle = self.LineStyle() + shp.getLineFormat().setStyle(lineStyle.ThickBetweenThin) + shp.getLineFormat().setWidth(10) + + lineDashStyle = self.LineDashStyle() + shp.getLineFormat().setDashStyle(lineDashStyle.DashDot) + + lineArrowheadLength = self.LineArrowheadLength() + lineArrowheadStyle = self.LineArrowheadStyle() + fillType = self.FillType() + color = self.Color() + presetColor = self.PresetColor() + + shp.getLineFormat().setBeginArrowheadLength(lineArrowheadLength.Short) + shp.getLineFormat().setBeginArrowheadStyle(lineArrowheadStyle.Oval) + + shp.getLineFormat().setEndArrowheadLength(lineArrowheadLength.Long) + shp.getLineFormat().setEndArrowheadStyle(lineArrowheadStyle.Triangle) + + shp.getLineFormat().getFillFormat().setFillType(fillType.Solid) + shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(self.Color(presetColor.Maroon)) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "ArrowShape.pptx", save_format.Pptx) + + print "Added arrow shape line to slide, please check the output file." . PHP_EOL + +class FillingShapes: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.HtmlOptions=jpype.JClass("com.aspose.slides.HtmlOptions") + self.HtmlFormatter=jpype.JClass("com.aspose.slides.HtmlFormatter") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + + def main(self): + + # Filling Shapes with Pattern + self.fill_shapes_with_pattern() + + # Filling Shapes with Picture + self.fill_shapes_with_picture() + + # Filling Shapes with Solid Color + self.fill_shapes_with_solid_color() + + def fill_shapes_with_pattern(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill type to Pattern + fillType = self.FillType() + shp.getFillFormat().setFillType(fillType.Pattern) + + # Set the pattern style + patternStyle = self.PatternStyle() + shp.getFillFormat().getPatternFormat().setPatternStyle(patternStyle.Trellis) + + # Set the pattern back and fore colors + color = self.Color() + shp.getFillFormat().getPatternFormat().getBackColor().setColor(color.LIGHT_GRAY) + shp.getFillFormat().getPatternFormat().getForeColor().setColor(color.YELLOW) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectShpPatt.pptx", save_format.Pptx) + + print "Filled shapes with Pattern, please check the output file." . PHP_EOL + + def fill_shapes_with_picture(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType() + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill type to Picture + fillType = self.FillType() + shp.getFillFormat().setFillType(fillType.Picture) + + # Set the picture fill mode + pictureFillMode = self.PictureFillMode() + shp.getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Tile) + + # Set the picture + imgx = pres.getImages().addImage(self.FileInprinttream(self.File(self.dataDir + "night.jpg"))) + + shp.getFillFormat().getPictureFillFormat().getPicture().setImage(imgx) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectShpPic.pptx", save_format.Pptx) + + print "Filled shapes with Picture, please check the output file." . PHP_EOL + + def fill_shapes_with_solid_color(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType() + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill type to Solid + fillType = self.FillType() + shp.getFillFormat().setFillType(fillType.Solid) + + # Set the color of the rectangle + color = self.Color() + shp.getFillFormat().getSolidFillColor().setColor(color.YELLOW) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectShpSolid.pptx", save_format.Pptx) + + print "Filled shapes with Solid Color, please check the output file." + +class FindShape: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + # Create an instance of Presentation class + pres=self.Presentation + pres = pres(self.dataDir + 'Aspose.pptx') + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + shape = self.find_shape(slide) + + print "Shape: " + print shape + + def find_shape(self,alttext): + + #Iterating through all shapes inside the slide + i = 0 + pres=self.Presentation() + slide = pres.getSlides().get_Item(0) + while (i < slide.getShapes().size()): + # If the alternative text of the slide matches with the required one then return the shape + if (slide.getShapes().get_Item(i).getAlternativeText() == alttext): + return slide.getShapes().get_Item(i) + + i+=1 + + return None + +class FormatLines: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + + def main(self): + + # Formatting the Lines of Shapes + self.format_lines() + + # Formatting the Join Styles + self.format_join_styles() + + def format_lines(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill color of the rectangle shape + fillType = self.FillType() + color = self.Color() + shp.getFillFormat().setFillType(fillType.Solid) + shp.getFillFormat().getSolidFillColor().setColor(color.WHITE) + + # Apply some formatting on the line of the rectangle + + lineStyle = self.LineStyle() + shp.getLineFormat().setStyle(lineStyle.ThickThin) + shp.getLineFormat().setWidth(7) + + lineDashStyle = self.LineDashStyle() + shp.getLineFormat().setDashStyle(lineDashStyle.Dash) + + # set the color of the line of rectangle + shp.getLineFormat().getFillFormat().setFillType(fillType.Solid) + shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectShpLn.pptx", save_format.Pptx) + + print "Formatted lines, please check the output file." . PHP_EOL + + def format_join_styles(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add three autoshapes of rectangle type + shape_type = self.ShapeType() + shp1 = sld.getShapes().addAutoShape(shape_type.Rectangle, 50, 100, 150, 75) + shp2 = sld.getShapes().addAutoShape(shape_type.Rectangle, 300, 100, 150, 75) + shp3 = sld.getShapes().addAutoShape(shape_type.Rectangle, 50, 250, 150, 75) + + # Set the fill color of the rectangle shape + fill_type = self.FillType() + color = self.Color() + shp1.getFillFormat().setFillType(fill_type.Solid) + shp1.getFillFormat().getSolidFillColor().setColor(color.BLACK) + shp2.getFillFormat().setFillType(fill_type.Solid) + shp2.getFillFormat().getSolidFillColor().setColor(color.BLACK) + shp3.getFillFormat().setFillType(fill_type.Solid) + shp3.getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Set the line width + shp1.getLineFormat().setWidth(15) + shp2.getLineFormat().setWidth(15) + shp3.getLineFormat().setWidth (15) + + # Set the color of the line of rectangle + shp1.getLineFormat().getFillFormat().setFillType(fill_type.Solid) + shp1.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + shp2.getLineFormat().getFillFormat().setFillType(fill_type.Solid) + shp2.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + shp3.getLineFormat().getFillFormat().setFillType(fill_type.Solid) + shp3.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + + # Set the Join Style + line_join_style = self.LineJoinStyle() + shp1.getLineFormat().setJoinStyle(line_join_style.Miter) + shp2.getLineFormat().setJoinStyle(line_join_style.Bevel) + shp3.getLineFormat().setJoinStyle(line_join_style.Round) + + # Add text to each rectangle + shp1.getTextFrame().setText ("This is Miter Join Style") + shp2.getTextFrame().setText( "This is Bevel Join Style") + shp3.getTextFrame().setText ("This is Round Join Style") + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectShpLnJoin.pptx", save_format.Pptx) + + print "Formatted join styles, please check the output file." . PHP_EOL + + +class Frame: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.AudioPlayModePreset=jpype.JClass("com.aspose.slides.AudioPlayModePreset") + self.AudioVolumeMode=jpype.JClass("com.aspose.slides.AudioVolumeMode") + self.VideoPlayModePreset=jpype.JClass("com.aspose.slides.VideoPlayModePreset") + self.FileInputStream=jpype.JClass("java.io.FileInputStream") + self.File=jpype.JClass("java.io.File") + + def main(self): + + # Adding Picture Frame to Slide + self.add_picture_frame() + + # Adding Audio Frame to Slide + self.add_audio_frame() + + # Adding Audio Frame to Slide + self.add_video_frame() + + def add_picture_frame(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sId = pres.getSlides().get_Item(0) + + # Instantiate the Image class + imgx = pres.getImages().addImage(self.FileInprinttream(self.File(self.dataDir + "aspose-logo.jpg"))) + + # Add Picture Frame with height and width equivalent of Picture + shapeType = self.ShapeType() + sId.getShapes().addPictureFrame(shapeType.Rectangle, 50, 150, imgx.getWidth(), imgx.getHeight(), imgx) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectPicFrame.pptx", save_format.Pptx) + + print "Added picture frame to slide, please check the output file." + + def add_audio_frame(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sId = pres.getSlides().get_Item(0) + + # Load the wav sound file to stram + fstr=self.FileInputStream() + file=self.File() + fstr = fstr.file.new(self.dataDir + "Bass-Drum.wav") + + # Add Audio Frame + af = sId.getShapes().addAudioFrameEmbedded(50, 150, 100, 100, fstr) + + # Set Play Mode and Volume of the Audio + audioPlayModePreset=self.AudioPlayModePreset() + AudioVolumeMode=self.AudioVolumeMode() + af.setPlayMode(audioPlayModePreset.Auto) + af.setVolume(AudioVolumeMode.Loud) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.data_dir + "AudioFrameEmbed.pptx", save_format.Pptx) + + print "Added audio frame to slide, please check the output file." .PHP_EOL + + def add_video_frame(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sId = pres.getSlides().get_Item(0) + + # Add Video Frame + vf = sId.getShapes().addVideoFrame(50, 150, 300, 150, self.dataDir + "Wildlife.mp4") + + # Set Play Mode and Volume of the Video + videoPlayModePreset=self.VideoPlayModePreset() + audioVolumeMode=self.AudioVolumeMode() + vf.setPlayMode(videoPlayModePreset.Auto) + vf.setVolume(audioVolumeMode.Loud) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "VideoFrame.pptx", save_format.Pptx) + + print "Added video frame to slide, please check the output file.".PHP_EOL + +class RotatingShapes: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + + def main(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Rotate the shape to 90 degree + shp.setRotation(90) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectShpRot.pptx", save_format.Pptx) + + print "Rotated shape, please check the output file." . PHP_EOL diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithShapes/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithShapes/__init__.pyc new file mode 100644 index 00000000..834b7252 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithShapes/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.py new file mode 100644 index 00000000..9c3ed62f --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.py @@ -0,0 +1,570 @@ +__author__ = 'fahadadeel' +import jpype + +class AccessSlides: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Using Slides Collection to Access Slide by Index + AccessSlides.get_slide_by_index(self.dataDir) + + # Using Slides Collection to Access Slide by ID + AccessSlides.get_slide_by_id(self.dataDir) + + def get_slide_by_index(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Accessing a slide using its slide index + slide = pres.getSlides().get_Item(0) + + print "Slide: " . slide + + def get_slide_by_id(self): + + # Instantiate Presentation class that represents the presentation file + pres=self.Presentation() + pres = pres(self.dataDir + 'Aspose.pptx') + + # Getting Slide ID + id = pres.getSlides().get_Item(0).getSlideId() + + # Accessing Slide by ID + slide = pres.getSlideById(id) + + print "Slide: " . slide + +class AddSlides: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Instantiate SlideCollection calss + slides = pres.getSlides() + + i = 0 + while (i < pres.getLayoutSlides().size()): + + # Add an empty slide to the Slides collection + slides.addEmptySlide(pres.getLayoutSlides().get_Item(i)) + i+=1 + + + + #Do some work on the newly added slide + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "EmptySlide.pptx", save_format.Pptx) + + print "Document has been created, please check the output file." + +class Background: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.BackgroundType=jpype.JClass("com.aspose.slides.BackgroundType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.PictureFillMode=jpype.JClass("com.aspose.slides.PictureFillMode") + self.Color=jpype.JClass("java.awt.Color") + self.File=jpype.JClass("java.io.File") + self.FileInputStream=jpype.JClass("java.io.FileInputStream") + + def main(self): + + # Setting the Background Color of a Master Slide + self.set_background_color_of_master_slide() + + # Setting the Background Color of a Normal Slide + self.set_background_color_of_normal_slide() + + # Setting the Slide Background to an Image + self.set_image_as_background_color() + + def set_background_color_of_master_slide(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Set the background color of the Master Slide to Forest Green + backgroundType = self.BackgroundType + fillType = self.FillType + color = self.Color + + pres.getMasters().get_Item(0).getBackground().setType(backgroundType.OwnBackground) + pres.getMasters().get_Item(0).getBackground().getFillFormat().setFillType(fillType.Solid) + pres.getMasters().get_Item(0).getBackground().getFillFormat().getSolidFillColor().setColor(color.GREEN) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "MasterBG.pptx", save_format.Pptx) + + print "Set background color of master slide, please check the output file." + + def set_background_color_of_normal_slide(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Set the background color of the Normal slide to Blue + + backgroundType = self.BackgroundType + fillType = self.FillType + color = self.Color + + pres.getSlides().get_Item(0).getBackground().setType(backgroundType.OwnBackground) + pres.getSlides().get_Item(0).getBackground().getFillFormat().setFillType(fillType.Solid) + pres.getSlides().get_Item(0).getBackground().getFillFormat().getSolidFillColor().setColor(color.BLUE) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "ContentBG.pptx", save_format.Pptx) + + print "Set background color of normal slide, please check the output file." + + def set_image_as_background_color(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation + + # Set the background with Image + + backgroundType = self.BackgroundType + fillType = self.FillType + pictureFillMode = self.PictureFillMode + + pres.getSlides().get_Item(0).getBackground().setType(backgroundType.OwnBackground) + pres.getSlides().get_Item(0).getBackground().getFillFormat().setFillType(fillType.Picture) + pres.getSlides().get_Item(0).getBackground().getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Stretch) + + # Set the picture + imgx = pres.getImages().addImage(self.FileInputStream(self.File(self.dataDir + 'night.jpg'))) + + # Image imgx = pres.getImages().addImage(image) + # Add image to presentation's images collection + + pres.getSlides().get_Item(0).getBackground().getFillFormat().getPictureFillFormat().getPicture().setImage(imgx) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "ContentBG_Image.pptx", save_format.Pptx) + + print "Set image as background, please check the output file." + +class ChangingPosition: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Get the slide whose position is to be changed + slide = pres.getSlides().get_Item(0) + + # Set the self.position for the slide + slide.setSlideNumber(1) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose_Position.pptx", save_format.Pptx) + + print "Changes slide position, please check the output file." + +class CloneSlides: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Within the Same Presentation from One Position to the End + self.clone_to_end_of_presentation() + + # From One Position to Anther within the Same Presentation + self.clone_to_aonther_position() + + # In Another Presentation at the End of the Existing Slides + self.clone_to_other_presentation_at_end_of_existing_slide() + + def clone_to_end_of_presentation(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Clone the desired slide to the end of the collection of slides in the same presentation + slides = pres.getSlides() + slides.addClone(pres.getSlides().get_Item(0)) + + # Saving the presentation file + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose_Cloned.pptx", save_format.Pptx) + + print "Slide has been cloned, please check the output file." + + def clone_to_aonther_position(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Clone the desired slide to the end of the collection of slides in the same presentation + slides = pres.getSlides() + + # Clone the desired slide to the specified index in the same presentation + slides.insertClone(1, pres.getSlides().get_Item(0)) + + # Saving the presentation file + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose_Cloned.pptx", save_format.Pptx) + + print "Slide has been cloned, please check the output file." + + def clone_to_other_presentation_at_end_of_existing_slide(self): + + # Instantiate Presentation class that represents the presentation file + src_pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Instantiate Presentation class for destination PPTX (where slide is to be cloned) + dest_pres = self.Presentation() + + # Clone the desired slide from the source presentation to the end of the collection of slides in destination presentation + slds = dest_pres.getSlides() + + slds.addClone(src_pres.getSlides().get_Item(0)) + + # Saving the presentation file + save_format = self.SaveFormat + dest_pres.save(self.dataDir + "Aspose_dest2.pptx", save_format.Pptx) + + print "Slide has been cloned, please check the output file." + +class CreatingSvg: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.FileOutputStream=jpype.JClass("java.io.FileOutputStream") + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation + pres = pres(self.dataDir + 'Aspose.pptx') + + # Getting last slide index + last_slide_position = pres.getSlides().size() + + #Iterating through every presentation slide and generating SVG image + i = 0 + while (i < last_slide_position): + + # Accessing Slides + slide = pres.getSlides().get_Item(i) + + # Getting and saving the slide SVG image + slide.writeAsSvg(self.FileOutputStream(self.dataDir + "SvgImage#i.svg")) + + i+=1 + print "Created SVG images, please check output files." + +class Hyperlinks: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation + pres = pres(self.dataDir + 'Aspose.pptx') + + # Removing the hyperlinks from presentation + pres.getHyperlinkQueries().removeAllHyperlinks() + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Hyperlinks.pptx", save_format.Pptx) + + print "Removed hyperlinks successfully, please check the output file." + +class RemoveSlides: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Using Slides Collection to Remove Slide by Index + self.remove_slide_by_index() + + # Using Slides Collection to Remove Slide by ID + self.remove_slide_by_id() + + def remove_slide_by_index(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Accessing a slide using its slide index + slide = pres.getSlides().get_Item(0) + + # Removing a slide using its reference + pres.getSlides().remove(slide) + + # Saving the presentation file + save_format = self.SaveFormat + pres.save(self.dataDir + "Modified.pptx", save_format.Pptx) + + print "Removed slide by Index, please check the output file." + + def remove_slide_by_id(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Removing a slide using its slide index + pres.getSlides().removeAt(0) + + # Saving the presentation file + save_format = self.SaveFormat + pres.save(self.dataDir + "Modified.pptx", save_format.Pptx) + + print "Removed slide by ID, please check the output file." + +class SizeAndLayout: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.SlideSizeType=jpype.JClass("com.aspose.slides.SlideSizeType") + self.slidesOptions=jpype.JClass("com.aspose.slides.PdfOptions") + + def main(self): + + # Setting the Size and Type of a slide + self.set_size_and_type() + + # Setting the page size when generating slides + self.set_page_size_for_slides() + + def set_size_and_type(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + aux_pres = self.Presentation() + + slide = pres.getSlides().get_Item(0) + + # Set the slide size of generated presentations to that of source + aux_pres.getSlideSize().setType(pres.getSlideSize().getType()) + aux_pres.getSlideSize().setSize(pres.getSlideSize().getSize()) + + # Clone required slide + aux_pres.getSlides().addClone(pres.getSlides().get_Item(0)) + aux_pres.getSlides().removeAt(0) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Slide_Size_Type.pptx", save_format.Pptx) + + print "Set slide size and type, please check the output file." + + def set_page_size_for_slides(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Set SlideSize.Type Property + slideSizeType = self.SlideSizeType + pres.getSlideSize().setType(slideSizeType.A4Paper) + + # Set different properties of slides Options + opts = self.slidesOptions + opts.setSufficientResolution(600) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Export.slides", save_format.slides, opts) + + print "Set page size for slides, please check the output file." + +class Thumbnail: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ImageIO=jpype.JClass("javax.ImageIO") + self.File=jpype.JClass("java.io.File") + + def main(self): + + # Generating a Thumbnail from a Slide + self.create_thumbnail() + + # Generating a Thumbnail from a Slide with User Defined Dimensions + self.create_thumbnail_custom_size() + + # Generating a Thumbnail from a Slide in Notes Slides View + self.create_thumbnail_in_notes_slides_view() + + # Generating a Thumbnail of User Defined Window from a Slide + self.create_thumbnail_of_user_defined_window() + + def create_thumbnail(self): + + # Instantiate Presentation class that represents the presentation file + pres=self.Presentation + pres = pres(self.dataDir + 'Aspose.pptx') + + # Access the first slide + slide = pres.getSlides().get_Item(0) + + # Create a full scale image + image = slide.getThumbnail() + + # Save the image to disk in JPEG format + imageIO = self.ImageIO() + + imageIO.write(image, "jpeg", self.File(self.dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail, please check the output file." + + def create_thumbnail_custom_size(self): + + # Instantiate Presentation class that represents the presentation file + pres=self.Presentation() + pres = pres(self.dataDir + 'Aspose.pptx') + + # Access the first slide + slide = pres.getSlides().get_Item(0) + + # User defined dimension + desired_x = 1200 + desired_y = 800 + + # Getting scaled value of X and Y + scale_x = (1.0 / pres.getSlideSize().getSize().getWidth()) * desired_x + scale_y = (1.0 / pres.getSlideSize().getSize().getHeight()) * desired_y + + # Create a full scale image + image = slide.getThumbnail(scale_x, scale_y) + + # Save the image to disk in JPEG format + imageIO = self.ImageIO() + imageIO.write(image, "jpeg", self.File(self.dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail with custom size, please check the output file." + + def create_thumbnail_in_notes_slides_view(self): + + # Instantiate Presentation class that represents the presentation file + pres=self.Presentation() + pres = pres(self.dataDir + 'Aspose.pptx') + + # Access the first slide + slide = pres.getSlides().get_Item(0) + + # User defined dimension + desired_x = 1200 + desired_y = 800 + + # Getting scaled value of X and Y + scale_x = (1.0 / pres.getSlideSize().getSize().getWidth()) * desired_x + scale_y = (1.0 / pres.getSlideSize().getSize().getHeight()) * desired_y + + # Create a full scale image + image = slide.getNotesSlide().getThumbnail(scale_x, scale_y) + + # Save the image to disk in JPEG format + imageIO = self.ImageIO() + imageIO.write(image, "jpeg", self.File(self.dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail in notes slides view, please check the output file." + + def create_thumbnail_of_user_defined_window(self): + + # Instantiate Presentation class that represents the presentation file + pres=self.Presentation() + pres = pres(self.dataDir + 'Aspose.pptx') + + # Access the first slide + slide = pres.getSlides().get_Item(0) + + # Create a full scale image + image = slide.getThumbnail(1,1) + + # Getting the image of desired window inside generated slide thumnbnail + # BufferedImage window = image.getSubimage(windowX, windowY, windowsWidth, windowHeight) + window_image = image.getSubimage(100, 100, 200, 200) + + # Save the image to disk in JPEG format + imageIO = self.ImageIO() + imageIO.write(image, "jpeg", self.File(self.dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail of user defined window, please check the output file." + +class Transitions: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.TransitionType=jpype.JClass("com.aspose.slides.TransitionType") + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + transition_type = self.TransitionType + + # Apply circle type transition on slide 1 + pres.getSlides().get_Item(0).getSlideShowTransition().setType(transition_type.Circle) + + # Apply comb type transition on slide 2 + pres.getSlides().get_Item(0).getSlideShowTransition().setType(transition_type.Comb) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "SimpleTransition.pptx", save_format.Pptx) + + print "Done with simple transition, please check the output file." + diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.pyc new file mode 100644 index 00000000..3d1b814d Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSmartArt/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSmartArt/__init__.py new file mode 100644 index 00000000..8165f2ca --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSmartArt/__init__.py @@ -0,0 +1,79 @@ +__author__ = 'fahadadeel' +import jpype + +class AddSmartArt: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.SmartArtLayoutType=jpype.JClass("com.aspose.slides.SmartArtLayoutType") + + + def main(self): + + self.create_smartart_shape() + + + def create_smartart_shape(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add Smart Art Shape + smartArtLayoutType = self.SmartArtLayoutType + smart = slide.getShapes().addSmartArt(0, 0, 400, 400, smartArtLayoutType.BasicBlockList) + + # Write the presentation as a PPTX file + saveFormat = self.SaveFormat + pres.save(self.dataDir + "SimpleSmartArt.pptx", saveFormat.Pptx) + + print "Created smartart shape, please check the output file." + + +class FillFormat: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.SmartArtLayoutType=jpype.JClass("com.aspose.slides.SmartArtLayoutType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + + + def main(self): + + self.create_smartart_shape() + + + def create_smartart_shape(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Adding SmartArt shape and nodes + smartArtLayoutType = self.SmartArtLayoutType + chevron = slide.getShapes().addSmartArt(10, 10, 800, 60, smartArtLayoutType.ClosedChevronProcess) + node = chevron.getAllNodes().addNode() + node.getTextFrame().setText("Some text") + + # Setting node fill color + color = self.Color + fillType = self.FillType + item = node.getShapes().get_Item(0) + item.getFillFormat().setFillType(fillType.Solid) + item.getFillFormat().getSolidFillColor().setColor(color.RED) + + # Write the presentation as a PPTX file + saveFormat = self.SaveFormat + pres.save(dataDir + "FillFormat.pptx", saveFormat.Pptx) + + print "Set fill format for smartart node, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSmartArt/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSmartArt/__init__.pyc new file mode 100644 index 00000000..afe046c7 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSmartArt/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithTables/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithTables/__init__.py new file mode 100644 index 00000000..2e190f00 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithTables/__init__.py @@ -0,0 +1,286 @@ +__author__ = 'fahadadeel' +import jpype + +class AddImage: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.TextAnchorType=jpype.JClass("com.aspose.slides.TextAnchorType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.TextVerticalType=jpype.JClass("com.aspose.slides.TextVerticalType") + self.ImageIO=jpype.JClass("javax.ImageIO") + self.Color=jpype.JClass("java.awt.Color") + + + def main(self): + + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Define co lumns with widths and rows with heights + dbl_cols = [150,150,150,150] + dbl_rows = [100,100,100,100,90] + + # Add table shape to slide + tbl = sld.getShapes().addTable(50, 50, dbl_cols, dbl_rows) + + # Creating a Buffered Image object to hold the image file + imageIO = ImageIO() + image = imageIO.read(File(dataDir + "aspose-logo.jpg")) + imgx1 = pres.getImages().addImage(image) + + fillType=FillType() + pictureFillMode=PictureFillMode() + tbl.get_Item(0,0).getFillFormat().setFillType(fillType.Picture) + tbl.get_Item(0,0).getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Stretch) + tbl.get_Item(0,0).getFillFormat().getPictureFillFormat().getPicture().setImage(imgx1) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(self.dataDir + "AddImage.pptx", save_format.Pptx) + + print "Added image, please check the output file." + + +class AlignText: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.TextAnchorType=jpype.JClass("com.aspose.slides.TextAnchorType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.TextVerticalType=jpype.JClass("com.aspose.slides.TextVerticalType") + self.ImageIO=jpype.JClass("javax.ImageIO") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + pres = self.Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Define columns with widths and rows with heights + dbl_cols = [120, 120, 120, 120] + dbl_rows = [100, 100, 100, 100] + + # Add table shape to slide + tbl = slide.getShapes().addTable(100, 50, dbl_cols, dbl_rows) + + # Add text to the merged cell + tbl.getRows().get_Item(0).get_Item(1).getTextFrame().setText("10") + tbl.getRows().get_Item(0).get_Item(2).getTextFrame().setText("20") + tbl.getRows().get_Item(0).get_Item(3).getTextFrame().setText("30") + + # Accessing the text frame + txt_frame = tbl.getRows().get_Item(0).get_Item(0).getTextFrame() + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + + fillType=FillType() + color=Color() + + portion = para.getPortions().get_Item(0) + portion.setText("Text here") + portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Aligning the text vertically + textVerticalType=TextVerticalType() + cell = tbl.getRows().get_Item(0).get_Item(0) + textAnchorType=TextAnchorType() + cell.setTextAnchorType(textAnchorType.Center) + cell.setTextVerticalType(textVerticalType.Vertical270) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "AlignText.pptx", save_format.Pptx) + + print "Aligned Text, please check the output file." + + +class CloneRowColumn: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Define columns with widths and rows with heights + dbl_cols = [50, 50, 50] + dbl_rows = [50, 30, 30, 30] + + # Add table shape to slide + tbl = sld.getShapes().addTable(100, 50, dbl_cols, dbl_rows) + + fill_type = self.FillType + color = self.Color + + # Set border format for each cell + row = 0 + while (row < tbl.getRows().size()): + cell = 0 + while (cell < tbl.getRows().get_Item(row).size()): + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().setWidth(5) + + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().setWidth(5) + + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().setWidth(5) + + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().setWidth(5) + + cell += 1 + + row += 1 + + + tbl.getColumns().get_Item(0).get_Item(0).getTextFrame().setText("00") + tbl.getColumns().get_Item(0).get_Item(1).getTextFrame().setText("01") + tbl.getColumns().get_Item(0).get_Item(2).getTextFrame().setText("02") + tbl.getColumns().get_Item(0).get_Item(3).getTextFrame().setText("03") + tbl.getColumns().get_Item(1).get_Item(0).getTextFrame().setText("10") + tbl.getColumns().get_Item(2).get_Item(0).getTextFrame().setText("20") + tbl.getColumns().get_Item(1).get_Item(1).getTextFrame().setText("11") + tbl.getColumns().get_Item(2).get_Item(1).getTextFrame().setText("21") + + # AddClone adds a row in the end of the table + tbl.getRows().addClone(tbl.getRows().get_Item(0) , False) + + # AddClone adds a column in the end of the table + tbl.getColumns().addClone(tbl.getColumns().get_Item(0), False) + + # InsertClone adds a row at specific position in a table + tbl.getRows().insertClone(2, tbl.getRows().get_Item(0), False) + + # InsertClone adds a row at specific position in a table + tbl.getColumns().insertClone(2, tbl.getColumns().get_Item(0), False) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "CloneRowColumn.pptx", save_format.Pptx) + + print "Cloned Row & Column from table, please check the output file." + +class CreateTable: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Define columns with widths and rows with heights + dblCols = [50, 50, 50] + dblRows = [50, 30, 30, 30, 30] + + # Add table shape to slide + tbl = sld.getShapes().addTable(100, 50, dblCols, dblRows) + + fill_type = self.FillType + color = self.Color + + # Set border format for each cell + row = 0 + while (row < tbl.getRows().size()): + cell = 0 + while (cell < tbl.getRows().get_Item(row).size()): + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().setWidth(5) + + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().setWidth(5) + + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().setWidth(5) + + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().setWidth(5) + + cell+=1 + + row+=1 + + + # Merge cells 1 & 2 of row 1 + tbl.mergeCells(tbl.getRows().get_Item(0).get_Item(0), tbl.getRows().get_Item(1).get_Item(0), False) + + # Add text to the merged cell + tbl.getRows().get_Item(0).get_Item(0).getTextFrame().setText("Merged Cells") + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(self.dataDir + "CreateTable.pptx", save_format.Pptx) + + print "Created table, please check the output file." + +class RemoveRowColumn: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + pres = self.Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + col_width = [100, 50, 30] + row_height = [30, 50, 30] + + table = slide.getShapes().addTable(100, 100, col_width, row_height) + + table.getRows().removeAt(1, False) + table.getColumns().removeAt(1, False) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "RemoveRowColumn.pptx", save_format.Pptx) + + print "Removed Row & Column from table, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithTables/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithTables/__init__.pyc new file mode 100644 index 00000000..1eba3b00 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithTables/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithText/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithText/__init__.py new file mode 100644 index 00000000..e2ebb143 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithText/__init__.py @@ -0,0 +1,512 @@ +__author__ = 'fahadadeel' +import jpype + +class CreateTextBox: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + + def main(self): + + # Creating a TextBox on Slide + self.create_textbox() + + # Creating a TextBox with Hyperlink + self.create_textbox_with_hyperlink() + + def create_textbox(self): + + # Create an instance of Presentation class + pres = self.Presentation + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 150, 50) + + # Add TextFrame to the Rectangle + shp.addTextFrame(" ") + + # Accessing the text frame + txt_frame = shp.getTextFrame() + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + portion = para.getPortions().get_Item(0) + + # Set Text + portion.setText("Aspose TextBox") + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "TextBox.pptx", save_format.Pptx) + + print "Created TextBox, please check the output file." + + def create_textbox_with_hyperlink(self): + + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType + pptxShape = sld.getShapes().addAutoShape(shapeType.Rectangle, 150, 150, 150, 50) + + # Cast the shape to AutoShape + pptxAutoShape = pptxShape + + # Access ITextFrame associated with the AutoShape + pptxAutoShape.addTextFrame("") + + text_frame = pptxAutoShape.getTextFrame() + + # Add some text to the frame + text_frame.getParagraphs().get_Item(0).getPortions().get_Item(0).setText("Aspose.Slides") + + #Set Hyperlink for the portion text + hypman = text_frame.getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getHyperlinkManager() + hypman.setExternalHyperlinkClick("http://www.aspose.com") + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "hLinkPPTX.pptx", save_format.Pptx) + + print "Created TextBox with Hyperlink, please check the output file." + +class ManageText: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.TextAutofitType=jpype.JClass("com.aspose.slides.TextAutofitType") + self.TextAnchorType=jpype.JClass("com.aspose.slides.TextAnchorType") + self.TextVerticalType=jpype.JClass("com.aspose.slides.TextVerticalType") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + # Setting the AutofitType property of text frame + self.set_autofittype_of_text() + + # Setting the anchor of TextFrame + self.set_anchor_of_text() + + # Rotating the text + self.rotate_text() + + def set_autofittype_of_text(self): + + # Create an instance of Presentation class + pres = self.Presentation + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 350, 350) + + # Add TextFrame to the Rectangle + fillType = self.FillType + ashp.addTextFrame(" ") + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Accessing the text frame + txt_frame = ashp.getTextFrame() + + # Setting text autofit type + textAutofitType=TextAutofitType + txt_frame.getTextFrameFormat().setAutofitType(textAutofitType.Shape) + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + color = self.Color + portion = para.getPortions().get_Item(0) + portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.") + portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "formatText.pptx", save_format.Pptx) + + print "Set autofittype of text, please check the output file." + + def set_anchor_of_text(self): + + # Create an instance of Presentation class + pres = self.Presentation + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 350, 350) + + # Add TextFrame to the Rectangle + fillType = self.FillType + ashp.addTextFrame(" ") + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Accessing the text frame + txt_frame = ashp.getTextFrame() + + # Setting text anchoring to bottom + textAnchorType=TextAnchorType + txt_frame.getTextFrameFormat().setAnchoringType(textAnchorType.Bottom) + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + color = self.Color + portion = para.getPortions().get_Item(0) + portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.") + portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "AnchorText.pptx", save_format.Pptx) + + print "Set anchor of text, please check the output file." + + def rotate_text(self): + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 350, 350) + + # Add TextFrame to the Rectangle + fillType=FillType + ashp.addTextFrame(" ") + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Accessing the text frame + txt_frame = ashp.getTextFrame() + + # Setting text Vertical type + textVerticalType=TextVerticalType + txt_frame.getTextFrameFormat().setTextVerticalType(textVerticalType.Vertical270) + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + portion = para.getPortions().get_Item(0) + color=Color + portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.") + portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "VerticleText.pptx", save_format.Pptx) + + print "Done with text rotation, please check the output file." + +class ReplaceText: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Create an instance of Presentation class + pres = self.Presentation(self.dataDir + 'Welcome.pptx') + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Change the text of each placeholder + shp = sld.getShapes().get_Item(0) + shp.getTextFrame().setText("This is Placeholder") + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "Welcome_PH.pptx", save_format.Pptx) + + print "Replaced text, please check the output file." + +class ShadowEffects: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.RectangleAlignment=jpype.JClass("com.aspose.slides.RectangleAlignment") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + # Create an instance of Presentation class + pres = self.Presentation + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + shp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 150, 50) + + # Add TextFrame to the Rectangle + shp.addTextFrame("Aspose TextBox") + + # Disable shape fill in case we want to get shadow of text + fillType = self.FillType + shp.getFillFormat().setFillType(fillType.NoFill) + + # Add outer shadow and set all necessary parameters + shp.getEffectFormat().enableOuterShadowEffect() + shadow = shp.getEffectFormat().getOuterShadowEffect() + shadow.setBlurRadius(4.0) + shadow.setDirection(45) + shadow.setDistance(3) + + rectangleAlignment=RectangleAlignment + + color = self.Color + + shadow.setRectangleAlign(rectangleAlignment.TopLeft) + shadow.getShadowColor().setColor(color.black) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "OutShadow.pptx", save_format.Pptx) + + print "Applied shadow effects on text, please check the output file." + +class TextFont: + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.FontData=jpype.JClass("com.aspose.slides.FontData") + self.NullableBool=jpype.JClass("com.aspose.slides.NullableBool") + self.TextUnderlineType=jpype.JClass("com.aspose.slides.TextUnderlineType") + self.LoadFormat=jpype.JClass("com.aspose.slides.LoadFormat") + self.LoadOptions=jpype.JClass("com.aspose.slides.LoadOptions") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + # Managing Font Related Properties + self.font_properties() + + # Managing Font Family of Text + self.font_family_of_text() + + # Using Default Fonts for Rendering Presentation + self.set_default_font_for_rendering() + + def font_properties(self): + + # Create an instance of Presentation class + pres = self.Presentation(self.dataDir + 'Welcome.pptx') + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Accessing the first and second placeholder in the slide and typecasting it as AutoShape + tf1 = slide.getShapes().get_Item(0).getTextFrame() + tf2 = slide.getShapes().get_Item(1).getTextFrame() + + # Accessing the first Paragraph + para1 = tf1.getParagraphs().get_Item(0) + para2 = tf2.getParagraphs().get_Item(0) + + # Accessing the first portion + port1 = para1.getPortions().get_Item(0) + port2 = para2.getPortions().get_Item(0) + + # Define fonts + fd1 = self.FontData("Elephant") + fd2 = self.FontData("Castellar") + + # Assign fonts to portion + port1.getPortionFormat().setLatinFont(fd1) + port2.getPortionFormat().setLatinFont(fd2) + + # Set font to Bold + nullableBool = self.NullableBool + port1.getPortionFormat().setFontBold(nullableBool.True) + port2.getPortionFormat().setFontBold(nullableBool.True) + + # Set font to Italic + port1.getPortionFormat().setFontItalic(nullableBool.True) + port2.getPortionFormat().setFontItalic(nullableBool.True) + + # Set font color + fillType = self.FillType + color = self.Color + port1.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + port1.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + port2.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + port2.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GREEN) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "WelcomeFont.pptx", save_format.Pptx) + + print "Done with font properties, please check the output file." + + def font_family_of_text(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType = self.ShapeType + ashp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 50, 200, 50) + + # Remove any fill style associated with the AutoShape + fillType=FillType + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Access the TextFrame associated with the AutoShape + tf = ashp.getTextFrame() + tf.setText("Aspose TextBox") + + # Access the Portion associated with the TextFrame + port = tf.getParagraphs().get_Item(0).getPortions().get_Item(0) + + # Set the Font for the Portion + port.getPortionFormat().setLatinFont(FontData("Times New Roman")) + + # Set Bold property of the Font + nullableBool=NullableBool + port.getPortionFormat().setFontBold(nullableBool.True) + + # Set Italic property of the Font + port.getPortionFormat().setFontItalic(nullableBool.True) + + # Set Underline property of the Font + textUnderlineType=TextUnderlineType + port.getPortionFormat().setFontUnderline(textUnderlineType.Single) + + # Set the Height of the Font + port.getPortionFormat().setFontHeight(25) + + # Set the color of the Font + color = self.Color + port.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + port.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "FontFamilyOfText.pptx", save_format.Pptx) + + print "Done with font family for text, please check the output file." + + + def set_default_font_for_rendering(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/TextFont/' + # Use load options to define the default regualr and asian fonts + + loadFormat = LoadFormat + lo = LoadOptions(loadFormat.Auto) + lo.setDefaultRegularFont("Wingdings") + lo.setDefaultAsianFont("Wingdings") + + # Create an instance of Presentation class + pres = Presentation(self.dataDir + 'input.pptx') + + # Generate PDF + save_format = self.SaveFormat + pres.save(self.dataDir + "output.pdf", save_format.Pdf) + + print "Done with font family for text, please check the output file." + +class WordArt: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.RectangleAlignment=jpype.JClass("com.aspose.slides.RectangleAlignment") + self.ColorType=jpype.JClass("com.aspose.slides.ColorType") + self.SchemeColor=jpype.JClass("com.aspose.slides.SchemeColor") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + # Create an instance of Presentation class + pres = self.Presentation + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType = self.ShapeType + fillType = self.FillType + ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 400, 300) + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Add TextFrame to the Rectangle + ashp.addTextFrame("Aspose TextBox") + port = ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0) + pf = port.getPortionFormat() + pf.setFontHeight(50) + + # Enable InnerShadowEffect + ef = pf.getEffectFormat() + ef.enableInnerShadowEffect() + + # Set all necessary parameters + ef.getInnerShadowEffect().setBlurRadius(8.0) + ef.getInnerShadowEffect().setDirection(90) + ef.getInnerShadowEffect().setDistance(6.0) + ef.getInnerShadowEffect().getShadowColor().setB(189) + + # Set ColorType as Scheme + colorType = self.ColorType + ef.getInnerShadowEffect().getShadowColor().setColorType(colorType.Scheme) + + # Set Scheme Color + schemeColor = self.SchemeColor + ef.getInnerShadowEffect().getShadowColor().setSchemeColor(schemeColor.Accent1) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "WordArt.pptx", save_format.Pptx) + + print "Done with word art, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithText/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithText/__init__.pyc new file mode 100644 index 00000000..48e45b18 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithText/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/aspose_slides_java_for_python.py b/Plugins/Aspose-Slides-Java-for-Python/aspose_slides_java_for_python.py new file mode 100644 index 00000000..a90e3ed0 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/aspose_slides_java_for_python.py @@ -0,0 +1,9 @@ +# To change this license header, choose License Headers in Project Properties. +# To change this template file, choose Tools | Templates +# and open the template in the editor. + +__author__ = "nhp09" +__date__ = "$Apr 4, 2016 10:38:05 AM$" + +if __name__ == "__main__": + print "Hello World" diff --git a/Plugins/Aspose-Slides-Java-for-Python/setup.py b/Plugins/Aspose-Slides-Java-for-Python/setup.py new file mode 100644 index 00000000..31bcef1c --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/setup.py @@ -0,0 +1,19 @@ +__author__ = 'fahadadeel' + +from setuptools import setup, find_packages + +setup( + name = 'aspose-slides-java-for-python', + packages = find_packages(), + version = '1.0', + description = 'Aspose.Slides Java for Python is a project that demonstrates / provides the Aspose.Slides for Java API usage examples in Python.', + author='Fahad Adeel', + author_email='slides@aspose.com', + url='http://www.aspose.com/docs/display/slidesjava/Aspose.Slides+Java+for+Python', + classifiers=[ + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent' + ] +) \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/IntroductionToPresentation/HelloWorld/HelloWorld.py b/Plugins/Aspose-Slides-Java-for-Python/tests/IntroductionToPresentation/HelloWorld/HelloWorld.py new file mode 100644 index 00000000..f8262bcf --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/IntroductionToPresentation/HelloWorld/HelloWorld.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from IntroductionToPresentation import HelloWorld + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = HelloWorld('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/IntroductionToPresentation/HelloWorld/data/HelloWorld.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/IntroductionToPresentation/HelloWorld/data/HelloWorld.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/IntroductionToPresentation/HelloWorld/data/HelloWorld.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartLegend/ChartLegend.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartLegend/ChartLegend.py new file mode 100644 index 00000000..2eb020cc --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartLegend/ChartLegend.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import ChartLegend + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ChartLegend('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartProperties/ChartProperties.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartProperties/ChartProperties.py new file mode 100644 index 00000000..3c42f31a --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartProperties/ChartProperties.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import ChartProperties + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ChartProperties('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartSeries/ChartSeries.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartSeries/ChartSeries.py new file mode 100644 index 00000000..29f3c994 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartSeries/ChartSeries.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import ChartSeries + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ChartSeries('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartTrendLines/ChartTrendLines.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartTrendLines/ChartTrendLines.py new file mode 100644 index 00000000..4ea2ab8e --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartTrendLines/ChartTrendLines.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import ChartTrendLines + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ChartTrendLines('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/CreateChart/CreateChart.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/CreateChart/CreateChart.py new file mode 100644 index 00000000..982d4dab --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/CreateChart/CreateChart.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import CreateChart + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = CreateChart('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ErrorBars/ErrorBars.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ErrorBars/ErrorBars.py new file mode 100644 index 00000000..1b441596 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ErrorBars/ErrorBars.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import ErrorBars + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ErrorBars('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/ExistingChart.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/ExistingChart.py new file mode 100644 index 00000000..95f7f5ba --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/ExistingChart.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import ExistingChart + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ExistingChart('data/') +testObject.main() \ No newline at end of file diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Charts/existingchart/AsposeChart.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/data/AsposeChart.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Charts/existingchart/AsposeChart.pptx rename to Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/data/AsposeChart.pptx diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/data/AsposeChartModified.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/data/AsposeChartModified.pptx new file mode 100644 index 00000000..a0e4ee8d Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/data/AsposeChartModified.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/FormattingChartEntities/FormattingChartEntities.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/FormattingChartEntities/FormattingChartEntities.py new file mode 100644 index 00000000..cfac1c9c --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/FormattingChartEntities/FormattingChartEntities.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import FormattingChartEntities + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = FormattingChartEntities('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/SetLabelDistance/SetLabelDistance.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/SetLabelDistance/SetLabelDistance.py new file mode 100644 index 00000000..8448c0e7 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/SetLabelDistance/SetLabelDistance.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import SetLabelDistance + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = SetLabelDistance('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/SetPieChartColors/SetPieChartColors.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/SetPieChartColors/SetPieChartColors.py new file mode 100644 index 00000000..4b7c3f4e --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/SetPieChartColors/SetPieChartColors.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import SetPieChartColors + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = SetPieChartColors('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/ConvertingToHtml.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/ConvertingToHtml.py new file mode 100644 index 00000000..46a220fe --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/ConvertingToHtml.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import ConvertingToHtml + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ConvertingToHtml('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/data/Aspose.html b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/data/Aspose.html new file mode 100644 index 00000000..5d27ce55 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/data/Aspose.html @@ -0,0 +1,30 @@ + + + + + + + +
+ + + + + Hello World + + + + Evaluation only. +Created with Aspose.Slides for Java 15.6.0.0 +Copyright 2004-2015 Aspose Pty Ltd. + + + +Evaluation only. +Created with Aspose.Slides for Java 15.5.1.0. +Copyright 2004-2015 Aspose Pty Ltd. + + +
+ \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/ConvertingToNotes.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/ConvertingToNotes.py new file mode 100644 index 00000000..15678e07 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/ConvertingToNotes.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import ConvertingToNotes + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ConvertingToNotes('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/data/Notes.tiff b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/data/Notes.tiff new file mode 100644 index 00000000..fe5808ce Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/data/Notes.tiff differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/ConvertingToPdf.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/ConvertingToPdf.py new file mode 100644 index 00000000..cebcc26b --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/ConvertingToPdf.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import ConvertingToPdf + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ConvertingToPdf('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/data/Aspose.pdf b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/data/Aspose.pdf new file mode 100644 index 00000000..103d9151 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/data/Aspose.pdf differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/ConvertingToTiff.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/ConvertingToTiff.py new file mode 100644 index 00000000..6ec3810b --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/ConvertingToTiff.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import ConvertingToTiff + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ConvertingToTiff('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose-Custom-Size.tiff b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose-Custom-Size.tiff new file mode 100644 index 00000000..caa34235 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose-Custom-Size.tiff differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose.tiff b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose.tiff new file mode 100644 index 00000000..2e00362a Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose.tiff differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/ConvertingToXps.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/ConvertingToXps.py new file mode 100644 index 00000000..ac2bdba0 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/ConvertingToXps.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import ConvertingToXps + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ConvertingToXps('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose-Custom-Size.xps b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose-Custom-Size.xps new file mode 100644 index 00000000..a23f6632 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose-Custom-Size.xps differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose.xps b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose.xps new file mode 100644 index 00000000..ec643684 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose.xps differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/OdpToPptx.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/OdpToPptx.py new file mode 100644 index 00000000..9320aa5c --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/OdpToPptx.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import OdpToPptx + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = OdpToPptx('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/data/Source.odp b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/data/Source.odp new file mode 100644 index 00000000..e68d10c6 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/data/Source.odp differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/data/Source.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/data/Source.pptx new file mode 100644 index 00000000..775b2406 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/data/Source.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/PptToPptx.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/PptToPptx.py new file mode 100644 index 00000000..3a2e52c0 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/PptToPptx.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import PptToPptx + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = PptToPptx('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/data/Aspose.pptx new file mode 100644 index 00000000..0738bb7c Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/data/Presentation1.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/data/Presentation1.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/data/Presentation1.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/Properties.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/Properties.py new file mode 100644 index 00000000..c8c461aa --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/Properties.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import Properties + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Properties('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/CustomDemo.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/CustomDemo.pptx new file mode 100644 index 00000000..0d3d031c Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/CustomDemo.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/DocProps.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/DocProps.pptx new file mode 100644 index 00000000..bdc0470e Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/DocProps.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/HelloWorld.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/HelloWorld.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/HelloWorld.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Zoom/Zoom.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Zoom/Zoom.py new file mode 100644 index 00000000..1368e495 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Zoom/Zoom.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import Zoom + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Zoom('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Zoom/data/Zoom.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Zoom/data/Zoom.pptx new file mode 100644 index 00000000..c80f520f Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Zoom/data/Zoom.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/AddingLineShape/AddingLineShape.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/AddingLineShape/AddingLineShape.py new file mode 100644 index 00000000..d14ee6fa --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/AddingLineShape/AddingLineShape.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import AddingLineShape + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = AddingLineShape('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FillingShapes/FillingShapes.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FillingShapes/FillingShapes.py new file mode 100644 index 00000000..2858dd70 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FillingShapes/FillingShapes.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import FillingShapes + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = FillingShapes('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FindShape/FindShape.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FindShape/FindShape.py new file mode 100644 index 00000000..b1aab410 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FindShape/FindShape.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import FindShape + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = FindShape('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FindShape/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FindShape/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FindShape/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FormatLines/FormatLines.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FormatLines/FormatLines.py new file mode 100644 index 00000000..5c1316dd --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FormatLines/FormatLines.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import FormatLines + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = FormatLines('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/Frame/Frame.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/Frame/Frame.py new file mode 100644 index 00000000..ecb0671f --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/Frame/Frame.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import Frame + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Frame('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/RotatingShapes/RotatingShapes.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/RotatingShapes/RotatingShapes.py new file mode 100644 index 00000000..a18a935c --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/RotatingShapes/RotatingShapes.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import RotatingShapes + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = RotatingShapes('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AccessSlides/AccessSlides.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AccessSlides/AccessSlides.py new file mode 100644 index 00000000..a18a935c --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AccessSlides/AccessSlides.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import RotatingShapes + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = RotatingShapes('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AccessSlides/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AccessSlides/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AccessSlides/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/AddSlides.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/AddSlides.py new file mode 100644 index 00000000..a5f3e17b --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/AddSlides.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import AddSlides + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = AddSlides('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/data/EmptySlide.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/data/EmptySlide.pptx new file mode 100644 index 00000000..d704a73e Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/data/EmptySlide.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/Background.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/Background.py new file mode 100644 index 00000000..1e3b569f --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/Background.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import Background + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Background('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/data/ContentBG.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/data/ContentBG.pptx new file mode 100644 index 00000000..6675dbff Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/data/ContentBG.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/data/MasterBG.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/data/MasterBG.pptx new file mode 100644 index 00000000..8f8d3ace Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/data/MasterBG.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/ChangingPosition.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/ChangingPosition.py new file mode 100644 index 00000000..e1f60d8f --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/ChangingPosition.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import ChangingPosition + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ChangingPosition('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/data/Aspose_Position.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/data/Aspose_Position.pptx new file mode 100644 index 00000000..75598f9e Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/data/Aspose_Position.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/CloneSlides.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/CloneSlides.py new file mode 100644 index 00000000..950cb32d --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/CloneSlides.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import CloneSlides + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = CloneSlides('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose_Cloned.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose_Cloned.pptx new file mode 100644 index 00000000..bac5aa3d Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose_Cloned.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose_dest2.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose_dest2.pptx new file mode 100644 index 00000000..cc1152d8 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose_dest2.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/CreatingSvg.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/CreatingSvg.py new file mode 100644 index 00000000..e0919d68 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/CreatingSvg.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import CreatingSvg + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = CreatingSvg('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/data/SvgImage#i.svg b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/data/SvgImage#i.svg new file mode 100644 index 00000000..10fde5f6 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/data/SvgImage#i.svg @@ -0,0 +1,23 @@ + + + + + + + + Hello World + + + + Evaluation only. +Created with Aspose.Slides for Java 15.6.0.0 +Copyright 2004-2015 Aspose Pty Ltd. + + + +Evaluation only. +Created with Aspose.Slides for Java 15.5.1.0. +Copyright 2004-2015 Aspose Pty Ltd. + + + \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/Hyperlinks.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/Hyperlinks.py new file mode 100644 index 00000000..1f74b452 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/Hyperlinks.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import Hyperlinks + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Hyperlinks('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/data/Hyperlinks.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/data/Hyperlinks.pptx new file mode 100644 index 00000000..23f147b0 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/data/Hyperlinks.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/RemoveSlides.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/RemoveSlides.py new file mode 100644 index 00000000..5682ed0a --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/RemoveSlides.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import RemoveSlides + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = RemoveSlides('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/data/Modified.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/data/Modified.pptx new file mode 100644 index 00000000..a7393c65 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/data/Modified.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/SizeAndLayout.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/SizeAndLayout.py new file mode 100644 index 00000000..46c0c71b --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/SizeAndLayout.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import SizeAndLayout + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = SizeAndLayout('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/data/Slide_Size_Type.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/data/Slide_Size_Type.pptx new file mode 100644 index 00000000..cd44a754 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/data/Slide_Size_Type.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Thumbnail/Thumbnail.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Thumbnail/Thumbnail.py new file mode 100644 index 00000000..0510706b --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Thumbnail/Thumbnail.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import Thumbnail + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Thumbnail('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Thumbnail/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Thumbnail/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Thumbnail/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/Transitions.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/Transitions.py new file mode 100644 index 00000000..c7d34fa3 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/Transitions.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import Transitions + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Transitions('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/data/SimpleTransition.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/data/SimpleTransition.pptx new file mode 100644 index 00000000..88faf24f Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/data/SimpleTransition.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/AddSmartArt/AddSmartArt.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/AddSmartArt/AddSmartArt.py new file mode 100644 index 00000000..e64cc05f --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/AddSmartArt/AddSmartArt.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSmartArt import AddSmartArt + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = AddSmartArt('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/AddSmartArt/data/SimpleSmartArt.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/AddSmartArt/data/SimpleSmartArt.pptx new file mode 100644 index 00000000..f143ae79 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/AddSmartArt/data/SimpleSmartArt.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/FillFormat/FillFormat.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/FillFormat/FillFormat.py new file mode 100644 index 00000000..1b60ea8c --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/FillFormat/FillFormat.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSmartArt import FillFormat + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = FillFormat('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/FillFormat/data/FillFormat.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/FillFormat/data/FillFormat.pptx new file mode 100644 index 00000000..e76f2110 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/FillFormat/data/FillFormat.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/AddImage/AddImage.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/AddImage/AddImage.py new file mode 100644 index 00000000..734beaca --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/AddImage/AddImage.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithTables import AddImage + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = AddImage('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/AlignText/AlignText.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/AlignText/AlignText.py new file mode 100644 index 00000000..0d2757e1 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/AlignText/AlignText.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithTables import AlignText + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = AlignText('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CloneRowColumn/CloneRowColumn.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CloneRowColumn/CloneRowColumn.py new file mode 100644 index 00000000..8bba5a19 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CloneRowColumn/CloneRowColumn.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithTables import CloneRowColumn + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = CloneRowColumn('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CloneRowColumn/data/CloneRowColumn.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CloneRowColumn/data/CloneRowColumn.pptx new file mode 100644 index 00000000..964f407c Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CloneRowColumn/data/CloneRowColumn.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CreateTable/CreateTable.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CreateTable/CreateTable.py new file mode 100644 index 00000000..d7172cca --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CreateTable/CreateTable.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithTables import CreateTable + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = CreateTable('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CreateTable/data/CreateTable.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CreateTable/data/CreateTable.pptx new file mode 100644 index 00000000..55dcb020 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CreateTable/data/CreateTable.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/RemoveRowColumn/RemoveRowColumn.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/RemoveRowColumn/RemoveRowColumn.py new file mode 100644 index 00000000..36ab1c18 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/RemoveRowColumn/RemoveRowColumn.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithTables import RemoveRowColumn + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = RemoveRowColumn('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/RemoveRowColumn/data/RemoveRowColumn.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/RemoveRowColumn/data/RemoveRowColumn.pptx new file mode 100644 index 00000000..56b2e7fc Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/RemoveRowColumn/data/RemoveRowColumn.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/CreateTextBox.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/CreateTextBox.py new file mode 100644 index 00000000..c4392df5 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/CreateTextBox.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithText import CreateTextBox + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = CreateTextBox('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/data/TextBox.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/data/TextBox.pptx new file mode 100644 index 00000000..f4a73c0e Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/data/TextBox.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/data/hLinkPPTX.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/data/hLinkPPTX.pptx new file mode 100644 index 00000000..9a904d06 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/data/hLinkPPTX.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/ManageText.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/ManageText.py new file mode 100644 index 00000000..aabe5991 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/ManageText.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithText import ManageText + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ManageText('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/AnchorText.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/AnchorText.pptx new file mode 100644 index 00000000..800f317c Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/AnchorText.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/VerticleText.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/VerticleText.pptx new file mode 100644 index 00000000..3e111f2f Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/VerticleText.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/formatText.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/formatText.pptx new file mode 100644 index 00000000..af78a0a5 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/formatText.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/ReplaceText.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/ReplaceText.py new file mode 100644 index 00000000..e6d9128c --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/ReplaceText.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithText import ReplaceText + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ReplaceText('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/data/Welcome.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/data/Welcome.pptx new file mode 100644 index 00000000..de25cd13 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/data/Welcome.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/data/Welcome_PH.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/data/Welcome_PH.pptx new file mode 100644 index 00000000..50d4c343 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/data/Welcome_PH.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ShadowEffects/ShadowEffects.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ShadowEffects/ShadowEffects.py new file mode 100644 index 00000000..aa276be8 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ShadowEffects/ShadowEffects.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithText import ShadowEffects + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ShadowEffects('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ShadowEffects/data/OutShadow.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ShadowEffects/data/OutShadow.pptx new file mode 100644 index 00000000..23f587e6 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ShadowEffects/data/OutShadow.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/TextFont.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/TextFont.py new file mode 100644 index 00000000..58b42353 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/TextFont.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithText import TextFont + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = TextFont('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/FontFamilyOfText.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/FontFamilyOfText.pptx new file mode 100644 index 00000000..2c60002f Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/FontFamilyOfText.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/Welcome.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/Welcome.pptx new file mode 100644 index 00000000..de25cd13 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/Welcome.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/WelcomeFont.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/WelcomeFont.pptx new file mode 100644 index 00000000..c8a9ce29 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/WelcomeFont.pptx differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/exportparagraphtext/input.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/input.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/exportparagraphtext/input.pptx rename to Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/input.pptx diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/output.pdf b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/output.pdf new file mode 100644 index 00000000..64a9d52f Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/output.pdf differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/WordArt/WordArt.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/WordArt/WordArt.py new file mode 100644 index 00000000..defad6c4 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/WordArt/WordArt.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithText import WordArt + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = WordArt('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/WordArt/data/WordArt.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/WordArt/data/WordArt.pptx new file mode 100644 index 00000000..b1042e79 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/WordArt/data/WordArt.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/untitled text 5.txt b/Plugins/Aspose-Slides-Java-for-Python/untitled text 5.txt new file mode 100644 index 00000000..31bcef1c --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/untitled text 5.txt @@ -0,0 +1,19 @@ +__author__ = 'fahadadeel' + +from setuptools import setup, find_packages + +setup( + name = 'aspose-slides-java-for-python', + packages = find_packages(), + version = '1.0', + description = 'Aspose.Slides Java for Python is a project that demonstrates / provides the Aspose.Slides for Java API usage examples in Python.', + author='Fahad Adeel', + author_email='slides@aspose.com', + url='http://www.aspose.com/docs/display/slidesjava/Aspose.Slides+Java+for+Python', + classifiers=[ + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent' + ] +) \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/LICENSE b/Plugins/Aspose.Slides Java (Maven) for NetBeans/LICENSE new file mode 100644 index 00000000..a041d8f4 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2001-2016 Aspose Pty Ltd + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/README.md b/Plugins/Aspose.Slides Java (Maven) for NetBeans/README.md new file mode 100644 index 00000000..19756cb8 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/README.md @@ -0,0 +1,44 @@ +## Aspose.Slides Java (Maven) for NetBeans + +This project is **NetBeans IDE plugin** which lets developers use [Aspose.Slides for Java](https://products.aspose.com/slides/java) in their Maven based Java projects. + +## Who is supposed to use this **Plugin?** + +This plugin is intended for developers using Maven platform for Java developments and want to use [Aspose.Slides for Java](https://products.aspose.com/slides/java) in their projects. + +**NOTE:** [Aspose.Slides for Java](https://products.aspose.com/slides/java) is Java API developed by [Aspose](http://aspose.com) that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint. For the API detailed features list check the [link](https://products.aspose.com/slides/java). + +## **Features** + +The plugin provides following features to work with [Aspose.Slides for Java](https://products.aspose.com/slides/java) API within **NetBeans IDE** comfortably: + +### Aspose.Slides Maven Project (wizard) +![plugin title shot](http://i.imgur.com/WgqE1lT.png) + +* By using this wizard plugin creates Maven project for using [Aspose.Slides for Java](https://products.aspose.com/slides/java) from **New Project -> Maven-> Aspose.Slides Maven Project** +* The wizard will also give option for downloading latest available Code Examples for using the API. + +### Aspose.Slides Code Example (wizard) +![plugin title shot](http://i.imgur.com/IFie2Rq.png) +* By using this wizard plugin lets you copy the downloaded Code Examples into your project for using [Aspose.Slides for Java](https://products.aspose.com/slides/java) from **New File -> Java -> Aspose.Slides Code Example** +* The wizard will also look for and updates for newly available Code Examples from [Aspose.Slides for Java examples repository.](https://github.com/aspose-slides/Aspose.Slides-for-Java/tree/master/Examples) + **NOTE:** Selected Code Examples (category) source codes will be copied under **"com.aspose.slides.examples"** package. Resources needed for running examples will be copied to the corresponding directory (package) within **"src/main/resources"**. + +### Other Features + +* Supports latest **NetBeans 8.1** version +* Compatible with **Mac**, **Linux Flavors** and **Windows** +* Native IDE user experience +* Open Source + +## What is Aspose.Slides Java API? + +**Aspose.Slides for Java** is a unique PowerPoint management component that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint. + +**Aspose.Slides for Java** is the first and only Java component that provides functionality to manage PowerPoint documents within your own applications. As with all Aspose Java components, Aspose.Slides for Java is written in pure Java, incredibly priced and lightning fast. + +For more info about the **Aspose.Slides for Java API**, [please check the api documentation - click here](https://apireference.aspose.com/java/slides) + +## Plugin Documentation + +For the most complete documentation, [Please check Aspose Docs](https://docs.aspose.com/display/slidesjava/Aspose.Slides+Java+for+NetBeans+-+Maven) diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/Release Notes.html b/Plugins/Aspose.Slides Java (Maven) for NetBeans/Release Notes.html new file mode 100644 index 00000000..b2dde789 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/Release Notes.html @@ -0,0 +1,17 @@ + + + +Aspose.Slides Java (Maven) for NetBeans - Release Notes + + + + +Aspose.Slides Java (Maven) for NetBeans - v1.0 +

This is new Plugin for NetBeans IDE by Aspose. This plugin is intended for developers using Maven platform for Java developments and want to use Aspose.Slides for Java in their projects.

+

NOTE: Aspose.Slides for Java is Java API developed by Aspose that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint. For the API detailed features list check the link. +

The plugin provides following features to work with Aspose.Slides for Java API within NetBeans IDE comfortably: +

  • Aspose.Slides Maven Project
    • By using this wizard plugin creates Maven project for using Aspose.Slides for Java from New Project -> Maven-> Aspose.Slides Maven Project
    • The wizard will also give option for downloading latest available Code Examples for using the API.
  • +
  • Aspose.Slides Code Example
  • +
  • Other Features
    • Supports latest NetBeans 8.1 version
    • Compatible with Mac, Linux Flavors and Windows
    • Native IDE user experience
    • Open Source
+ + \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/Aspose.png b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/Aspose.png new file mode 100644 index 00000000..b4031271 Binary files /dev/null and b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/Aspose.png differ diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenBasicPanelVisual.form b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenBasicPanelVisual.form new file mode 100644 index 00000000..66296a6d --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenBasicPanelVisual.form @@ -0,0 +1,347 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenBasicPanelVisual.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenBasicPanelVisual.java new file mode 100644 index 00000000..4e5e377b --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenBasicPanelVisual.java @@ -0,0 +1,600 @@ +package com.aspose.slides.maven; + +import static com.aspose.slides.maven.Bundle.TXT_MavenProjectName; +import java.awt.Image; +import java.io.File; +import javax.swing.ImageIcon; +import javax.swing.JFileChooser; +import javax.swing.JPanel; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.Document; +import org.netbeans.spi.project.ui.support.ProjectChooser; +import org.openide.WizardDescriptor; +import org.openide.WizardValidationException; +import org.openide.filesystems.FileUtil; +import org.openide.util.NbBundle; + +/** + * @author Adeel Ilyas + */ +public class AsposeMavenBasicPanelVisual extends JPanel implements DocumentListener { + + /** + * + */ + public static final String PROP_PROJECT_NAME = "projectName"; + + /** + * + */ + public static final String PROP_GROUP_ID = "groupId"; + + private AsposeMavenBasicWizardPanel panel; + private boolean txtPackageCustom = false; + + /** + * + * @param panel + */ + public AsposeMavenBasicPanelVisual(AsposeMavenBasicWizardPanel panel) { + initComponents(); + this.panel = panel; + // Register listener on the textFields to make the automatic updates + projectNameTextField.getDocument().addDocumentListener(this); + projectLocationTextField.getDocument().addDocumentListener(this); + txtGroupId.getDocument().addDocumentListener(this); + txtPackage.getDocument().addDocumentListener(this); + txtVersion.getDocument().addDocumentListener(this); + txtGroupId.setText(MavenSettings.getDefault().getLastArchetypeGroupId()); + txtVersion.setText(MavenSettings.getDefault().getLastArchetypeVersion()); + } + + /** + * + * @return + */ + public String getProjectName() { + return this.projectNameTextField.getText(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + projectNameLabel = new javax.swing.JLabel(); + projectNameTextField = new javax.swing.JTextField(); + projectLocationLabel = new javax.swing.JLabel(); + projectLocationTextField = new javax.swing.JTextField(); + browseButton = new javax.swing.JButton(); + createdFolderLabel = new javax.swing.JLabel(); + createdFolderTextField = new javax.swing.JTextField(); + lblPackage = new javax.swing.JLabel(); + txtVersion = new javax.swing.JTextField(); + lblVersion = new javax.swing.JLabel(); + txtGroupId = new javax.swing.JTextField(); + lblGroupId = new javax.swing.JLabel(); + lblArtifactId = new javax.swing.JLabel(); + txtArtifactId = new javax.swing.JTextField(); + txtPackage = new javax.swing.JTextField(); + lblPackage1 = new javax.swing.JLabel(); + jCheckBox1 = new javax.swing.JCheckBox(); + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + + projectNameLabel.setLabelFor(projectNameTextField); + org.openide.awt.Mnemonics.setLocalizedText(projectNameLabel, org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.projectNameLabel.text")); // NOI18N + + projectNameTextField.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + projectNameTextFieldActionPerformed(evt); + } + }); + + projectLocationLabel.setLabelFor(projectLocationTextField); + org.openide.awt.Mnemonics.setLocalizedText(projectLocationLabel, org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.projectLocationLabel.text")); // NOI18N + + projectLocationTextField.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + projectLocationTextFieldActionPerformed(evt); + } + }); + + org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.browseButton.text")); // NOI18N + browseButton.setActionCommand(org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.browseButton.actionCommand")); // NOI18N + browseButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + browseButtonActionPerformed(evt); + } + }); + + createdFolderLabel.setLabelFor(createdFolderTextField); + org.openide.awt.Mnemonics.setLocalizedText(createdFolderLabel, org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.createdFolderLabel.text")); // NOI18N + + createdFolderTextField.setEditable(false); + createdFolderTextField.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + createdFolderTextFieldActionPerformed(evt); + } + }); + + lblPackage.setLabelFor(txtPackage); + org.openide.awt.Mnemonics.setLocalizedText(lblPackage, org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.lblPackage.text")); // NOI18N + + txtVersion.setText(org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.txtVersion.text")); // NOI18N + txtVersion.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtVersionActionPerformed(evt); + } + }); + + lblVersion.setLabelFor(txtVersion); + org.openide.awt.Mnemonics.setLocalizedText(lblVersion, org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.lblVersion.text")); // NOI18N + + txtGroupId.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtGroupIdActionPerformed(evt); + } + }); + + lblGroupId.setLabelFor(txtGroupId); + org.openide.awt.Mnemonics.setLocalizedText(lblGroupId, org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.lblGroupId.text")); // NOI18N + + lblArtifactId.setLabelFor(txtArtifactId); + org.openide.awt.Mnemonics.setLocalizedText(lblArtifactId, org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.lblArtifactId.text")); // NOI18N + + txtArtifactId.setEditable(false); + txtArtifactId.setEnabled(false); + txtArtifactId.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtArtifactIdActionPerformed(evt); + } + }); + + txtPackage.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtPackageActionPerformed(evt); + } + }); + + org.openide.awt.Mnemonics.setLocalizedText(lblPackage1, org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.lblPackage1.text")); // NOI18N + + jCheckBox1.setLabel(org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.jCheckBox1.label")); // NOI18N + jCheckBox1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jCheckBox1ActionPerformed(evt); + } + }); + + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/long-banner.png"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.text")); // NOI18N + jLabel1.setAlignmentY(0.0F); + jLabel1.setDoubleBuffered(true); + jLabel1.setIconTextGap(0); + jLabel1.setMaximumSize(new java.awt.Dimension(32767, 32767)); + jLabel1.setName(""); // NOI18N + jLabel1.setOpaque(true); + jLabel1.addComponentListener(new java.awt.event.ComponentAdapter() { + public void componentResized(java.awt.event.ComponentEvent evt) { + jLabel1ComponentResized(evt); + } + }); + + jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.jLabel2.text")); // NOI18N + + jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.jLabel3.text")); // NOI18N + jLabel3.setToolTipText(org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.jLabel3.toolTipText")); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(lblVersion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblGroupId, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblArtifactId, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE) + .addComponent(lblPackage, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(createdFolderLabel) + .addComponent(projectLocationLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtArtifactId) + .addComponent(txtGroupId) + .addComponent(txtVersion) + .addComponent(txtPackage) + .addComponent(createdFolderTextField, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(projectLocationTextField)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(layout.createSequentialGroup() + .addComponent(lblPackage1) + .addGap(31, 31, 31)) + .addComponent(browseButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addGroup(layout.createSequentialGroup() + .addComponent(projectNameLabel) + .addGap(18, 18, 18) + .addComponent(projectNameTextField) + .addGap(84, 84, 84)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2) + .addComponent(jLabel3) + .addComponent(jCheckBox1)) + .addGap(0, 0, Short.MAX_VALUE))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(projectNameLabel) + .addComponent(projectNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(projectLocationLabel)) + .addGroup(layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(projectLocationTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(browseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(createdFolderTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(createdFolderLabel)) + .addGap(10, 10, 10) + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtArtifactId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblArtifactId)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtGroupId, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblGroupId)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblVersion) + .addComponent(txtVersion, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblPackage) + .addComponent(lblPackage1)) + .addComponent(txtPackage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addComponent(jCheckBox1) + .addGap(21, 21, 21)) + ); + + txtVersion.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.txtVersion.AccessibleContext.accessibleName")); // NOI18N + txtGroupId.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.txtGroupId.AccessibleContext.accessibleName")); // NOI18N + txtPackage.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(AsposeMavenBasicPanelVisual.class, "AsposeMavenBasicPanelVisual.txtPackage.AccessibleContext.accessibleName")); // NOI18N + }// //GEN-END:initComponents + + private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed + String command = evt.getActionCommand(); + if ("BROWSE".equals(command)) { + JFileChooser chooser = new JFileChooser(); + FileUtil.preventFileChooserSymlinkTraversal(chooser, null); + chooser.setDialogTitle("Select Project Location"); + chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + String path = this.projectLocationTextField.getText(); + if (path.length() > 0) { + File f = new File(path); + if (f.exists()) { + chooser.setSelectedFile(f); + } + } + if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) { + File projectDir = chooser.getSelectedFile(); + projectLocationTextField.setText(FileUtil.normalizeFile(projectDir).getAbsolutePath()); + } + panel.fireChangeEvent(); + } + + }//GEN-LAST:event_browseButtonActionPerformed + + private void projectNameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_projectNameTextFieldActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_projectNameTextFieldActionPerformed + + private void projectLocationTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_projectLocationTextFieldActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_projectLocationTextFieldActionPerformed + + private void createdFolderTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createdFolderTextFieldActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_createdFolderTextFieldActionPerformed + + private void txtArtifactIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtArtifactIdActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtArtifactIdActionPerformed + + private void txtGroupIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtGroupIdActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtGroupIdActionPerformed + + private void txtPackageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPackageActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtPackageActionPerformed + + private void txtVersionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtVersionActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtVersionActionPerformed + + private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jCheckBox1ActionPerformed + private final ImageIcon icon = new ImageIcon(getClass().getResource("/resources/long-banner.png")); + private void jLabel1ComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_jLabel1ComponentResized + int labelwidth = jLabel1.getWidth(); + int labelheight = jLabel1.getHeight(); + Image img = icon.getImage(); + jLabel1.setIcon(new ImageIcon(img.getScaledInstance(labelwidth, labelheight, Image.SCALE_FAST))); + }//GEN-LAST:event_jLabel1ComponentResized + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton browseButton; + private javax.swing.JLabel createdFolderLabel; + private javax.swing.JTextField createdFolderTextField; + private javax.swing.JCheckBox jCheckBox1; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel lblArtifactId; + private javax.swing.JLabel lblGroupId; + private javax.swing.JLabel lblPackage; + private javax.swing.JLabel lblPackage1; + private javax.swing.JLabel lblVersion; + private javax.swing.JLabel projectLocationLabel; + private javax.swing.JTextField projectLocationTextField; + private javax.swing.JLabel projectNameLabel; + private javax.swing.JTextField projectNameTextField; + private javax.swing.JTextField txtArtifactId; + private javax.swing.JTextField txtGroupId; + private javax.swing.JTextField txtPackage; + private javax.swing.JTextField txtVersion; + // End of variables declaration//GEN-END:variables + + @Override + public void addNotify() { + super.addNotify(); + //same problem as in 31086, initial focus on Cancel button + projectNameTextField.requestFocus(); + } + + boolean valid(WizardDescriptor wizardDescriptor) { + + if (projectNameTextField.getText().length() == 0) { + // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_ERROR_MESSAGE: + wizardDescriptor.putProperty("WizardPanel_errorMessage", + "Project Name is not a valid folder name"); + return false; // Display name not specified + } + File f = FileUtil.normalizeFile(new File(projectLocationTextField.getText()).getAbsoluteFile()); + if (projectLocationTextField.getText().trim().length() == 0 || !f.isDirectory()) { + String message = "Project Folder is not a valid path"; + wizardDescriptor.putProperty("WizardPanel_errorMessage", message); + return false; + } + if (txtVersion.getText().isEmpty()) { + String message = "Version may not be empty"; + wizardDescriptor.putProperty("WizardPanel_errorMessage", message); + return false; + } + if (txtGroupId.getText().isEmpty()) { + String message = "GroupdId may not be empty"; + wizardDescriptor.putProperty("WizardPanel_errorMessage", message); + return false; + } + + final File destFolder = FileUtil.normalizeFile(new File(createdFolderTextField.getText()).getAbsoluteFile()); + + File projLoc = destFolder; + while (projLoc != null && !projLoc.exists()) { + projLoc = projLoc.getParentFile(); + } + if (projLoc == null || !projLoc.canWrite()) { + wizardDescriptor.putProperty("WizardPanel_errorMessage", + "Project Folder cannot be created"); + return false; + } + + if (FileUtil.toFileObject(projLoc) == null) { + String message = "Project Folder is not a valid path"; + wizardDescriptor.putProperty("WizardPanel_errorMessage", message); + return false; + } + + File[] kids = destFolder.listFiles(); + if (destFolder.exists() && kids != null && kids.length > 0) { + // Folder exists and is not empty + wizardDescriptor.putProperty("WizardPanel_errorMessage", + "Project Folder already exists and is not empty"); + return false; + } + + String packageName = txtPackage.getText().trim(); + if (!(packageName.equals("") + || packageName.matches("([\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{L}_$][\\p{L}\\p{N}_$]*"))) { + String message = "Package name is invalid"; + wizardDescriptor.putProperty("WizardPanel_errorMessage", message); + return false; + } + + wizardDescriptor.putProperty("WizardPanel_errorMessage", ""); + return true; + } + + void store(WizardDescriptor d) { + String name = projectNameTextField.getText().trim(); + String folder = createdFolderTextField.getText().trim(); + String location = projectLocationTextField.getText().trim(); + + String groupId = txtGroupId.getText().trim(); + MavenSettings.getDefault().setLastArchetypeGroupId(txtGroupId.getText().trim()); + String artifactId = txtArtifactId.getText().trim(); + String version = txtVersion.getText().trim(); + MavenSettings.getDefault().setLastArchetypeVersion(txtVersion.getText().trim()); + String startjupPackage = txtPackage.getText().trim(); + + boolean downloadExamples = jCheckBox1.isSelected(); + + d.putProperty("projdir", new File(folder)); + d.putProperty("projdirName", folder); + d.putProperty("projLocation", location); + d.putProperty("name", name); + + d.putProperty("groupId", groupId); + d.putProperty("artifactId", artifactId); + d.putProperty("version", version); + d.putProperty("package", startjupPackage); + + d.putProperty("downloadExamples", downloadExamples); + + } + + @NbBundle.Messages({"# {0} - project count", "TXT_MavenProjectName=asposemavenproject{0}"}) + void read(WizardDescriptor settings) { + + File projectLocation = (File) settings.getProperty("projdir"); + if (projectLocation == null || projectLocation.getParentFile() == null || !projectLocation.getParentFile().isDirectory()) { + projectLocation = ProjectChooser.getProjectsFolder(); + } else { + projectLocation = projectLocation.getParentFile(); + } + this.projectLocationTextField.setText(projectLocation.getAbsolutePath()); + + String projectName = (String) settings.getProperty("name"); + + if (projectName == null) { + int baseCount = 1; + while ((projectName = validFreeProjectName(projectLocation, TXT_MavenProjectName(baseCount))) == null) { + baseCount++; + } + } + + this.projectNameTextField.setText(projectName); + this.projectNameTextField.selectAll(); + + String gr = (String) settings.getProperty("groupId"); + if (gr != null) { + txtGroupId.setText(gr); + } + String ver = (String) settings.getProperty("version"); + if (ver != null) { + txtVersion.setText(ver); + } + } + + private String validFreeProjectName(File parentFolder, String name) { + File file = new File(parentFolder, name); + return file.exists() ? null : name; + } + + void validate(WizardDescriptor d) throws WizardValidationException { + // nothing to validate + } + + @Override + public void changedUpdate(DocumentEvent e) { + updateTexts(e); + if (this.projectNameTextField.getDocument() == e.getDocument()) { + firePropertyChange(PROP_PROJECT_NAME, null, this.projectNameTextField.getText()); + } + + if (this.txtGroupId.getDocument() == e.getDocument()) { + firePropertyChange(PROP_GROUP_ID, null, this.txtGroupId.getText()); + } + + } + + @Override + public void insertUpdate(DocumentEvent e) { + updateTexts(e); + if (this.projectNameTextField.getDocument() == e.getDocument()) { + firePropertyChange(PROP_PROJECT_NAME, null, this.projectNameTextField.getText()); + } + if (this.txtGroupId.getDocument() == e.getDocument()) { + firePropertyChange(PROP_GROUP_ID, null, this.txtGroupId.getText()); + } + } + + @Override + public void removeUpdate(DocumentEvent e) { + updateTexts(e); + if (this.projectNameTextField.getDocument() == e.getDocument()) { + firePropertyChange(PROP_PROJECT_NAME, null, this.projectNameTextField.getText()); + } + if (this.txtGroupId.getDocument() == e.getDocument()) { + firePropertyChange(PROP_GROUP_ID, null, this.txtGroupId.getText()); + } + } + + private void updateTexts(DocumentEvent e) { + + Document doc = e.getDocument(); + String projectName = projectNameTextField.getText(); + if (doc == txtPackage.getDocument()) { + // Looking for a custom change in package name by the user + txtPackageCustom = txtPackage.getText().trim().length() != 0; + } + if (doc == projectNameTextField.getDocument() || doc == projectLocationTextField.getDocument()) { + // Change in the project name + + String projectFolder = projectLocationTextField.getText(); + txtArtifactId.setText(projectName); + + createdFolderTextField.setText(projectFolder + File.separatorChar + projectName); + + } + if (!txtPackageCustom && (doc == txtGroupId.getDocument() || doc == projectNameTextField.getDocument())) { + txtPackage.getDocument().removeDocumentListener(this); + txtPackage.setText(getPackageName(txtGroupId.getText() + "." + txtArtifactId.getText().replace("-", "."))); //NOI18N + txtPackage.getDocument().addDocumentListener(this); + } + panel.fireChangeEvent(); // Notify that the panel changed + } + + static String getPackageName(String displayName) { + StringBuilder builder = new StringBuilder(); + boolean firstLetter = true; + for (int i = 0; i < displayName.length(); i++) { + char c = displayName.charAt(i); + if ((!firstLetter && Character.isJavaIdentifierPart(c)) + || (firstLetter && Character.isJavaIdentifierStart(c))) { + firstLetter = false; + if (Character.isUpperCase(c)) { + c = Character.toLowerCase(c); + } + builder.append(c); + continue; + } + if (!firstLetter && c == '.') { + firstLetter = true; + builder.append(c); + } + } + String toRet = builder.length() == 0 ? "pkg" : builder.toString(); //NOI18N + return toRet; + } +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenBasicWizardPanel.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenBasicWizardPanel.java new file mode 100644 index 00000000..bd3ac442 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenBasicWizardPanel.java @@ -0,0 +1,146 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.aspose.slides.maven; + +import java.awt.Component; +import java.util.HashSet; +import java.util.Set; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import org.openide.WizardDescriptor; +import org.openide.WizardValidationException; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; + +/** + * @author Adeel Ilyas + */ +public class AsposeMavenBasicWizardPanel implements WizardDescriptor.Panel, + WizardDescriptor.ValidatingPanel { + + private WizardDescriptor wizardDescriptor; + private AsposeMavenBasicPanelVisual component; + + /** + * + */ + public AsposeMavenBasicWizardPanel() { + } + + /** + * + * @return + */ + @Override + public Component getComponent() { + if (component == null) { + component = new AsposeMavenBasicPanelVisual(this); + component.setName(NbBundle.getMessage(AsposeMavenBasicWizardPanel.class, "LBL_CreateProjectStep")); + } + return component; + } + + /** + * + * @return + */ + @Override + public HelpCtx getHelp() { + // Show no Help button for this panel: + return HelpCtx.DEFAULT_HELP; + + } + + /** + * + * @return + */ + @Override + public boolean isValid() { + getComponent(); + return component.valid(wizardDescriptor); + } + + private final Set listeners = new HashSet(1); // or can use ChangeSupport in NB 6.0 + + /** + * + * @param l + */ + @Override + public final void addChangeListener(ChangeListener l) { + synchronized (listeners) { + listeners.add(l); + } + } + + /** + * + * @param l + */ + @Override + public final void removeChangeListener(ChangeListener l) { + synchronized (listeners) { + listeners.remove(l); + } + } + + /** + * + */ + protected final void fireChangeEvent() { + Set ls; + synchronized (listeners) { + ls = new HashSet<>(listeners); + } + ChangeEvent ev = new ChangeEvent(this); + for (ChangeListener l : ls) { + l.stateChanged(ev); + } + } + + /** + * + * @param settings + */ + @Override + public void readSettings(Object settings) { + + wizardDescriptor = (WizardDescriptor) settings; + component.read(wizardDescriptor); + } + + /** + * + * @param settings + */ + @Override + public void storeSettings(Object settings) { + + WizardDescriptor d = (WizardDescriptor) settings; + component.store(d); + } + + /** + * + * @return + */ + public boolean isFinishPanel() { + return true; + } + + /** + * + * @throws WizardValidationException + */ + @Override + public void validate() throws WizardValidationException { + + getComponent(); + component.validate(wizardDescriptor); + } + +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenProject.zip b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenProject.zip new file mode 100644 index 00000000..002b84f0 Binary files /dev/null and b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenProject.zip differ diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenProjectWizardIterator.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenProjectWizardIterator.java new file mode 100644 index 00000000..405b4d49 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeMavenProjectWizardIterator.java @@ -0,0 +1,399 @@ +package com.aspose.slides.maven; + +import com.aspose.slides.maven.artifacts.Metadata; +import com.aspose.slides.maven.utils.AsposeConstants; +import com.aspose.slides.maven.utils.AsposeJavaAPI; +import com.aspose.slides.maven.utils.AsposeMavenProjectManager; +import static com.aspose.slides.maven.utils.AsposeMavenProjectManager.getAsposeProjectMavenDependencies; +import com.aspose.slides.maven.utils.AsposeSlidesJavaAPI; +import com.aspose.slides.maven.utils.TasksExecutor; +import java.awt.Component; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import javax.swing.JComponent; +import javax.swing.event.ChangeListener; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.api.project.ProjectManager; +import org.netbeans.api.templates.TemplateRegistration; +import org.netbeans.spi.project.ui.support.ProjectChooser; +import org.netbeans.spi.project.ui.templates.support.Templates; +import org.openide.WizardDescriptor; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileUtil; +import org.openide.util.Exceptions; +import org.openide.util.NbBundle; +import org.openide.util.NbBundle.Messages; +import org.openide.xml.XMLUtil; +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * @author Adeel Ilyas + */ +@TemplateRegistration( + folder = "Project/Maven2", + displayName = "#Aspose_displayName", + description = "AsposeSlidesMavenDescription.html", + iconBase = "com/aspose/slides/maven/Aspose.png", + position = 1, + content = "AsposeMavenProject.zip") +@Messages("Aspose_displayName=Aspose.Slides Maven Project") + +public class AsposeMavenProjectWizardIterator implements WizardDescriptor.ProgressInstantiatingIterator { + + private int index; + private WizardDescriptor.Panel[] panels; + private WizardDescriptor wiz; + List list = new ArrayList<>(); + + /** + * + */ + public AsposeMavenProjectWizardIterator() { + } + + /** + * + * @return + */ + public static AsposeMavenProjectWizardIterator createIterator() { + return new AsposeMavenProjectWizardIterator(); + } + + private WizardDescriptor.Panel[] createPanels() { + + return new WizardDescriptor.Panel[]{ + new AsposeMavenBasicWizardPanel() + }; + } + + /** + * + * @return + */ + private String[] createSteps() { + return new String[]{ + NbBundle.getMessage(AsposeMavenProjectWizardIterator.class, "LBL_CreateProjectStep"), + }; + } + + /** + * + * @return + * @throws IOException + */ + @Override + public Set instantiate() throws IOException { + throw new AssertionError("instantiate(ProgressHandle) " //NOI18N + + "should have been called"); //NOI18N + } + + /** + * + * @param ph + * @return + * @throws IOException + */ + @Override + public Set instantiate(ProgressHandle ph) throws IOException { + ph.start(); + ph.switchToIndeterminate(); + ph.progress("Processing..."); + final AsposeMavenProjectManager asposeMavenProjectManager = AsposeMavenProjectManager.initialize(wiz); + final AsposeJavaAPI asposeSlidesJavaAPI = AsposeSlidesJavaAPI.initialize(asposeMavenProjectManager); + + boolean isDownloadExamplesSelected = (boolean) wiz.getProperty("downloadExamples"); + + // Downloading Aspose.Slides Java (mvn based) examples... + if (isDownloadExamplesSelected) { + TasksExecutor tasksExecutionDownloadExamples = new TasksExecutor(NbBundle.getMessage(AsposeMavenProjectWizardIterator.class, "AsposeManager.progressExamplesTitle")); + // Downloading Aspose API mvn based examples + tasksExecutionDownloadExamples.addNewTask(asposeMavenProjectManager.createDownloadExamplesTask(asposeSlidesJavaAPI)); + // Execute the tasks + tasksExecutionDownloadExamples.processTasks(); + } + TasksExecutor tasksExecutionRetrieve = new TasksExecutor(NbBundle.getMessage(AsposeMavenProjectWizardIterator.class, "AsposeManager.progressTitle")); + + // Retrieving Aspose.Slides Java Maven artifact... + tasksExecutionRetrieve.addNewTask(asposeMavenProjectManager.retrieveAsposeAPIMavenTask(asposeSlidesJavaAPI)); + + // Execute the tasks + tasksExecutionRetrieve.processTasks(); + + // Creating Maven project + ph.progress(NbBundle.getMessage(AsposeMavenProjectWizardIterator.class, "AsposeManager.projectMessage")); + + Set resultSet = new LinkedHashSet<>(); + + File projectDir = FileUtil.normalizeFile((File) wiz.getProperty("projdir")); + projectDir.mkdirs(); + + FileObject template = Templates.getTemplate(wiz); + FileObject projectRoot = FileUtil.toFileObject(projectDir); + createAsposeMavenProject(template.getInputStream(), projectRoot); + + createStartupPackage(projectRoot); + + resultSet.add(projectRoot); + // Look for nested projects to open as well: + Enumeration e = projectRoot.getFolders(true); + while (e.hasMoreElements()) { + FileObject subfolder = e.nextElement(); + if (ProjectManager.getDefault().isProject(subfolder)) { + resultSet.add(subfolder); + } + } + + File parent = projectDir.getParentFile(); + if (parent != null && parent.exists()) { + ProjectChooser.setProjectsFolder(parent); + } + ph.finish(); + return resultSet; + } + + /** + * + * @param wiz + */ + @Override + public void initialize(WizardDescriptor wiz) { + this.wiz = wiz; + index = 0; + panels = createPanels(); + // Make sure list of steps is accurate. + String[] steps = createSteps(); + for (int i = 0; i < panels.length; i++) { + Component c = panels[i].getComponent(); + if (steps[i] == null) { + // Default step name to component name of panel. + // Mainly useful for getting the name of the target + // chooser to appear in the list of steps. + steps[i] = c.getName(); + } + if (c instanceof JComponent) { // assume Swing components + JComponent jc = (JComponent) c; + // Step #. + // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*: + jc.putClientProperty("WizardPanel_contentSelectedIndex", i); + // Step name (actually the whole list for reference). + jc.putClientProperty("WizardPanel_contentData", steps); + } + } + } + + /** + * + * @param wiz + */ + @Override + public void uninitialize(WizardDescriptor wiz) { + this.wiz.putProperty("projdir", null); + this.wiz.putProperty("name", null); + this.wiz = null; + panels = null; + } + + /** + * + * @return + */ + @Override + public String name() { + return MessageFormat.format("{0} of {1}", + new Object[]{ + index + 1, panels.length + }); + } + + /** + * + * @return + */ + @Override + public boolean hasNext() { + return index < panels.length - 1; + } + + /** + * + * @return + */ + @Override + public boolean hasPrevious() { + return index > 0; + } + + /** + * + */ + @Override + public void nextPanel() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + index++; + } + + /** + * + */ + @Override + public void previousPanel() { + if (!hasPrevious()) { + throw new NoSuchElementException(); + } + index--; + } + + /** + * + * @return + */ + @Override + public WizardDescriptor.Panel current() { + return panels[index]; + } + + /** + * + * @param l + */ + @Override + public final void addChangeListener(ChangeListener l) { + } + + /** + * + * @param l + */ + @Override + public final void removeChangeListener(ChangeListener l) { + } + + private void createAsposeMavenProject(InputStream source, FileObject projectRoot) throws IOException { + try { + ZipInputStream str = new ZipInputStream(source); + ZipEntry entry; + while ((entry = str.getNextEntry()) != null) { + if (entry.isDirectory()) { + FileUtil.createFolder(projectRoot, entry.getName()); + } else { + FileObject fo = FileUtil.createData(projectRoot, entry.getName()); + if (AsposeConstants.MAVEN_POM_XML.equals(entry.getName())) { + /* + Special handling for maven pom.xml: + 1. Defining / creating project artifacts + 2. Adding latest Aspose.Slides Maven Dependency reference into pom.xml + */ + configureProjectMavenPOM(fo, str); + } else { + writeFile(str, fo); + } + } + } + } finally { + source.close(); + } + } + + private void createStartupPackage(FileObject projectRoot) throws IOException { + String startupPackage = wiz.getProperty("package").toString().replace(".", File.separator); + + FileUtil.createFolder(projectRoot, "src" + File.separator + "main" + File.separator + "java" + File.separator + startupPackage); + } + + private static void writeFile(ZipInputStream str, FileObject fo) throws IOException { + try (OutputStream out = fo.getOutputStream()) { + FileUtil.copy(str, out); + } + } + + private void configureProjectMavenPOM(FileObject fo, ZipInputStream str) throws IOException { + + String groupId = (String) wiz.getProperty("groupId"); + String artifactId = (String) wiz.getProperty("artifactId"); + String version = (String) wiz.getProperty("version"); + + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + FileUtil.copy(str, baos); + Document doc = XMLUtil.parse(new InputSource(new ByteArrayInputStream(baos.toByteArray())), false, false, null, null); + Element root = doc.getDocumentElement(); + Node node = root.getElementsByTagName("groupId").item(0); + node.setTextContent(groupId); + + node = root.getElementsByTagName("artifactId").item(0); + node.setTextContent(artifactId); + + node = root.getElementsByTagName("version").item(0); + node.setTextContent(version); + + updateProjectPom(doc); + + try (OutputStream out = fo.getOutputStream()) { + XMLUtil.write(doc, out, "UTF-8"); + } + } catch (IOException | SAXException | DOMException ex) { + Exceptions.printStackTrace(ex); + writeFile(str, fo); + } + + } + + private void updateProjectPom(Document pomDocument) { + + // Get the root element + Node projectNode = pomDocument.getFirstChild(); + + // Adding Dependencies here + Element dependenciesTag = pomDocument.createElement("dependencies"); + projectNode.appendChild(dependenciesTag); + + for (Metadata dependency : getAsposeProjectMavenDependencies()) { + + addAsposeMavenDependency(pomDocument, dependenciesTag, dependency); + + } + + } + + private void addAsposeMavenDependency(Document doc, Element dependenciesTag, Metadata dependency) { + Element dependencyTag = doc.createElement("dependency"); + dependenciesTag.appendChild(dependencyTag); + + Element groupIdTag = doc.createElement("groupId"); + groupIdTag.appendChild(doc.createTextNode(dependency.getGroupId())); + dependencyTag.appendChild(groupIdTag); + + Element artifactId = doc.createElement("artifactId"); + artifactId.appendChild(doc.createTextNode(dependency.getArtifactId())); + dependencyTag.appendChild(artifactId); + Element version = doc.createElement("version"); + version.appendChild(doc.createTextNode(dependency.getVersioning().getLatest())); + dependencyTag.appendChild(version); + if (dependency.getClassifier() != null) { + Element classifer = doc.createElement("classifier"); + classifer.appendChild(doc.createTextNode(dependency.getClassifier())); + dependencyTag.appendChild(classifer); + } + } +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeSlidesMavenDescription.html b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeSlidesMavenDescription.html new file mode 100644 index 00000000..4c698a5b --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/AsposeSlidesMavenDescription.html @@ -0,0 +1,13 @@ + + + + + + + Aspose.Slides Maven Project wizard creates Maven Project for using Aspose.Slides for Java API within NetBeans IDE.

Aspose.Slides for Java is a unique PowerPoint management component that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint.

Aspose.Slides for Java is the first and only Java component that provides functionality to manage PowerPoint documents within your own applications. As with all Aspose Java components, Aspose.Slides for Java is written in pure Java, incredibly priced and lightning fast.

Aspose.Slides Maven Project wizard fetch and configures the latest Maven dependency reference of Aspose.Slides for Java from the Aspose Cloud Maven Repository.

The wizard also gives you option to download the Code Examples to use Aspose.Slides for Java API.

Once you are finished with this wizard - created Maven project and downloaded Code Examples. Next you can insert those Code Examples to use Aspose.Slides for Java API in your Project from New File -> Java -> Aspose.Slides Code Example

The newly created project and the Code Examples you added is now ready to be enhanced, all required resources and references are also automatically added.

+ + diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/Bundle.properties b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/Bundle.properties new file mode 100644 index 00000000..54031c34 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/Bundle.properties @@ -0,0 +1,43 @@ +OpenIDE-Module-Name=Aspose.Slides Java (Maven) for NetBeans +LBL_CreateProjectStep=Name and Location +OpenIDE-Module-Display-Category=Base IDE +OpenIDE-Module-Long-Description=\ + Aspose.Slides Maven Project wizard creates Maven Project for using Aspose.Slides for Java API within NetBeans IDE.\ +

Aspose.Slides for Java is a unique PowerPoint management component that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint.\ +

Aspose.Slides for Java is the first and only Java component that provides functionality to manage PowerPoint documents within your own applications. \ + As with all Aspose Java components, Aspose.Slides for Java is written in pure Java, incredibly priced and lightning fast.\ +

Aspose.Slides Maven Project wizard fetch and configures the latest Maven dependency reference of Aspose.Slides for Java from the Aspose Cloud Maven Repository.\ +

The wizard also gives you option to download the Code Examples to use Aspose.Slides for Java API.\ +

Once you are finished with this wizard - created Maven project and downloaded Code Examples. \ + Next you can insert those Code Examples to use Aspose.Slides for Java API in your Project from New File -> Java -> Aspose.Slides Code Example

The newly created project and the Code Examples you added is now ready to be enhanced, all required resources and references are also automatically added.\ +

+OpenIDE-Module-Name=Aspose.Slides Java (Maven) for NetBeans +AsposeMavenPanel.createdFolderLabel.text=Project &Folder: +OpenIDE-Module-Short-Description=This plugins helps you to create Aspose.Slides Maven based project and tryout samples provided by Aspose. +AsposeMavenPanel.jLabelCommonUses.toolTipText= +AsposeMavenBasicPanelVisual.projectLocationLabel.text=Project &Location: +AsposeMavenBasicPanelVisual.browseButton.actionCommand=BROWSE +AsposeMavenBasicPanelVisual.browseButton.text=Br&owse... +AsposeMavenBasicPanelVisual.createdFolderLabel.text=Project &Folder: +AsposeMavenBasicPanelVisual.projectNameLabel.text=Project &Name: +AsposeMavenBasicPanelVisual.lblArtifactId.text=Artifact Id: +AsposeMavenBasicPanelVisual.lblGroupId.text=Group Id: +AsposeMavenBasicPanelVisual.lblVersion.text=Version: +AsposeMavenBasicPanelVisual.txtVersion.text= +AsposeMavenBasicPanelVisual.txtGroupId.AccessibleContext.accessibleName= +AsposeMavenBasicPanelVisual.txtVersion.AccessibleContext.accessibleName= +AsposeMavenBasicPanelVisual.lblPackage.text=Package: +AsposeMavenBasicPanelVisual.txtPackage.AccessibleContext.accessibleName= +AsposeMavenBasicPanelVisual.lblPackage1.text=(Optional) +AsposeMavenBasicPanelVisual.lblArtifactId.toolTipText= +AsposeManager.progressMessage=Retrieving Aspose.Slides for java - Maven Dependency... +AsposeManager.projectMessage=Creating Aspose.Slides maven project... +AsposeManager.progressTitle=Retrieving Latest Maven artifact... +AsposeManager.progressExamplesTitle=Downloading Code Examples... +AsposeManager.downloadExamplesMessage=Downloading Aspose.Slides for java - Example Source Codes... +AsposeMavenBasicPanelVisual.toolTipText=Aspose.Slides for Java API - Helps to create and manipulate Microsoft slides documents. +AsposeMavenBasicPanelVisual.text= +AsposeMavenBasicPanelVisual.jCheckBox1.label=Also Download Code Examples (for using Aspose.Slides for Java) +AsposeMavenBasicPanelVisual.jLabel2.text=Please enter project detail: +AsposeMavenBasicPanelVisual.jLabel3.text=Please enter maven artifact detail: +AsposeMavenBasicPanelVisual.jLabel3.toolTipText= diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/MavenSettings.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/MavenSettings.java new file mode 100644 index 00000000..16008c63 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/MavenSettings.java @@ -0,0 +1,74 @@ +package com.aspose.slides.maven; + +import java.util.prefs.Preferences; +import org.openide.util.NbPreferences; + +/** + * + * @author Adeel + */ +public final class MavenSettings { + + private static final String PROP_LAST_ARCHETYPE_GROUPID = "lastArchetypeGroupId"; + private static final String PROP_LAST_ARCHETYPE_VERSION = "lastArchetypeVersion"; + + private Preferences getPreferences() { + return NbPreferences.forModule(MavenSettings.class); + } + + /** + * + * @return + */ + public String getLastArchetypeGroupId() { + return getPreferences().get(PROP_LAST_ARCHETYPE_GROUPID, "com.mycompany"); + } + + /** + * + * @return + */ + public String getLastArchetypeVersion() { + return getPreferences().get(PROP_LAST_ARCHETYPE_VERSION, "1.0-SNAPSHOT"); + } + + /** + * + * @param version + */ + public void setLastArchetypeVersion(String version) { + putProperty(PROP_LAST_ARCHETYPE_VERSION, version); + } + + /** + * + * @param groupId + */ + public void setLastArchetypeGroupId(String groupId) { + putProperty(PROP_LAST_ARCHETYPE_GROUPID, groupId); + } + + private String putProperty(String key, String value) { + String retval = getProperty(key); + if (value != null) { + getPreferences().put(key, value); + } else { + getPreferences().remove(key); + } + return retval; + } + private static final MavenSettings INSTANCE = new MavenSettings(); + + /** + * + * @return + */ + public static MavenSettings getDefault() { + return INSTANCE; + } + + private String getProperty(String key) { + return getPreferences().get(key, null); + } + +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/Metadata.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/Metadata.java new file mode 100644 index 00000000..28f2ae3b --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/Metadata.java @@ -0,0 +1,362 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2014.09.26 at 03:01:37 PM PKT +// +package com.aspose.slides.maven.artifacts; + +import javax.xml.bind.annotation.*; +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * Java class for anonymous complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ * < + * pre> + * <complexType> <complexContent> <restriction + * base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> <element + * name="groupId" type="{http://www.w3.org/2001/XMLSchema}string"/> <element + * name="artifactId" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="versioning"> <complexType> <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> <element name="latest" + * type="{http://www.w3.org/2001/XMLSchema}string"/> <element name="release" + * type="{http://www.w3.org/2001/XMLSchema}string"/> <element + * name="versions"> <complexType> <complexContent> <restriction + * base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> <element + * name="version" type="{http://www.w3.org/2001/XMLSchema}string" + * maxOccurs="unbounded" minOccurs="0"/> </sequence> </restriction> + * </complexContent> </complexType> </element> <element + * name="lastUpdated" type="{http://www.w3.org/2001/XMLSchema}long"/> + * </sequence> </restriction> </complexContent> </complexType> + * </element> </sequence> </restriction> </complexContent> + * </complexType> + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "groupId", + "artifactId", + "version", + "versioning", + "classifier" +}) +@XmlRootElement(name = "metadata") +public class Metadata { + + /** + * + */ + @XmlElement(required = true) + protected String groupId; + + /** + * + */ + @XmlElement(required = true) + protected String artifactId; + + /** + * + */ + @XmlElement(required = true) + protected String version; + + /** + * + */ + @XmlElement(required = true) + protected Metadata.Versioning versioning; + + /** + * + */ + protected String classifier; + + /** + * Gets the value of the groupId property. + * + * @return possible object is {@link String } + */ + public String getGroupId() { + return groupId; + } + + /** + * Sets the value of the groupId property. + * + * @param value allowed object is {@link String } + */ + public void setGroupId(String value) { + this.groupId = value; + } + + /** + * Gets the value of the artifactId property. + * + * @return possible object is {@link String } + */ + public String getArtifactId() { + return artifactId; + } + + /** + * Sets the value of the artifactId property. + * + * @param value allowed object is {@link String } + */ + public void setArtifactId(String value) { + this.artifactId = value; + } + + /** + * Gets the value of the version property. + * + * @return possible object is {@link String } + */ + public String getVersion() { + return version; + } + + /** + * Sets the value of the version property. + * + * @param value allowed object is {@link String } + */ + public void setVersion(String value) { + this.version = value; + } + + /** + * Gets the value of the versioning property. + * + * @return possible object is {@link Metadata.Versioning } + */ + public Metadata.Versioning getVersioning() { + return versioning; + } + + /** + * Sets the value of the versioning property. + * + * @param value allowed object is {@link Metadata.Versioning } + */ + public void setVersioning(Metadata.Versioning value) { + this.versioning = value; + } + + /** + *

+ * Java class for anonymous complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained + * within this class. + *

+ * < + * pre> + * <complexType> <complexContent> <restriction + * base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> + * <element name="latest" + * type="{http://www.w3.org/2001/XMLSchema}string"/> <element + * name="release" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="versions"> <complexType> <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> <element name="version" + * type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" + * minOccurs="0"/> </sequence> </restriction> </complexContent> + * </complexType> </element> <element name="lastUpdated" + * type="{http://www.w3.org/2001/XMLSchema}long"/> </sequence> + * </restriction> </complexContent> </complexType> + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "latest", + "release", + "versions", + "lastUpdated" + }) + public static class Versioning { + + /** + * + */ + @XmlElement(required = true) + protected String latest; + + /** + * + */ + @XmlElement(required = true) + protected String release; + + /** + * + */ + @XmlElement(required = true) + protected Metadata.Versioning.Versions versions; + + /** + * + */ + protected long lastUpdated; + + /** + * Gets the value of the latest property. + * + * @return possible object is {@link String } + */ + public String getLatest() { + return latest; + } + + /** + * Sets the value of the latest property. + * + * @param value allowed object is {@link String } + */ + public void setLatest(String value) { + this.latest = value; + } + + /** + * Gets the value of the release property. + * + * @return possible object is {@link String } + */ + public String getRelease() { + return release; + } + + /** + * Sets the value of the release property. + * + * @param value allowed object is {@link String } + */ + public void setRelease(String value) { + this.release = value; + } + + /** + * Gets the value of the versions property. + * + * @return possible object is {@link Metadata.Versioning.Versions } + */ + public Metadata.Versioning.Versions getVersions() { + return versions; + } + + /** + * Sets the value of the versions property. + * + * @param value allowed object is {@link Metadata.Versioning.Versions } + */ + public void setVersions(Metadata.Versioning.Versions value) { + this.versions = value; + } + + /** + * Gets the value of the lastUpdated property. + * @return + */ + public long getLastUpdated() { + return lastUpdated; + } + + /** + * Sets the value of the lastUpdated property. + * @param value + */ + public void setLastUpdated(long value) { + this.lastUpdated = value; + } + + /** + *

+ * Java class for anonymous complex type. + *

+ *

+ * The following schema fragment specifies the expected content + * contained within this class. + *

+ * < + * pre> + * <complexType> <complexContent> <restriction + * base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> + * <element name="version" + * type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" + * minOccurs="0"/> </sequence> </restriction> </complexContent> + * </complexType> + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "version" + }) + public static class Versions { + + /** + * + */ + protected List version; + + /** + * Gets the value of the version property. + *

+ *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned + * list will be present inside the JAXB object. This is why there is + * not a set method for the version property. + *

+ *

+ * For example, to add a new item, do as follows: + *

+             *    getVersion().add(newItem);
+             * 
+ *

+ *

+ *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * @return + */ + public List getVersion() { + if (version == null) { + version = new ArrayList(); + } + return this.version; + } + + } + + } + + /** + * Gets the value of the classifier property. + * + * @return possible object is {@link String } + */ + public String getClassifier() { + return classifier; + } + + /** + * Sets the value of the version property. + * + * @param value allowed object is {@link String } + */ + public void setClassifier(String value) { + this.classifier = value; + } + +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/ObjectFactory.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/ObjectFactory.java new file mode 100644 index 00000000..125ca1e3 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/ObjectFactory.java @@ -0,0 +1,55 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2014.09.26 at 03:01:37 PM PKT +// +package com.aspose.slides.maven.artifacts; + +import javax.xml.bind.annotation.XmlRegistry; + +/** + * This object contains factory methods for each Java content interface and Java + * element interface generated in the com.aspose.maven.artifacts package. + *

+ * An ObjectFactory allows you to programatically construct new instances of the + * Java representation for XML content. The Java representation of XML content + * can consist of schema derived interfaces and classes representing the binding + * of schema type definitions, element declarations and model groups. Factory + * methods for each of these are provided in this class. + */ +@XmlRegistry +public class ObjectFactory { + + /** + * Create a new ObjectFactory that can be used to create new instances of + * schema derived classes for package: com.aspose.maven.apis.artifacts + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Metadata.Versioning.Versions } + * @return + */ + public Metadata.Versioning.Versions createMetadataVersioningVersions() { + return new Metadata.Versioning.Versions(); + } + + /** + * Create an instance of {@link Metadata } + * @return + */ + public Metadata createMetadata() { + return new Metadata(); + } + + /** + * Create an instance of {@link Metadata.Versioning } + * @return + */ + public Metadata.Versioning createMetadataVersioning() { + return new Metadata.Versioning(); + } + +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/maven-metada.xml b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/maven-metada.xml new file mode 100644 index 00000000..b0cfdb9c --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/maven-metada.xml @@ -0,0 +1,17 @@ + + + com.aspose + aspose-slides + 14.5.0 + + 14.8.0 + 14.8.0 + + 14.5.0 + 14.6.0 + 14.7.0 + 14.8.0 + + 20140924084136 + + \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/maven-metadata.xsd b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/maven-metadata.xsd new file mode 100644 index 00000000..cc684e88 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/maven-metadata.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExamplePanel.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExamplePanel.java new file mode 100644 index 00000000..319dd31e --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExamplePanel.java @@ -0,0 +1,322 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.examples; + +import com.aspose.slides.maven.utils.AbstractTask; +import com.aspose.slides.maven.utils.AsposeConstants; +import com.aspose.slides.maven.utils.AsposeMavenProjectManager; +import com.aspose.slides.maven.utils.AsposeSlidesJavaAPI; +import javax.swing.*; +import javax.swing.tree.TreePath; +import java.awt.*; +import javax.swing.tree.DefaultTreeModel; +import org.netbeans.api.progress.BaseProgressUtils; +import org.openide.WizardDescriptor; +import org.openide.util.Exceptions; +import org.openide.util.NbBundle; + +public final class AsposeExamplePanel extends JPanel { + + AsposeExampleWizardPanel panel; + + /** + * Creates new form AsposeExamplePanel + * + * @param panel + */ + public AsposeExamplePanel(AsposeExampleWizardPanel panel) { + initComponents(); + initComponentsUser(); + this.panel = panel; + + } + + private void initComponentsUser() { + + CustomMutableTreeNode top = new CustomMutableTreeNode(""); + + DefaultTreeModel model = (DefaultTreeModel) getExamplesTree().getModel(); + model.setRoot(top); + model.reload(top); + + validateDialog(); + } + + @Override + public String getName() { + return AsposeConstants.API_NAME + " for Java API - Code Examples"; + } + + private void initComponents() { + + jPanel1 = new JPanel(); + jLabel2 = new JLabel(); + componentSelection = new JComboBox(); + + jLabel1 = new JLabel(); + jLabelMessage = new JLabel(); + jLabelMessage.setOpaque(true); + jScrollPane1 = new JScrollPane(); + + examplesTree = new JTree(); + + jPanel1.setBackground(new Color(255, 255, 255)); + jPanel1.setBorder(BorderFactory.createEtchedBorder()); + jPanel1.setForeground(new Color(255, 255, 255)); + + jLabel2.setIcon(icon); // NOI18N + jLabel2.setText(""); + jLabel2.setHorizontalAlignment(SwingConstants.CENTER); + jLabel2.setDoubleBuffered(true); + jLabel2.setOpaque(true); + jLabel2.addComponentListener(new java.awt.event.ComponentAdapter() { + @Override + public void componentResized(java.awt.event.ComponentEvent evt) { + jLabel2ComponentResized(evt); + } + }); + + GroupLayout jPanel1Layout = new GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup() + .addComponent(jLabel2, GroupLayout.PREFERRED_SIZE, 390, Short.MAX_VALUE) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup() + .addGroup(GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addComponent(jLabel2) + .addGap(0, 0, Short.MAX_VALUE)) + ); + componentSelection.setModel(new DefaultComboBoxModel()); + + componentSelection.addPropertyChangeListener(new java.beans.PropertyChangeListener() { + @Override + public void propertyChange(java.beans.PropertyChangeEvent evt) { + componentSelection_Propertychanged(evt); + } + }); + jLabel1.setText(NbBundle.getMessage(AsposeExamplePanel.class, "AsposeExample.jLabel1_text")); + jLabelMessage.setText(""); + examplesTree.addMouseListener(new java.awt.event.MouseAdapter() { + @Override + //public void mouseClicked(java.awt.event.MouseEvent evt) { //here + public void mousePressed(java.awt.event.MouseEvent evt) { + examplesTree_clicked(evt); + } + }); + jScrollPane1.setViewportView(examplesTree); + + GroupLayout layout = new GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel1) + .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) + .addComponent(componentSelection, GroupLayout.PREFERRED_SIZE, 198, GroupLayout.PREFERRED_SIZE)) + .addComponent(jLabelMessage, GroupLayout.PREFERRED_SIZE, 361, GroupLayout.PREFERRED_SIZE) + .addComponent(jPanel1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jPanel1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) + .addComponent(componentSelection, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 229, GroupLayout.PREFERRED_SIZE) + .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabelMessage, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)) + ); + } + + + private void jLabel2ComponentResized(java.awt.event.ComponentEvent evt) { + int labelwidth = jLabel2.getWidth(); + int labelheight = jLabel2.getHeight(); + Image img = icon.getImage(); + jLabel2.setIcon(new ImageIcon(img.getScaledInstance(labelwidth, labelheight, Image.SCALE_FAST))); + } + + /** + * + * @return + */ + public String getSelectedProjectRootPath() { + return AsposeMavenProjectManager.getInstance().getProjectDir().getPath(); + } + + void read() { + retrieveAPIDependency(); + retrieveAPIExamples(); + } + + /** + * + * @return + */ + private boolean retrieveAPIDependency() { + getComponentSelection().removeAllItems(); + String versionNo = AsposeMavenProjectManager.getInstance().getDependencyVersionFromPOM(AsposeConstants.API_MAVEN_DEPENDENCY); + if (versionNo == null) { + getComponentSelection().addItem(AsposeConstants.API_DEPENDENCY_NOT_FOUND); + } else { + getComponentSelection().addItem(versionNo); + } + return true; + } + + private void retrieveAPIExamples() { + + final String item = (String) getComponentSelection().getSelectedItem(); + + if (item != null && !item.equals(AsposeConstants.API_DEPENDENCY_NOT_FOUND)) { + + // Downloading Aspose API mvn based examples + AbstractTask downloadExamples = AsposeMavenProjectManager.getInstance().createDownloadExamplesTask(AsposeSlidesJavaAPI.getInstance()); + // Execute the tasks + BaseProgressUtils.showProgressDialogAndRun(downloadExamples, NbBundle.getMessage(AsposeExamplePanel.class, "AsposeManager.updateExamplesMessage")); + + // Populating Aspose API mvn based examples + Runnable popuplateExamples = AsposeMavenProjectManager.getInstance().populateExamplesTask(AsposeSlidesJavaAPI.getInstance(), this); + // Execute the tasks + BaseProgressUtils.showProgressDialogAndRun(popuplateExamples, NbBundle.getMessage(AsposeExamplePanel.class, "AsposeManager.populateExamplesMessage")); + + validateDialog(); + + } + + } + + boolean valid(WizardDescriptor wizardDescriptor) { + + return validateDialog(); + } + + @Override + public void validate() { + + } + + /** + * + * @return + */ + public boolean validateDialog() { + if (isExampleSelected()) { + clearMessage(); + return true; + } + final String item = (String) getComponentSelection().getSelectedItem(); + if (item == null || item.equals(AsposeConstants.API_DEPENDENCY_NOT_FOUND)) { + diplayMessage("Please first add maven dependency of " + AsposeConstants.API_NAME + " for java API", true); + return false; + } else if (!isExampleSelected()) { + diplayMessage(AsposeConstants.ASPOSE_SELECT_EXAMPLE, true); + return false; + } + clearMessage(); + return true; + } + + /** + * + * @return + */ + private boolean isExampleSelected() { + CustomMutableTreeNode comp = (CustomMutableTreeNode) getExamplesTree().getLastSelectedPathComponent(); + if (comp == null) { + return false; + } + try { + + if (!comp.isFolder()) { + return false; + } + } catch (Exception ex) { + Exceptions.printStackTrace(ex); + return false; + } + return true; + } + + /** + * + * @param message + * @param error + */ + public void diplayMessage(String message, boolean error) { + + if (error) { + jLabelMessage.setForeground(Color.RED); + } else { + jLabelMessage.setForeground(Color.GREEN); + } + jLabelMessage.setText(message); + } + + private void clearMessage() { + jLabelMessage.setText(""); + + } + + /** + * + * @param title + * @param message + * @param buttons + * @param icon + * @return + */ + public int showMessage(String title, String message, int buttons, int icon) { + int result = JOptionPane.showConfirmDialog(null, message, title, buttons, icon); + return result; + } + + private void componentSelection_Propertychanged(java.beans.PropertyChangeEvent evt) { + + } + + private void examplesTree_clicked(java.awt.event.MouseEvent evt) { + TreePath path = getExamplesTree().getSelectionPath(); + panel.fireChangeEvent(); + } + + // Variables declaration + private JComboBox componentSelection; + private JTree examplesTree; + private JLabel jLabel1; + private JLabel jLabel2; + private JLabel jLabelMessage; + private JPanel jPanel1; + private JScrollPane jScrollPane1; + private ImageIcon icon = new ImageIcon(getClass().getResource("/resources/long-banner.png")); + // End of variables declaration + + /** + * @return the examplesTree + */ + public JTree getExamplesTree() { + return examplesTree; + } + + /** + * @return the componentSelection + */ + public JComboBox getComponentSelection() { + return componentSelection; + } +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExampleWizard.html b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExampleWizard.html new file mode 100644 index 00000000..0aeb1235 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExampleWizard.html @@ -0,0 +1,13 @@ + + + + + + + Aspose.Slides Code Example wizard allows you to insert Code Examples (to use Aspose.Slides for Java API) in your Java Project.

Code Examples demonstrate Aspose.Slides for Java API uses. New Code Examples are coming out all the time!

Available Code Examples are displayed in tree format from where you can select categorically.

Selected Code Examples are added to the selected project along with their sources and required data files.

Newly added Code Examples are ready to be enhanced, all references are automatically added.

+ + diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExampleWizardIterator.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExampleWizardIterator.java new file mode 100644 index 00000000..61117f1f --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExampleWizardIterator.java @@ -0,0 +1,184 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.aspose.slides.maven.examples; + +import java.awt.Component; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Set; +import javax.swing.JComponent; +import javax.swing.event.ChangeListener; +import org.netbeans.api.templates.TemplateRegistration; +import org.openide.WizardDescriptor; +import org.openide.util.NbBundle.Messages; + +/** + * @author Adeel Ilyas + */ +@TemplateRegistration( + folder = "Classes", + displayName = "#AsposeNewFileWizardIterator_displayName", + iconBase = "com/aspose/slides/maven/Aspose.png", + position = 10, + description = "AsposeExampleWizard.html") +@Messages("AsposeNewFileWizardIterator_displayName=Aspose.Slides Code Example") +public final class AsposeExampleWizardIterator implements WizardDescriptor.InstantiatingIterator { + + private int index; + + private WizardDescriptor wizard; + private List> panels; + + private List> getPanels() { + if (panels == null) { + panels = new ArrayList<>(); + + panels.add(new AsposeExampleWizardPanel()); + String[] steps = createSteps(); + + for (int i = 0; i < panels.size(); i++) { + Component c = panels.get(i).getComponent(); + if (steps[i] == null) { + // Default step name to component name of panel. Mainly + // useful for getting the name of the target chooser to + // appear in the list of steps. + steps[i] = c.getName(); + } + if (c instanceof JComponent) { // assume Swing components + JComponent jc = (JComponent) c; + jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i); + jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); + jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, true); + jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, true); + jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, true); + } + } + } + return panels; + } + + /** + * + * @return + * @throws IOException + */ + @Override + public Set instantiate() throws IOException { + // TODO return set of FileObject (or DataObject) you have created + return Collections.emptySet(); + } + + /** + * + * @param wizard + */ + @Override + public void initialize(WizardDescriptor wizard) { + this.wizard = wizard; + } + + /** + * + * @param wizard + */ + @Override + public void uninitialize(WizardDescriptor wizard) { + panels = null; + } + + /** + * + * @return + */ + @Override + public WizardDescriptor.Panel current() { + return getPanels().get(index); + } + + /** + * + * @return + */ + @Override + public String name() { + return index + 1 + ". from " + getPanels().size(); + } + + /** + * + * @return + */ + @Override + public boolean hasNext() { + return index < getPanels().size() - 1; + } + + /** + * + * @return + */ + @Override + public boolean hasPrevious() { + return index > 0; + } + + /** + * + */ + @Override + public void nextPanel() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + index++; + } + + /** + * + */ + @Override + public void previousPanel() { + if (!hasPrevious()) { + throw new NoSuchElementException(); + } + index--; + } + + // If nothing unusual changes in the middle of the wizard, simply: + + /** + * + * @param l + */ + @Override + public void addChangeListener(ChangeListener l) { + } + + /** + * + * @param l + */ + @Override + public void removeChangeListener(ChangeListener l) { + } + + private String[] createSteps() { + String[] beforeSteps = (String[]) wizard.getProperty("WizardPanel_contentData"); + assert beforeSteps != null : "This wizard may only be used embedded in the template wizard"; + String[] res = new String[(beforeSteps.length - 1) + panels.size()]; + for (int i = 0; i < res.length; i++) { + if (i < (beforeSteps.length - 1)) { + res[i] = beforeSteps[i]; + } else { + res[i] = panels.get(i - beforeSteps.length + 1).getComponent().getName(); + } + } + return res; + } +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExampleWizardPanel.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExampleWizardPanel.java new file mode 100644 index 00000000..2b7c9bf0 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExampleWizardPanel.java @@ -0,0 +1,201 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.aspose.slides.maven.examples; + +import com.aspose.slides.maven.utils.AsposeConstants; +import com.aspose.slides.maven.utils.AsposeMavenProjectManager; +import com.aspose.slides.maven.utils.AsposeSlidesJavaAPI; +import java.io.File; +import java.io.IOException; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import org.netbeans.api.project.Project; +import org.netbeans.spi.project.ui.templates.support.Templates; +import org.openide.WizardDescriptor; +import org.openide.util.Exceptions; +import org.openide.util.HelpCtx; +import org.w3c.dom.NodeList; + +/** + * @author Adeel Ilyas + */ +public class AsposeExampleWizardPanel implements WizardDescriptor.Panel { + + private AsposeExamplePanel component; + private static boolean storeSettingsCalled = false; + + /** + * + * @return + */ + @Override + public AsposeExamplePanel getComponent() { + if (component == null) { + component = new AsposeExamplePanel(this); + } + return component; + } + + /** + * + * @return + */ + @Override + public HelpCtx getHelp() { + + return HelpCtx.DEFAULT_HELP; + + } + + /** + * + * @return + */ + @Override + public boolean isValid() { + // Enables Finish / OK /Next button + return component.validateDialog(); + + } + + private final Set listeners = new HashSet<>(1); // or can use ChangeSupport in NB 6.0 + + /** + * + * @param l + */ + @Override + public void addChangeListener(ChangeListener l) { + synchronized (listeners) { + listeners.add(l); + } + } + + /** + * + * @param l + */ + @Override + public void removeChangeListener(ChangeListener l) { + synchronized (listeners) { + listeners.remove(l); + } + } + + /** + * + */ + protected final void fireChangeEvent() { + + Iterator it; + synchronized (listeners) { + it = new HashSet<>(listeners).iterator(); + } + ChangeEvent ev = new ChangeEvent(this); + while (it.hasNext()) { + it.next().stateChanged(ev); + } + } + + /** + * + * @param wiz + */ + @Override + public void readSettings(WizardDescriptor wiz) { + Project selectedProject = Templates.getProject(wiz); + + File projdir = new File(selectedProject.getProjectDirectory().getPath()); + + wiz.putProperty("projdir", projdir); + AsposeMavenProjectManager asposeMavenProjectManager = AsposeMavenProjectManager.initialize(wiz); + AsposeSlidesJavaAPI.initialize(asposeMavenProjectManager); + component.read(); + } + + /** + * + * @param wiz + */ + @Override + public void storeSettings(WizardDescriptor wiz) { + + boolean cancelled = wiz.getValue() != WizardDescriptor.FINISH_OPTION; + if (!cancelled) { + if (!storeSettingsCalled) { + storeSettingsCalled = true; + createExample(); + } else { + storeSettingsCalled = false; + + } + } + } + + private boolean createExample() { + String projectPath = component.getSelectedProjectRootPath(); + CustomMutableTreeNode comp = getSelectedNode(); + if (comp == null || !comp.isFolder()) { + return false; + } + try { + + String sourceRepositoryExamplePath = comp.getExPath(); + if (sourceRepositoryExamplePath == null) { + return false; + } + String repositorylocation = AsposeSlidesJavaAPI.getInstance().getLocalRepositoryPath(); + String repositoryPOM_XML = repositorylocation + File.separator + "Examples" + File.separator + AsposeConstants.MAVEN_POM_XML; + + NodeList examplesNoneAsposeDependencies = AsposeMavenProjectManager.getInstance().getDependenciesFromPOM(repositoryPOM_XML, AsposeConstants.ASPOSE_GROUP_ID); + + AsposeMavenProjectManager.getInstance().addMavenDependenciesInProject(examplesNoneAsposeDependencies); + + NodeList examplesNoneAsposeRepositories = AsposeMavenProjectManager.getInstance().getRepositoriesFromPOM(repositoryPOM_XML, AsposeConstants.ASPOSE_MAVEN_REPOSITORY); + + AsposeMavenProjectManager.getInstance().addMavenRepositoriesInProject(examplesNoneAsposeRepositories); + + String sourceExamplesUtilsPath = repositorylocation + File.separator + AsposeConstants.EXAMPLES_UTIL; + String destinationExamplesUtilsPath = projectPath + File.separator + sourceExamplesUtilsPath.replace(repositorylocation + File.separator + AsposeConstants.GITHUB_EXAMPLES_SOURCE_LOCATION, AsposeConstants.PROJECT_EXAMPLES_SOURCE_LOCATION); + + String destinationExamplePath = projectPath + File.separator + sourceRepositoryExamplePath.replace(repositorylocation + File.separator + AsposeConstants.GITHUB_EXAMPLES_SOURCE_LOCATION, AsposeConstants.PROJECT_EXAMPLES_SOURCE_LOCATION); + + String destinationResourcePath = projectPath + File.separator + sourceRepositoryExamplePath.replace(repositorylocation + File.separator + AsposeConstants.GITHUB_EXAMPLES_SOURCE_LOCATION, AsposeConstants.PROJECT_EXAMPLES_RESOURCES_LOCATION); + + String sourceRepositoryExampleResourcesPath = sourceRepositoryExamplePath.replace(AsposeConstants.GITHUB_EXAMPLES_SOURCE_LOCATION, AsposeConstants.GITHUB_EXAMPLES_RESOURCES_LOCATION); + + //Copying Example Category + copyExample(sourceRepositoryExamplePath, destinationExamplePath); + + //Copying Example Resoureces + copyExample(sourceRepositoryExampleResourcesPath, destinationResourcePath); + + //Copying Utils.java + AsposeMavenProjectManager.copyDirectory(new File(sourceExamplesUtilsPath + File.separator), new File(destinationExamplesUtilsPath + File.separator)); + + + + } catch (Exception ex) { + return false; + } + return true; + } + + private CustomMutableTreeNode getSelectedNode() { + return (CustomMutableTreeNode) component.getExamplesTree().getLastSelectedPathComponent(); + } + + private void copyExample(String sourcePath, String destinationPath) { + try { + AsposeMavenProjectManager.copyDirectory(sourcePath, destinationPath); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/Bundle.properties b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/Bundle.properties new file mode 100644 index 00000000..4d074284 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/Bundle.properties @@ -0,0 +1,8 @@ +# To change this license header, choose License Headers in Project Properties. +# To change this template file, choose Tools | Templates +# and open the template in the editor. + +AsposeExample.jLabel1_text=Aspose.Slides for Java (version): +AsposeManager.populateExamplesMessage=Populating Aspose.Slides for Java API examples... +AsposeManager.updateExamplesMessage=Updating Aspose.Slides for Java API examples... +AsposeManager.populateExamplesTitle=Populating Example code list... \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/CustomMutableTreeNode.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/CustomMutableTreeNode.java new file mode 100644 index 00000000..0d78333c --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/CustomMutableTreeNode.java @@ -0,0 +1,70 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.examples; + +import javax.swing.tree.DefaultMutableTreeNode; + +/** + * + * @author Adeel Ilyas + */ +public final class CustomMutableTreeNode extends DefaultMutableTreeNode { + + private boolean folder; + private String _ExPath; + + /** + * + * @param data + */ + public void setTopTreeNodeText(String data) { + this.userObject = data; + } + + /** + * + * @param data + */ + public CustomMutableTreeNode(String data) { + this.userObject = data; + } + + /** + * @return the _ExPath + */ + public String getExPath() { + return _ExPath; + } + + /** + * @param ExPath the _ExPath to set + */ + public void setExPath(String ExPath) { + this._ExPath = ExPath; + } + + /** + * + * @return + */ + public boolean isFolder() { + return folder; + } + + /** + * + * @param folder + */ + public void setFolder(boolean folder) { + this.folder = folder; + } +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AbstractTask.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AbstractTask.java new file mode 100644 index 00000000..d4d4e453 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AbstractTask.java @@ -0,0 +1,31 @@ +package com.aspose.slides.maven.utils; + +import org.netbeans.api.progress.aggregate.AggregateProgressFactory; +import org.netbeans.api.progress.aggregate.ProgressContributor; + +/** + * @author Adeel Ilyas + */ +public abstract class AbstractTask extends Thread { + + /** + * + */ + protected ProgressContributor p = null; + + /** + * + * @param id + */ + public AbstractTask(String id) { + p = AggregateProgressFactory.createProgressContributor(id); + } + + /** + * + * @return + */ + public ProgressContributor getProgressContributor() { + return p; + } +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AsposeConstants.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AsposeConstants.java new file mode 100644 index 00000000..cd8fd190 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AsposeConstants.java @@ -0,0 +1,144 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.utils; + +/* + * @author Adeel Ilyas + */ +import java.io.File; + +/** + * + * @author Adeel + */ +public class AsposeConstants { + + /** + * + */ + public static final String API_NAME = "Aspose.Slides"; + + /** + * + */ + public static final String API_MAVEN_DEPENDENCY = "aspose-slides"; + + /** + * + */ + public static final String API_EXAMPLES_PACKAGE = "com" + File.separator + API_MAVEN_DEPENDENCY.replace("-", File.separator) + File.separator + "examples"; + + /** + * + */ + public static final String GITHUB_EXAMPLES_SOURCE_LOCATION = "Examples" + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator + API_EXAMPLES_PACKAGE; + + /** + * + */ + public static final String GITHUB_EXAMPLES_RESOURCES_LOCATION = "Examples" + File.separator + "src" + File.separator + "main" + File.separator + "resources" + File.separator + API_EXAMPLES_PACKAGE; + + /** + * + */ + public static final String PROJECT_EXAMPLES_SOURCE_LOCATION = "src" + File.separator + "main" + File.separator + "java" + File.separator + API_EXAMPLES_PACKAGE; + + /** + * + */ + public static final String PROJECT_EXAMPLES_RESOURCES_LOCATION = "src" + File.separator + "main" + File.separator + "resources" + File.separator + API_EXAMPLES_PACKAGE; + + /** + * + */ + public static final String EXAMPLES_UTIL = GITHUB_EXAMPLES_SOURCE_LOCATION + File.separator + "Utils.java"; + + /** + * + */ + public static final String API_DEPENDENCY_NOT_FOUND = "Dependency not found!"; + + /** + * + */ + public static final String MAVEN_POM_XML = "pom.xml"; + + /** + * + */ + public static final String WIZARD_NAME = "Aspose.Slides Maven Project"; + + /** + * + */ + public static final String ASPOSE_SELECT_EXAMPLE = "Please just select one examples category"; + + /** + * + */ + public static final String INTERNET_CONNNECTIVITY_PING_URL = "java.sun.com"; + + /** + * + */ + public static final String ASPOSE_MAVEN_REPOSITORY = "http://maven.aspose.com"; + + /** + * + */ + public static final String ASPOSE_GROUP_ID = "com.aspose"; + + /** + * + */ + public static final String INTERNET_REQUIRED_MSG = "Internet connectivity is not available!\nInternet connectivity is required to retrieve latest Aspose.Slides Maven Artifact"; + + /** + * + */ + public static final String EXAMPLES_INTERNET_REQUIRED_MSG = "Internet connectivity is required to download examples"; + + /** + * + */ + public static final String MAVEN_ARTIFACTS_RETRIEVE_FAIL = "Unknown Error!\nCould not retrieve latest Aspose.Slides Maven Artifact!"; + + /** + * + */ + public static final String EXAMPLES_DOWNLOAD_FAIL = "Unknown Error!\nCould not download Aspose.Slides for Java API example Source codes!"; + + /** + * + */ + public static final String EXAMPLES_NOT_AVAILABLE_MSG = "This component does not have examples yet, We will add examples soon"; + + /** + * + */ + public static final String EXAMPLES_NOT_AVAILABLE_TITLE = "Examples not available"; + + /** + * + */ + public static boolean printingAllowed = false; + + /** + * + * @param message + */ + public static final void println(String message) { + if (printingAllowed) { + System.out.println(message); + } + } +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AsposeJavaAPI.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AsposeJavaAPI.java new file mode 100644 index 00000000..9b5fd053 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AsposeJavaAPI.java @@ -0,0 +1,168 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.utils; + +import javax.swing.*; +import java.io.File; +import org.netbeans.api.progress.aggregate.ProgressContributor; +import org.openide.util.Exceptions; + + +public abstract class AsposeJavaAPI { + + /** + * + * @return + */ + public abstract String get_name(); + + /** + * + * @return + */ + public abstract String get_mavenRepositoryURL(); + + /** + * + * @return + */ + public abstract String get_remoteExamplesRepository(); + + /** + * + * @return + */ + public boolean isExamplesNotAvailable() { + return examplesNotAvailable; + } + + /** + * + */ + public boolean examplesNotAvailable; + + /** + * + * @return + */ + public boolean isExamplesDefinitionAvailable() { + return examplesDefinitionAvailable; + } + + /** + * + */ + public boolean examplesDefinitionAvailable; + + /** + * + */ + public AsposeMavenProjectManager asposeMavenProjectManager; + + /** + * + * @param p + */ + public void checkAndUpdateRepo(ProgressContributor p) { + + if (null == get_remoteExamplesRepository()) { + AsposeMavenProjectManager.showMessage(AsposeConstants.EXAMPLES_NOT_AVAILABLE_TITLE, get_name() + " - " + AsposeConstants.EXAMPLES_NOT_AVAILABLE_MSG, JOptionPane.CLOSED_OPTION, JOptionPane.INFORMATION_MESSAGE); + examplesNotAvailable = true; + examplesDefinitionAvailable = false; + return; + } else { + examplesNotAvailable = false; + } + + if (isExamplesDefinitionsPresent()) { + try { + examplesDefinitionAvailable = true; + syncRepository(p); + p.progress(60); + } catch (Exception e) { + } + } else { + updateRepository(p); + if (isExamplesDefinitionsPresent()) { + examplesDefinitionAvailable = true; + + } + + } + p.progress(70); + } + + /** + * + * @param p + * @return + */ + public boolean downloadExamples(ProgressContributor p) { + try { + checkAndUpdateRepo(p); + } catch (Exception rex) { + Exceptions.printStackTrace(rex); + return false; + } + + return true; + + } + + /** + * + * @param p + */ + public void updateRepository(ProgressContributor p) { + AsposeMavenProjectManager.checkAndCreateFolder(getLocalRepositoryPath()); + + try { + + GitHelper.updateRepository(getLocalRepositoryPath(), get_remoteExamplesRepository()); + p.progress(55); + + } catch (Exception e) { + Exceptions.printStackTrace(e); + } + } + + /** + * + * @param p + */ + public void syncRepository(ProgressContributor p) { + try { + + GitHelper.syncRepository(getLocalRepositoryPath(), get_remoteExamplesRepository()); + p.progress(55); + + } catch (Exception e) { + Exceptions.printStackTrace(e); + } + } + + /** + * + * @return boolean + */ + public boolean isExamplesDefinitionsPresent() { + return new File(getLocalRepositoryPath()).exists(); + } + + /** + * + * @return String + */ + public String getLocalRepositoryPath() { + return asposeMavenProjectManager.getAsposeHomePath() + "GitConsRepos" + File.separator + get_name(); + } +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AsposeMavenProjectManager.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AsposeMavenProjectManager.java new file mode 100644 index 00000000..81ba5d88 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AsposeMavenProjectManager.java @@ -0,0 +1,623 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.utils; + +import com.aspose.slides.maven.AsposeMavenProjectWizardIterator; +import com.aspose.slides.maven.artifacts.Metadata; +import com.aspose.slides.maven.artifacts.ObjectFactory; +import com.aspose.slides.maven.examples.AsposeExamplePanel; +import com.aspose.slides.maven.examples.CustomMutableTreeNode; +import org.w3c.dom.Document; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; +import java.util.List; +import javax.swing.*; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Unmarshaller; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.stream.StreamSource; +import javax.xml.xpath.*; +import java.io.*; +import java.net.*; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.Queue; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreePath; +import javax.xml.bind.JAXBException; +import org.openide.WizardDescriptor; +import org.openide.awt.StatusDisplayer; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileUtil; +import org.openide.util.Exceptions; +import org.openide.util.NbBundle; +import org.openide.xml.XMLUtil; +import org.w3c.dom.Node; + +public class AsposeMavenProjectManager { + + private boolean examplesNotAvailable; + private File projectDir = null; + + /** + * + * @return + */ + public File getProjectDir() { + return projectDir; + } + private boolean examplesDefinitionAvailable; + + /** + * + * @param Url + * @return + * @throws IOException + */ + public String readURLContents(String Url) throws IOException { + URL url = new URL(Url); + URLConnection con = url.openConnection(); + InputStream in = con.getInputStream(); + String encoding = con.getContentEncoding(); + encoding = encoding == null ? "UTF-8" : encoding; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] buf = new byte[8192]; + int len = 0; + while ((len = in.read(buf)) != -1) { + baos.write(buf, 0, len); + } + String body = new String(baos.toByteArray(), encoding); + return body; + } + + /** + * + * @param productMavenRepositoryUrl + * @return + */ + public Metadata getProductMavenDependency(String productMavenRepositoryUrl) { + final String mavenMetaDataFileName = "maven-metadata.xml"; + Metadata data = null; + + try { + String productMavenInfo; + productMavenInfo = readURLContents(productMavenRepositoryUrl + mavenMetaDataFileName); + JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class); + Unmarshaller unmarshaller; + unmarshaller = jaxbContext.createUnmarshaller(); + + data = (Metadata) unmarshaller.unmarshal(new StreamSource(new StringReader(productMavenInfo))); + + String remoteArtifactFile = productMavenRepositoryUrl + data.getVersioning().getLatest() + "/" + data.getArtifactId() + "-" + data.getVersioning().getLatest(); + + if (!remoteFileExists(remoteArtifactFile + ".jar")) { + AsposeConstants.println("Not Exists"); + data.setClassifier(getResolveSupportedJDK(remoteArtifactFile)); + } else { + AsposeConstants.println("Exists"); + } + } catch (IOException | JAXBException ex) { + Exceptions.printStackTrace(ex); + data = null; + } + return data; + } + + /** + * + * @param ProductURL + * @return + */ + public String getResolveSupportedJDK(String ProductURL) { + String supportedJDKs[] = {"jdk17", "jdk16", "jdk15", "jdk14", "jdk18"}; + String classifier = null; + for (String jdkCheck : supportedJDKs) { + if (remoteFileExists(ProductURL + "-" + jdkCheck + ".jar")) { + AsposeConstants.println("Exists"); + classifier = jdkCheck; + break; + } else { + AsposeConstants.println("Not Exists"); + } + } + return classifier; + } + + /** + * + * @param URLName + * @return + */ + public boolean remoteFileExists(String URLName) { + try { + HttpURLConnection.setFollowRedirects(false); + // note : you may also need + // HttpURLConnection.setInstanceFollowRedirects(false) + HttpURLConnection con + = (HttpURLConnection) new URL(URLName).openConnection(); + con.setRequestMethod("HEAD"); + return (con.getResponseCode() == HttpURLConnection.HTTP_OK); + } catch (Exception e) { + Exceptions.printStackTrace(e); + return false; + } + } + + /** + * + * @param asposeAPI + * @return + */ + public AbstractTask retrieveAsposeAPIMavenTask(final AsposeJavaAPI asposeAPI) { + return new AbstractTask(NbBundle.getMessage(AsposeMavenProjectWizardIterator.class, "AsposeManager.progressTitle")) { + @Override + public void run() { + String progressMsg = NbBundle.getMessage(AsposeMavenProjectWizardIterator.class, "AsposeManager.progressMessage"); + + p.progress(progressMsg); + StatusDisplayer.getDefault().setStatusText(progressMsg); + + p.start(100); + p.progress(50); + retrieveAsposeMavenDependencies(); + StatusDisplayer.getDefault().setStatusText(progressMsg); + p.progress(100); + p.finish(); + } + }; + } + + /** + * + * @param asposeAPI + * @return + */ + public AbstractTask createDownloadExamplesTask(final AsposeJavaAPI asposeAPI) { + return new AbstractTask(NbBundle.getMessage(AsposeMavenProjectWizardIterator.class, "AsposeManager.progressExamplesTitle")) { + @Override + public void run() { + String downloadExamplesMessage = NbBundle.getMessage(AsposeMavenProjectWizardIterator.class, "AsposeManager.downloadExamplesMessage"); + + p.progress(downloadExamplesMessage); + StatusDisplayer.getDefault().setStatusText(downloadExamplesMessage); + p.start(100); + p.progress(50); + asposeAPI.downloadExamples(p); + p.progress(downloadExamplesMessage); + p.progress(100); + p.finish(); + } + }; + } + + /** + * + * @param asposeAPI + * @param panel + * @return + */ + public Runnable populateExamplesTask(final AsposeJavaAPI asposeAPI, final AsposeExamplePanel panel) { + + return new Runnable() { + @Override + public void run() { + final CustomMutableTreeNode top = new CustomMutableTreeNode(""); + DefaultTreeModel model = (DefaultTreeModel) panel.getExamplesTree().getModel(); + model.setRoot(top); + model.reload(top); + AsposeJavaAPI component = AsposeSlidesJavaAPI.getInstance(); + if (component.isExamplesDefinitionAvailable()) { + populateExamplesTree(component, top, panel); + } + top.setTopTreeNodeText(AsposeConstants.API_NAME); + model.setRoot(top); + model.reload(top); + panel.getExamplesTree().expandPath(new TreePath(top.getPath())); + } + }; + + } + + /** + * + * @return + */ + public boolean retrieveAsposeMavenDependencies() { + try { + getAsposeProjectMavenDependencies().clear(); + AsposeJavaAPI component = AsposeSlidesJavaAPI.getInstance(); + Metadata productMavenDependency = getProductMavenDependency(component.get_mavenRepositoryURL()); + if (productMavenDependency != null) { + getAsposeProjectMavenDependencies().add(productMavenDependency); + } + + } catch (Exception rex) { + Exceptions.printStackTrace(rex); + return false; + } + return !getAsposeProjectMavenDependencies().isEmpty(); + } + + /** + * + * @return + */ + public static boolean isInternetConnected() { + try { + InetAddress address = InetAddress.getByName(AsposeConstants.INTERNET_CONNNECTIVITY_PING_URL); + if (address == null) { + return false; + } + } catch (UnknownHostException e) { + Exceptions.printStackTrace(e); + return false; + } + + return true; + } + + /** + * + * @param title + * @param message + * @param buttons + * @param icon + * @return + */ + public static int showMessage(String title, String message, int buttons, int icon) { + int result = JOptionPane.showConfirmDialog(null, message, title, buttons, icon); + return result; + } + + private Document getXmlDocument(String mavenPomXmlfile) throws ParserConfigurationException, SAXException, IOException { + DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); + Document pomDocument = docBuilder.parse(mavenPomXmlfile); + + return pomDocument; + } + + /** + * + * @param dependencyName + * @return + */ + public String getDependencyVersionFromPOM(String dependencyName) { + try { + String mavenPomXmlfile = projectDir.getPath() + File.separator + AsposeConstants.MAVEN_POM_XML; + + Document pomDocument = getXmlDocument(mavenPomXmlfile); + + XPathFactory xPathfactory = XPathFactory.newInstance(); + XPath xpath = xPathfactory.newXPath(); + String expression = "//version[ancestor::dependency/artifactId[text()='" + dependencyName + "']]"; + XPathExpression xPathExpr = xpath.compile(expression); + NodeList nl = (NodeList) xPathExpr.evaluate(pomDocument, XPathConstants.NODESET); + + if (nl != null && nl.getLength() > 0) { + return nl.item(0).getTextContent(); + } + } catch (IOException | ParserConfigurationException | SAXException | XPathExpressionException e) { + Exceptions.printStackTrace(e); + } + return null; + } + + /** + * + * @return + */ + public String getAsposeHomePath() { + + return System.getProperty("user.home") + File.separator + "aspose" + File.separator; + + } + + /** + * + * @param sourceLocation + * @param targetLocation + * @throws IOException + */ + public static void copyDirectory(String sourceLocation, String targetLocation) throws IOException { + + checkAndCreateFolder(targetLocation); + copyDirectory(new File(sourceLocation + File.separator), new File(targetLocation + File.separator)); + } + + /** + * + * @param sourceLocation + * @param targetLocation + * @throws IOException + */ + public static void copyDirectory(File sourceLocation, File targetLocation) throws IOException { + if (sourceLocation.isDirectory()) { + if (!targetLocation.exists()) { + targetLocation.mkdir(); + } + + String[] children = sourceLocation.list(); + for (String children1 : children) { + copyDirectory(new File(sourceLocation, children1), new File(targetLocation, children1)); + } + } else { + + OutputStream out; + try (InputStream in = new FileInputStream(sourceLocation)) { + out = new FileOutputStream(targetLocation); + // Copy the bits from instream to outstream + byte[] buf = new byte[1024]; + int len; + while ((len = in.read(buf)) > 0) { + out.write(buf, 0, len); + } + } + out.close(); + } + } + + /** + * + * @param folderPath + */ + public static void checkAndCreateFolder(String folderPath) { + File folder = new File(folderPath); + if (!folder.exists()) { + folder.mkdirs(); + } + } + // Singleton instance + private static AsposeMavenProjectManager asposeMavenProjectManager = new AsposeMavenProjectManager(); + + /** + * + * @return + */ + public static AsposeMavenProjectManager getInstance() { + return asposeMavenProjectManager; + } + + /** + * + * @param wiz + * @return + */ + public static AsposeMavenProjectManager initialize(WizardDescriptor wiz) { + asposeMavenProjectManager = new AsposeMavenProjectManager(); + asposeMavenProjectManager.projectDir = FileUtil.normalizeFile((File) wiz.getProperty("projdir")); + return asposeMavenProjectManager; + } + + private AsposeMavenProjectManager() { + } + + /** + * + * @return + */ + public static List getAsposeProjectMavenDependencies() { + return asposeProjectMavenDependencies; + } + + /** + * + */ + public static void clearAsposeProjectMavenDependencies() { + asposeProjectMavenDependencies.clear(); + } + + private static final List asposeProjectMavenDependencies = new ArrayList(); + + /** + * + * @param addTheseDependencies + */ + public void addMavenDependenciesInProject(NodeList addTheseDependencies) { + + String mavenPomXmlfile = projectDir.getPath() + File.separator + AsposeConstants.MAVEN_POM_XML; + + try { + Document pomDocument = getXmlDocument(mavenPomXmlfile); + + Node dependenciesNode = pomDocument.getElementsByTagName("dependencies").item(0); + + if (addTheseDependencies != null && addTheseDependencies.getLength() > 0) { + for (int n = 0; n < addTheseDependencies.getLength(); n++) { + String artifactId = addTheseDependencies.item(n).getFirstChild().getNextSibling().getNextSibling().getNextSibling().getFirstChild().getNodeValue(); + + XPathFactory xPathfactory = XPathFactory.newInstance(); + XPath xpath = xPathfactory.newXPath(); + String expression = "//artifactId[text()='" + artifactId + "']"; + + XPathExpression xPathExpr = xpath.compile(expression); + + Node dependencyAlreadyExist = (Node) xPathExpr.evaluate(pomDocument, XPathConstants.NODE); + + if (dependencyAlreadyExist != null) { + Node dependencies = pomDocument.getElementsByTagName("dependencies").item(0); + dependencies.removeChild(dependencyAlreadyExist.getParentNode()); + } + + Node importedNode = pomDocument.importNode(addTheseDependencies.item(n), true); + dependenciesNode.appendChild(importedNode); + + } + } + removeEmptyLinesfromDOM(pomDocument); + writeToPOM(pomDocument); + + } catch (ParserConfigurationException | SAXException | XPathExpressionException | IOException ex) { + Exceptions.printStackTrace(ex); + } + } + + /** + * + * @param addTheseRepositories + */ + public void addMavenRepositoriesInProject(NodeList addTheseRepositories) { + String mavenPomXmlfile = projectDir.getPath() + File.separator + AsposeConstants.MAVEN_POM_XML; + + try { + Document pomDocument = getXmlDocument(mavenPomXmlfile); + + Node repositoriesNode = pomDocument.getElementsByTagName("repositories").item(0); + + if (addTheseRepositories != null && addTheseRepositories.getLength() > 0) { + for (int n = 0; n < addTheseRepositories.getLength(); n++) { + String repositoryId = addTheseRepositories.item(n).getFirstChild().getNextSibling().getFirstChild().getNodeValue(); + + XPathFactory xPathfactory = XPathFactory.newInstance(); + XPath xpath = xPathfactory.newXPath(); + String expression = "//id[text()='" + repositoryId + "']"; + + XPathExpression xPathExpr = xpath.compile(expression); + + Boolean repositoryAlreadyExist = (Boolean) xPathExpr.evaluate(pomDocument, XPathConstants.BOOLEAN); + + if (!repositoryAlreadyExist) { + Node importedNode = pomDocument.importNode(addTheseRepositories.item(n), true); + repositoriesNode.appendChild(importedNode); + } + + } + } + removeEmptyLinesfromDOM(pomDocument); + writeToPOM(pomDocument); + + } catch (XPathExpressionException | SAXException | ParserConfigurationException | IOException ex) { + Exceptions.printStackTrace(ex); + } + } + + /** + * + * @param pomDocument + * @throws IOException + */ + public void writeToPOM(Document pomDocument) throws IOException { + + FileObject projectRoot = FileUtil.toFileObject(projectDir); + FileObject fo = FileUtil.createData(projectRoot, AsposeConstants.MAVEN_POM_XML); + try (OutputStream out = fo.getOutputStream()) { + XMLUtil.write(pomDocument, out, "UTF-8"); + } + } + + /** + * + * @param mavenPomXmlfile + * @param excludeGroup + * @return + */ + public NodeList getDependenciesFromPOM(String mavenPomXmlfile, String excludeGroup) { + + try { + + Document pomDocument = getXmlDocument(mavenPomXmlfile); + + XPathFactory xPathfactory = XPathFactory.newInstance(); + XPath xpath = xPathfactory.newXPath(); + String expression = "//dependency[child::groupId[text()!='" + excludeGroup + "']]"; + XPathExpression xPathExpr = xpath.compile(expression); + NodeList nl = (NodeList) xPathExpr.evaluate(pomDocument, XPathConstants.NODESET); + if (nl != null && nl.getLength() > 0) { + return nl; + } + } catch (IOException | ParserConfigurationException | SAXException | XPathExpressionException e) { + Exceptions.printStackTrace(e); + } + return null; + } + + /** + * + * @param mavenPomXmlfile + * @param excludeURL + * @return + */ + public NodeList getRepositoriesFromPOM(String mavenPomXmlfile, String excludeURL) { + + try { + + Document pomDocument = getXmlDocument(mavenPomXmlfile); + + XPathFactory xPathfactory = XPathFactory.newInstance(); + XPath xpath = xPathfactory.newXPath(); + String expression = "//repository[child::url[not(starts-with(.,'" + excludeURL + "'))]]"; + XPathExpression xPathExpr = xpath.compile(expression); + NodeList nl = (NodeList) xPathExpr.evaluate(pomDocument, XPathConstants.NODESET); + if (nl != null && nl.getLength() > 0) { + return nl; + } + } catch (IOException | ParserConfigurationException | SAXException | XPathExpressionException e) { + Exceptions.printStackTrace(e); + } + return null; + } + + private void removeEmptyLinesfromDOM(Document doc) throws XPathExpressionException { + XPath xp = XPathFactory.newInstance().newXPath(); + NodeList nl = (NodeList) xp.evaluate("//text()[normalize-space(.)='']", doc, XPathConstants.NODESET); + + for (int i = 0; i < nl.getLength(); ++i) { + Node node = nl.item(i); + node.getParentNode().removeChild(node); + } + } + + /** + * + * @param asposeComponent + * @param top + * @param panel + */ + public void populateExamplesTree(AsposeJavaAPI asposeComponent, CustomMutableTreeNode top, AsposeExamplePanel panel) { + String examplesFullPath = asposeComponent.getLocalRepositoryPath() + File.separator + AsposeConstants.GITHUB_EXAMPLES_SOURCE_LOCATION; + File directory = new File(examplesFullPath); + panel.getExamplesTree().removeAll(); + top.setExPath(examplesFullPath); + Queue queue = new LinkedList<>(); + queue.add(new Object[]{null, directory}); + + while (!queue.isEmpty()) { + Object[] _entry = queue.remove(); + File childFile = ((File) _entry[1]); + CustomMutableTreeNode parentItem = ((CustomMutableTreeNode) _entry[0]); + if (childFile.isDirectory()) { + if (parentItem != null) { + CustomMutableTreeNode child = new CustomMutableTreeNode(FormatExamples.formatTitle(childFile.getName())); + child.setExPath(childFile.getAbsolutePath()); + child.setFolder(true); + parentItem.add(child); + parentItem = child; + } else { + parentItem = top; + } + for (File f : childFile.listFiles()) { + queue.add(new Object[]{parentItem, f}); + } + } else if (childFile.isFile()) { + + String title = FormatExamples.formatTitle(childFile.getName()); + CustomMutableTreeNode child = new CustomMutableTreeNode(title); + child.setFolder(false); + parentItem.add(child); + + } + } + + } +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AsposeSlidesJavaAPI.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AsposeSlidesJavaAPI.java new file mode 100644 index 00000000..d74f8e24 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/AsposeSlidesJavaAPI.java @@ -0,0 +1,78 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.utils; + +/* + * @author Adeel Ilyas + * + */ +// Singleton Class + +/** + * + * @author Adeel + */ +public class AsposeSlidesJavaAPI extends AsposeJavaAPI { + + private final String _name = AsposeConstants.API_NAME; + private final String _mavenRepositoryURL = "http://maven.aspose.com/repository/ext-release-local/com/aspose/aspose-slides/"; + private final String _remoteExamplesRepository = "https://github.com/asposeslides/Aspose_Slides_Java"; + + /** + * @return the _name + */ + @Override + public String get_name() { + return _name; + } + + /** + * @return the _mavenRepositoryURL + */ + @Override + public String get_mavenRepositoryURL() { + return _mavenRepositoryURL; + } + + /** + * @return the _remoteExamplesRepository + */ + @Override + public String get_remoteExamplesRepository() { + return _remoteExamplesRepository; + } + + // Singleton instance + private static AsposeJavaAPI asposeSlidesAPI; + + /** + * + * @return + */ + public static AsposeJavaAPI getInstance() { + return asposeSlidesAPI; + } + + /** + * + * @param asposeMavenProjectManager + * @return + */ + public static AsposeJavaAPI initialize(AsposeMavenProjectManager asposeMavenProjectManager) { + asposeSlidesAPI = new AsposeSlidesJavaAPI(); + asposeSlidesAPI.asposeMavenProjectManager = asposeMavenProjectManager; + return asposeSlidesAPI; + } + + private AsposeSlidesJavaAPI() { + } +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/FormatExamples.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/FormatExamples.java new file mode 100644 index 00000000..c4017f8e --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/FormatExamples.java @@ -0,0 +1,30 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.utils; + +import org.apache.commons.lang.WordUtils; + +public class FormatExamples { + + /** + * + * @param inputStr + * @return + */ + public static String formatTitle(String inputStr) { + String title = inputStr.replaceAll("(_|.java|\\.)", " "); + title = title.replaceAll("([A-Z])", " $1"); + title = WordUtils.capitalize(title); + + return title; + } +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/GitHelper.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/GitHelper.java new file mode 100644 index 00000000..1bd150b1 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/GitHelper.java @@ -0,0 +1,76 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.aspose.slides.maven.utils; + +import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.internal.storage.file.FileRepository; +import org.eclipse.jgit.lib.Repository; + +import java.io.File; + +/** + * @author Adeel Ilyas + * + */ +public class GitHelper { + + /** + * + * @param localPath + * @param remotePath + * @throws Exception + */ + public static void updateRepository(String localPath, String remotePath) throws Exception { + Repository localRepo; + try { + localRepo = new FileRepository(localPath + "/.git"); + + Git git = new Git(localRepo); + + // First try to clone the repository + try { + Git.cloneRepository().setURI(remotePath).setDirectory(new File(localPath)).call(); + } catch (Exception ex) { + // If clone fails, try to pull the changes + try { + git.pull().call(); + } catch (Exception exPull) { + // Pull also failed. Throw this exception to caller + throw exPull; // throw it + } + } + } catch (Exception ex) { + throw new Exception("Could not download Repository from Github. Error: " + ex.getMessage()); + } + } + + /** + * + * @param localPath + * @param remotePath + * @throws Exception + */ + public static void syncRepository(String localPath, String remotePath) throws Exception { + Repository localRepo; + try { + localRepo = new FileRepository(localPath + "/.git"); + + Git git = new Git(localRepo); + + // Pull the changes + try { + git.pull().call(); + } catch (Exception exPull) { + // If pull failed. Throw this exception to caller + + throw exPull; // throw it + } + + } catch (Exception ex) { + throw new Exception("Could not update Repository from Github. Error: " + ex.getMessage()); + } + } + +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/TasksExecutor.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/TasksExecutor.java new file mode 100644 index 00000000..8faf620f --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/utils/TasksExecutor.java @@ -0,0 +1,78 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.aspose.slides.maven.utils; + +import java.util.ArrayList; +import java.util.List; +import org.netbeans.api.progress.aggregate.AggregateProgressFactory; +import org.netbeans.api.progress.aggregate.AggregateProgressHandle; +import org.netbeans.api.progress.aggregate.ProgressContributor; + +/** + * @author Adeel Ilyas + */ +public class TasksExecutor { + + private final List tasks = new ArrayList<>(); + private final String tasksName; + + /** + * + * @param tasksName + */ + public TasksExecutor(String tasksName) { + this.tasksName = tasksName; + + } + + /** + * + * @param task + */ + public void addNewTask(AbstractTask task) { + tasks.add(task); + } + + /** + * Clears added tasks + */ + public void clearTasks() { + tasks.clear(); + } + + /** + * + * @return boolean + */ + public boolean areThereTasks() { + return !tasks.isEmpty(); + } + + /** + * Executes Added Abstract Tasks + */ + public void processTasks() { + ProgressContributor cps[] = new ProgressContributor[tasks.size()]; + int i = 0; + for (AbstractTask task : tasks) { + cps[i] = task.getProgressContributor(); + i++; + + } + + AggregateProgressHandle aph = AggregateProgressFactory.createHandle(tasksName, cps, null, null); + aph.start(); + + for (AbstractTask task : tasks) { + task.start(); + try { + task.join(); + } catch (InterruptedException ie) { + } + } + } + +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/resources/long-banner.png b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/resources/long-banner.png new file mode 100644 index 00000000..821b3197 Binary files /dev/null and b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/resources/long-banner.png differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/security/applypasswordprotection/java/AsposeApplyPasswordProtection.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/security/applypasswordprotection/java/AsposeApplyPasswordProtection.java new file mode 100644 index 00000000..83770e0e --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/security/applypasswordprotection/java/AsposeApplyPasswordProtection.java @@ -0,0 +1,25 @@ +package asposefeatures.security.applypasswordprotection.java; + +import com.aspose.slides.Presentation; + +public class AsposeApplyPasswordProtection +{ + public static void main(String[] args) + { + String dataPath = "src/asposefeatures/security/applypasswordprotection/data/"; + + //Instantiate a Presentation object that represents a PPT file + Presentation pres = new Presentation(); + + //....do some work here..... + + //Setting Password + pres.getProtectionManager().encrypt("pass"); + + //Save your presentation to a file + pres.save(dataPath + "AsposeProtection_Out.pptx", com.aspose.slides.SaveFormat.Pptx); + + //Printing the status + System.out.println("Protection Applied successfully!"); + } +} diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/security/applyprotectionwithproperties/java/AsposeApplyProtectionwithPropertiesAccess.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/security/applyprotectionwithproperties/java/AsposeApplyProtectionwithPropertiesAccess.java new file mode 100644 index 00000000..5ad01369 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/security/applyprotectionwithproperties/java/AsposeApplyProtectionwithPropertiesAccess.java @@ -0,0 +1,28 @@ +package asposefeatures.security.applyprotectionwithproperties.java; + +import com.aspose.slides.Presentation; + +public class AsposeApplyProtectionwithPropertiesAccess +{ + public static void main(String[] args) + { + String dataPath = "src/asposefeatures/security/applyprotectionwithproperties/data/"; + + //Instantiate a Presentation object that represents a PPT file + Presentation pres = new Presentation(); + + //....do some work here..... + + //Setting access to document properties in password protected mode + pres.getProtectionManager().setEncryptDocumentProperties ( false); + + //Setting Password + pres.getProtectionManager().encrypt("pass"); + + //Save your presentation to a file + pres.save(dataPath + "AsposeProtection-PropAccess_Out.pptx", com.aspose.slides.SaveFormat.Pptx); + + //Printing the status + System.out.println("Protection Applied successfully!"); + } +} diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithcharts/charttrendlines/java/AddChartTrendLines.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithcharts/charttrendlines/java/AddChartTrendLines.java new file mode 100644 index 00000000..ea39607f --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithcharts/charttrendlines/java/AddChartTrendLines.java @@ -0,0 +1,63 @@ +package asposefeatures.workingwithcharts.charttrendlines.java; + +import java.awt.Color; + +import com.aspose.slides.ChartType; +import com.aspose.slides.FillType; +import com.aspose.slides.IChart; +import com.aspose.slides.ITrendline; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.TrendlineType; + +public class AddChartTrendLines +{ + public static void main(String[] args) + { + String dataPath = "src/asposefeatures/workingwithcharts/charttrendlines/data/"; + + //Creating empty presentation//Creating empty presentation + Presentation pres = new Presentation(); + + //Creating a clustered column chart + IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 20, 20, 500, 400); + + //Adding potential trend line for chart series 1 + ITrendline tredLinep = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(TrendlineType.Exponential); + tredLinep.setDisplayEquation(false); + tredLinep.setDisplayRSquaredValue(false); + + //Adding Linear trend line for chart series 1 + ITrendline tredLineLin = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(TrendlineType.Linear); + tredLineLin.setTrendlineType(TrendlineType.Linear); + tredLineLin.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); + tredLineLin.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.RED); + + + //Adding Logarithmic trend line for chart series 2 + ITrendline tredLineLog = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(TrendlineType.Logarithmic); + tredLineLog.setTrendlineType(TrendlineType.Logarithmic); + tredLineLog.addTextFrameForOverriding("New log trend line"); + + //Adding MovingAverage trend line for chart series 2 + ITrendline tredLineMovAvg = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(TrendlineType.MovingAverage); + tredLineMovAvg.setTrendlineType(TrendlineType.MovingAverage); + tredLineMovAvg.setPeriod((byte)3); + tredLineMovAvg.setTrendlineName("New TrendLine Name"); + + //Adding Polynomial trend line for chart series 3 + ITrendline tredLinePol = chart.getChartData().getSeries().get_Item(2).getTrendLines().add(TrendlineType.Polynomial); + tredLinePol.setTrendlineType(TrendlineType.Polynomial); + tredLinePol.setForward(1); + tredLinePol.setOrder ((byte)3); + + //Adding Power trend line for chart series 3 + ITrendline tredLinePower = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(TrendlineType.Power); + tredLinePower.setTrendlineType(TrendlineType.Power); + tredLinePower.setBackward(1); + + //Saving presentation + pres.save(dataPath + "AsposeChartTrendLines.pptx", SaveFormat.Pptx); + System.out.println("AsposeChartTrendLines Saved."); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithcharts/numberformatforchartdatacell/java/NumberFormatForChartDataCell.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithcharts/numberformatforchartdatacell/java/NumberFormatForChartDataCell.java new file mode 100644 index 00000000..6a497e82 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithcharts/numberformatforchartdatacell/java/NumberFormatForChartDataCell.java @@ -0,0 +1,46 @@ +package asposefeatures.workingwithcharts.numberformatforchartdatacell.java; + +import com.aspose.slides.ChartType; +import com.aspose.slides.IChart; +import com.aspose.slides.IChartDataPoint; +import com.aspose.slides.IChartSeries; +import com.aspose.slides.IChartSeriesCollection; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; + +public class NumberFormatForChartDataCell +{ + public static void main(String[] args) + { + String dataPath = "src/asposefeatures/workingwithcharts/numberformatforchartdatacell/data/"; + + // Instantiate the presentation//Instantiate the presentation + Presentation pres = new Presentation(); + + // Access the first presentation slide + ISlide slide = pres.getSlides().get_Item(0); + + // Adding a defautlt clustered column chart + IChart chart = slide.getShapes().addChart(ChartType.ClusteredColumn, 50, 50, 500, 400); + + // Accessing the chart series collection + IChartSeriesCollection series = chart.getChartData().getSeries(); + + // Setting the preset number format + // Traverse through every chart series + for (IChartSeries ser : series) + { + // Traverse through every data cell in series + for (IChartDataPoint cell : ser.getDataPoints()) + { + // Setting the number format + cell.getValue().getAsCell().setPresetNumberFormat((byte) 10); // 0.00% + } + } + + // Saving presentation + pres.save(dataPath + "AsposePresetNumberFormat.pptx", SaveFormat.Pptx); + System.out.println("AsposePresetNumberFormat Saved."); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithcharts/piechartsectorcolor/java/AsposeSettingPieChartSectorColors.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithcharts/piechartsectorcolor/java/AsposeSettingPieChartSectorColors.java new file mode 100644 index 00000000..85b9d9ec --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithcharts/piechartsectorcolor/java/AsposeSettingPieChartSectorColors.java @@ -0,0 +1,137 @@ +package asposefeatures.workingwithcharts.piechartsectorcolor.java; + +import java.awt.Color; + +import com.aspose.slides.ChartType; +import com.aspose.slides.FillType; +import com.aspose.slides.IChart; +import com.aspose.slides.IChartDataPoint; +import com.aspose.slides.IChartDataWorkbook; +import com.aspose.slides.IChartSeries; +import com.aspose.slides.IDataLabel; +import com.aspose.slides.ISlide; +import com.aspose.slides.LineDashStyle; +import com.aspose.slides.LineStyle; +import com.aspose.slides.NullableBool; +import com.aspose.slides.Presentation; +import com.aspose.slides.PresetColor; +import com.aspose.slides.SaveFormat; + +public class AsposeSettingPieChartSectorColors +{ + public static void main(String[] args) + { + String dataPath = "src/asposefeatures/workingwithcharts/piechartsectorcolor/data/"; + + // Instantiate Presentation class that represents PPTX file + Presentation pres = new Presentation(); + + // Access first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add chart with default data + IChart chart = sld.getShapes().addChart(ChartType.Pie, 100, 100, 400, 400); + + // Setting chart Title + chart.getChartTitle().addTextFrameForOverriding("Sample Title"); + chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat() + .setCenterText(NullableBool.True); + chart.getChartTitle().setHeight(20); + chart.setTitle(true); + + // Set first series to Show Values + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat() + .setShowValue(true); + + // Setting the index of chart data sheet + int defaultWorksheetIndex = 0; + + // Getting the chart data worksheet + IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); + + // Delete default generated series and categories + + chart.getChartData().getSeries().clear(); + chart.getChartData().getCategories().clear(); + + // Adding new categories + chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "First Qtr")); + chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "2nd Qtr")); + chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "3rd Qtr")); + + // Adding new series + IChartSeries series = chart.getChartData().getSeries() + .add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()); + + // Now populating series data + series.getDataPoints().addDataPointForPieSeries( + fact.getCell(defaultWorksheetIndex, 1, 1, 20)); + series.getDataPoints().addDataPointForPieSeries( + fact.getCell(defaultWorksheetIndex, 2, 1, 50)); + series.getDataPoints().addDataPointForPieSeries( + fact.getCell(defaultWorksheetIndex, 3, 1, 30)); + + // Not working in new version + // Adding new points and setting sector color + // series.IsColorVaried = true; + chart.getChartData().getSeriesGroups().get_Item(0).setColorVaried(true); + + IChartDataPoint point = series.getDataPoints().get_Item(0); + point.getFormat().getFill().setFillType(FillType.Solid); + point.getFormat().getFill().getSolidFillColor().setColor(Color.CYAN); + // Setting Sector border + point.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); + point.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.GRAY); + point.getFormat().getLine().setWidth(3.0); + point.getFormat().getLine().setStyle(LineStyle.ThinThick); + point.getFormat().getLine().setDashStyle(LineDashStyle.DashDot); + + IChartDataPoint point1 = series.getDataPoints().get_Item(1); + point1.getFormat().getFill().setFillType(FillType.Solid); + point1.getFormat().getFill().getSolidFillColor().setColor(new Color(PresetColor.Brown)); + + // Setting Sector border + point1.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); + point1.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.BLUE); + point1.getFormat().getLine().setWidth(3.0); + point1.getFormat().getLine().setStyle(LineStyle.Single); + point1.getFormat().getLine().setDashStyle(LineDashStyle.LargeDashDot); + + IChartDataPoint point2 = series.getDataPoints().get_Item(2); + point2.getFormat().getFill().setFillType(FillType.Solid); + point2.getFormat().getFill().getSolidFillColor().setColor(new Color(PresetColor.Coral)); + + // Setting Sector border + point2.getFormat().getLine().getFillFormat().setFillType(FillType.Solid); + point2.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.RED); + point2.getFormat().getLine().setWidth(2.0); + point2.getFormat().getLine().setStyle(LineStyle.ThinThin); + point2.getFormat().getLine().setDashStyle(LineDashStyle.LargeDashDotDot); + + // Create custom labels for each of categories for new series + + IDataLabel lbl1 = series.getDataPoints().get_Item(0).getLabel(); + // lbl.ShowCategoryName = true; + lbl1.getDataLabelFormat().setShowValue(true); + + IDataLabel lbl2 = series.getDataPoints().get_Item(1).getLabel(); + lbl2.getDataLabelFormat().setShowValue(true); + lbl2.getDataLabelFormat().setShowLegendKey(true); + lbl2.getDataLabelFormat().setShowPercentage(true); + + IDataLabel lbl3 = series.getDataPoints().get_Item(2).getLabel(); + lbl3.getDataLabelFormat().setShowSeriesName(true); + lbl3.getDataLabelFormat().setShowPercentage(true); + + // Showing Leader Lines for Chart + series.getLabels().getDefaultDataLabelFormat().setShowLeaderLines(true); + + // Setting Rotation Angle for Pie Chart Sectors + chart.getChartData().getSeriesGroups().get_Item(0).setFirstSliceAngle(180); + + // Save presentation with chart + pres.save(dataPath + "AsposePieChart.pptx", SaveFormat.Pptx); + + System.out.println("Done"); + } +} diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/mediacontrols/addaudioframe/AsposeAudioFrame/logon.wav b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithmediacontrols/addaudioframe/data/logon.wav similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/mediacontrols/addaudioframe/AsposeAudioFrame/logon.wav rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithmediacontrols/addaudioframe/data/logon.wav diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithmediacontrols/addaudioframe/java/AsposeAudioFrame.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithmediacontrols/addaudioframe/java/AsposeAudioFrame.java new file mode 100644 index 00000000..289c194f --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithmediacontrols/addaudioframe/java/AsposeAudioFrame.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Aspose 2002-2016. All Rights Reserved. + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @author Shoaib Khan + * + * @link https://asposejavadocx4j.codeplex.com/ + * @link https://sourceforge.net/projects/asposejavafordocx4j/ + * @link https://github.com/asposemarketplace/Aspose_Java_for_Docx4j + * @link https://bitbucket.org/asposemarketplace/aspose-java-for-docx4j/ + */ + +package asposefeatures.workingwithmediacontrols.addaudioframe.java; + +import java.io.File; +import java.io.FileInputStream; + +import com.aspose.slides.AudioPlayModePreset; +import com.aspose.slides.AudioVolumeMode; +import com.aspose.slides.IAudioFrame; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; + +public class AsposeAudioFrame +{ + public static void main(String[] args) throws Exception + { + String dataPath = "src/asposefeatures/workingwithmediacontrols/addaudioframe/data/"; + + //Instantiate Prsentation class that represents the PPTX + Presentation pres = new Presentation(); + + //Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + //Load the wav sound file to stram + FileInputStream fstr = new FileInputStream(new File(dataPath + "logon.wav")); + + //Add Audio Frame + IAudioFrame af = sld.getShapes().addAudioFrameEmbedded(50, 150, 100, 100, fstr); + + //Set Play Mode and Volume of the Audio + af.setPlayMode(AudioPlayModePreset.Auto); + af.setVolume(AudioVolumeMode.Loud); + + //Write the PPTX file to disk + pres.save(dataPath + "AsposeAudio_Out.pptx", SaveFormat.Pptx); + + System.out.println("Audio Control Added."); + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/presentation/converttopdf/AsposeConverter/presentation.ppt b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithpresentation/converttopdf/data/presentation.ppt similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/presentation/converttopdf/AsposeConverter/presentation.ppt rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithpresentation/converttopdf/data/presentation.ppt diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithpresentation/converttopdf/java/AsposeConverter.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithpresentation/converttopdf/java/AsposeConverter.java new file mode 100644 index 00000000..385e39e9 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithpresentation/converttopdf/java/AsposeConverter.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Aspose 2002-2016. All Rights Reserved. + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @author Shoaib Khan + * + * @link https://asposejavadocx4j.codeplex.com/ + * @link https://sourceforge.net/projects/asposejavafordocx4j/ + * @link https://github.com/asposemarketplace/Aspose_Java_for_Docx4j + * @link https://bitbucket.org/asposemarketplace/aspose-java-for-docx4j/ + */ + +package asposefeatures.workingwithpresentation.converttopdf.java; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; + +public class AsposeConverter +{ + public static void main(String[] args) + { + // 1. Conversion to PDF using default options. + + String dataPath = "src/asposefeatures/workingwithpresentation/converttopdf/data/"; + + //Instantiate a Presentation object that represents a PPT file + Presentation pres = new Presentation(dataPath + "presentation.ppt"); + + //Saving the presentation to PDF document + pres.save(dataPath + "AsposeConvert_Out.pdf", SaveFormat.Pdf); + + //Display result of conversion. + System.out.println("Conversion to PDF performed successfully with default options!"); + + // 2. Conversion to PDF using custom options. + + //Instantiate the PdfOptions class + com.aspose.slides.PdfOptions opts = new com.aspose.slides.PdfOptions(); + + //Set JPEG Quality + opts.setJpegQuality((byte)90); + + //Define behavior for meta files + opts.setSaveMetafilesAsPng(true); + + //Set Text Compression level + opts.setTextCompression(com.aspose.slides.PdfTextCompression.Flate); + + //Define the PDF standard + opts.setCompliance(com.aspose.slides.PdfCompliance.Pdf15); + + //Save the presentation to PDF with specified options + pres.save(dataPath + "AsposeConvert2_Out.pdf", SaveFormat.Pdf,opts); + + //Display result of conversion. + System.out.println("Conversion to PDF performed successfully with custom options!"); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithpresentation/shadoweffectsontext/java/AsposeShadowEffectsOnText.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithpresentation/shadoweffectsontext/java/AsposeShadowEffectsOnText.java new file mode 100644 index 00000000..c025a984 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithpresentation/shadoweffectsontext/java/AsposeShadowEffectsOnText.java @@ -0,0 +1,50 @@ +package asposefeatures.workingwithpresentation.shadoweffectsontext.java; + +import java.awt.Color; + +import com.aspose.slides.FillType; +import com.aspose.slides.IAutoShape; +import com.aspose.slides.IOuterShadow; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.RectangleAlignment; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.ShapeType; + +public class AsposeShadowEffectsOnText +{ + public static void main(String[] args) + { + String dataPath = "src/asposefeatures/workingwithpresentation/shadoweffectsontext/data/"; + + // instantiate a Presentation Object + Presentation pres = new Presentation(); + + // Get first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add an AutoShape of Rectangle type + IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, + 150, 75, 150, 50); + + // Add TextFrame to the Rectangle + ashp.addTextFrame("Aspose TextBox"); + + // Disable shape fill in case we want to get shadow of text. + ashp.getFillFormat().setFillType(FillType.NoFill); + + // Add outer shadow and set all necessary parameters + ashp.getEffectFormat().enableOuterShadowEffect(); + IOuterShadow Shadow = ashp.getEffectFormat().getOuterShadowEffect(); + Shadow.setBlurRadius(4.0); + Shadow.setDirection(45); + Shadow.setDistance(3); + Shadow.setRectangleAlign(RectangleAlignment.TopLeft); + Shadow.getShadowColor().setColor(Color.black); + + // Write the presentation to disk + pres.save(dataPath + "AsposeTextShadow_Out.pptx", SaveFormat.Pptx); + + System.out.println("Process Completed Successfully."); + } +} diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/cloneslide/AsposeCloneSlide/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithpresentation/slidethumbnails/data/presentation.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/cloneslide/AsposeCloneSlide/presentation.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithpresentation/slidethumbnails/data/presentation.pptx diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithpresentation/slidethumbnails/java/AsposeThumbnail.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithpresentation/slidethumbnails/java/AsposeThumbnail.java new file mode 100644 index 00000000..d539782f --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithpresentation/slidethumbnails/java/AsposeThumbnail.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Aspose 2002-2016. All Rights Reserved. + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @author Shoaib Khan + * + * @link https://asposejavadocx4j.codeplex.com/ + * @link https://sourceforge.net/projects/asposejavafordocx4j/ + * @link https://github.com/asposemarketplace/Aspose_Java_for_Docx4j + * @link https://bitbucket.org/asposemarketplace/aspose-java-for-docx4j/ + */ + +package asposefeatures.workingwithpresentation.slidethumbnails.java; + +import java.awt.image.BufferedImage; +import java.io.File; + +import javax.imageio.ImageIO; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; + +public class AsposeThumbnail +{ + public static void main(String[] args) throws Exception + { + String dataPath = "src/asposefeatures/workingwithpresentation/slidethumbnails/data/"; + + //Instantiate a Presentation class that represents the PPTX file + Presentation pres = new Presentation(dataPath + "presentation.pptx"); + + //Access the first slide + ISlide sld = pres.getSlides().get_Item(0); + + //Create a full scale image + BufferedImage image = sld.getThumbnail(1f, 1f); + + //Save the image to disk in JPEG format + ImageIO.write(image,"jpeg",new File(dataPath + "AsposeThumbnail_Out.jpg")); + + //Printing the status + System.out.println("Thumbnail created successfully!"); + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/cloneslidetospecificposition/AsposeCloneToSpecifiedPosition/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/cloneslide/data/presentation.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/cloneslidetospecificposition/AsposeCloneToSpecifiedPosition/presentation.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/cloneslide/data/presentation.pptx diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/cloneslide/java/AsposeCloneSlide.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/cloneslide/java/AsposeCloneSlide.java new file mode 100644 index 00000000..50f3c3cd --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/cloneslide/java/AsposeCloneSlide.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Aspose 2002-2016. All Rights Reserved. + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @author Shoaib Khan + * + * @link https://asposeapachepoi.codeplex.com/ + * @link https://sourceforge.net/projects/asposeforapachepoi/ + * @link https://github.com/asposemarketplace/Aspose_for_Apache_POI + * @link https://bitbucket.org/asposemarketplace/aspose-for-apache-poi + */ + +package asposefeatures.workingwithslides.cloneslide.java; + +import com.aspose.slides.Presentation; +import com.aspose.slides.ISlideCollection; +import com.aspose.slides.SaveFormat; + +public class AsposeCloneSlide +{ + public static void main(String[] args) + { + String dataPath = "src/asposefeatures/workingwithslides/cloneslide/data/"; + + //Instantiate Presentation class that represents a PPTX file + Presentation pres = new Presentation(dataPath + "presentation.pptx"); + + //Clone the desired slide to the end of the collection of slides in the same PPTX + ISlideCollection slds = pres.getSlides(); + slds.addClone(pres.getSlides().get_Item(0)); + + //Write the modified pptx to disk + pres.save(dataPath + "AsposeClone_Out.pptx", SaveFormat.Pptx); + + //Printing the status + System.out.println("Slide cloned successfully!"); + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/manageslidetransition/AsposeTransitions/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/cloneslidetospecificposition/data/presentation.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/manageslidetransition/AsposeTransitions/presentation.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/cloneslidetospecificposition/data/presentation.pptx diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/cloneslidetospecificposition/java/AsposeCloneToSpecifiedPosition.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/cloneslidetospecificposition/java/AsposeCloneToSpecifiedPosition.java new file mode 100644 index 00000000..8380f506 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/cloneslidetospecificposition/java/AsposeCloneToSpecifiedPosition.java @@ -0,0 +1,27 @@ +package asposefeatures.workingwithslides.cloneslidetospecificposition.java; + +import com.aspose.slides.ISlideCollection; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; + +public class AsposeCloneToSpecifiedPosition +{ + public static void main(String[] args) + { + String dataPath = "src/asposefeatures/workingwithslides/cloneslidetospecificposition/data/"; + + //Instantiate Presentation class that represents a presentation file + Presentation pres = new Presentation(dataPath + "presentation.pptx"); + + //Clone the desired slide to the end of the collection of slides in the same presentation + ISlideCollection slds = pres.getSlides(); + + //Clone the desired slide to the specified index in the same presentation + slds.insertClone(2, pres.getSlides().get_Item(1)); + + //Write the modified presentation to disk + pres.save(dataPath + "AsposeCloneToPosition_Out.pptx", SaveFormat.Pptx); + + System.out.println("Process Completed Successfully."); + } +} diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/slidethumbnails/AsposeThumbnail/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/manageslidetransition/data/presentation.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/slidethumbnails/AsposeThumbnail/presentation.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/manageslidetransition/data/presentation.pptx diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/manageslidetransition/java/AsposeTransitions.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/manageslidetransition/java/AsposeTransitions.java new file mode 100644 index 00000000..7c1be2ac --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/manageslidetransition/java/AsposeTransitions.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Aspose 2002-2016. All Rights Reserved. + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @author Shoaib Khan + * + * @link https://asposejavadocx4j.codeplex.com/ + * @link https://sourceforge.net/projects/asposejavafordocx4j/ + * @link https://github.com/asposemarketplace/Aspose_Java_for_Docx4j + * @link https://bitbucket.org/asposemarketplace/aspose-java-for-docx4j/ + */ + +package asposefeatures.workingwithslides.manageslidetransition.java; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.TransitionType; + +public class AsposeTransitions +{ + public static void main(String[] args) + { + String dataPath = "src/asposefeatures/workingwithslides/manageslidetransition/data/"; + + //Instantiate Presentation class that represents a presentation file + Presentation pres = new Presentation(dataPath + "presentation.pptx"); + + //Apply circle type transition on slide 1 + pres.getSlides().get_Item(0).getSlideShowTransition().setType(TransitionType.Circle); + + //Apply comb type transition on slide 2 + pres.getSlides().get_Item(1).getSlideShowTransition().setType( TransitionType.Comb); + + //Apply zoom type transition on slide 3 + pres.getSlides().get_Item(2).getSlideShowTransition().setType(TransitionType.Zoom); + + //Write the presentation to disk + pres.save(dataPath + "AsposeTransition_Out.pptx",SaveFormat.Pptx); + + System.out.println("First Transition File is saved."); + + //============================================================== + + //Instantiate a Presentation object that represents a PPT file + Presentation presentation = new Presentation(dataPath + "presentation.pptx"); + + //Apply circle type transition on slide 1 + presentation.getSlides().get_Item(0).getSlideShowTransition().setType(TransitionType.Circle); + + //Set the transition time of 3 seconds + //Set the transition time of 5 seconds + presentation.getSlides().get_Item(0).getSlideShowTransition().setAdvanceOnClick( true); + presentation.getSlides().get_Item(0).getSlideShowTransition().setAdvanceAfterTime (3000); + + //Apply comb type transition on slide 2 + presentation.getSlides().get_Item(1).getSlideShowTransition().setType( TransitionType.Comb); + + + //Set the transition time of 5 seconds + presentation.getSlides().get_Item(1).getSlideShowTransition().setAdvanceOnClick( true); + presentation.getSlides().get_Item(1).getSlideShowTransition().setAdvanceAfterTime (5000); + + //Apply zoom type transition on slide 3 + presentation.getSlides().get_Item(2).getSlideShowTransition().setType(TransitionType.Zoom); + + //Set the transition time of 7 seconds + presentation.getSlides().get_Item(2).getSlideShowTransition().setAdvanceOnClick( true); + presentation.getSlides().get_Item(2).getSlideShowTransition().setAdvanceAfterTime (7000); + + //Write the presentation to disk + presentation.save(dataPath + "AsposeTransition2_Out.pptx",SaveFormat.Pptx); + + System.out.println("Second Transition File is saved."); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/slidecomments/java/AsposeComments.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/slidecomments/java/AsposeComments.java new file mode 100644 index 00000000..d81131ae --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithslides/slidecomments/java/AsposeComments.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Aspose 2002-2016. All Rights Reserved. + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @author Shoaib Khan + * + * @link https://asposejavadocx4j.codeplex.com/ + * @link https://sourceforge.net/projects/asposejavafordocx4j/ + * @link https://github.com/asposemarketplace/Aspose_Java_for_Docx4j + * @link https://bitbucket.org/asposemarketplace/aspose-java-for-docx4j/ + */ + +package asposefeatures.workingwithslides.slidecomments.java; + +import com.aspose.slides.IComment; +import com.aspose.slides.ICommentAuthor; +import com.aspose.slides.ICommentCollection; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; + +public class AsposeComments +{ + public static void main(String[] args) + { + String dataPath = "src/asposefeatures/workingwithslides/slidecomments/data/"; + + // ====================================== + // Adding Slide Comments + // ====================================== + Presentation pres = new Presentation(); + + // Adding Empty slide + pres.getSlides().addEmptySlide(pres.getLayoutSlides().get_Item(0)); + + // Adding Author + ICommentAuthor author = pres.getCommentAuthors().addAuthor("Aspose", "AS"); + + // Position of comments + java.awt.geom.Point2D.Float point = new java.awt.geom.Point2D.Float(0.2f, 0.2f); + java.util.Date date = new java.util.Date(); + + // Adding slide comment for an author on slide 1 + author.getComments().addComment("Hello Mudassir, this is slide comment", + pres.getSlides().get_Item(0), point, date); + + // Adding slide comment for an author on slide 1 + author.getComments().addComment("Hello Mudassir, this is second slide comment", + pres.getSlides().get_Item(1), point, date); + + // Accessing ISlide 1 + ISlide slide = pres.getSlides().get_Item(0); + + // if null is passed as an argument then it will bring comments from all + // authors on selected slide + IComment[] Comments = slide.getSlideComments(author); + + // Accessing the comment at index 0 for slide 1 + String str = Comments[0].getText(); + + pres.save(dataPath + "AsposeComments_Out.pptx", SaveFormat.Pptx); + + if (Comments.length > 0) + { + // Select comments collection of Author at index 0 + ICommentCollection commentCollection = Comments[0].getAuthor().getComments(); + + String comment = commentCollection.get_Item(0).getText(); + } + + // ====================================== + // Accessing Slide Comments + // ====================================== + + // Presentation pres = new Presentation("data/AsposeComments.pptx"); + for (ICommentAuthor author1 : pres.getCommentAuthors()) + { + for (IComment comment : author1.getComments()) + { + System.out.println("ISlide :" + + comment.getSlide().getSlideNumber() + + " has comment: " + comment.getText() + + " with Author: " + comment.getAuthor().getName() + + " posted on time :" + comment.getCreatedTime() + "\n"); + } + } + System.out.println("Done"); + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/addnodes/AsposeAddSmartArtNodes/AsposeSmartArt.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/addnodes/data/AsposeSmartArt.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/addnodes/AsposeAddSmartArtNodes/AsposeSmartArt.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/addnodes/data/AsposeSmartArt.pptx diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/addnodes/java/AsposeAddSmartArtNodes.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/addnodes/java/AsposeAddSmartArtNodes.java new file mode 100644 index 00000000..7484ced6 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/addnodes/java/AsposeAddSmartArtNodes.java @@ -0,0 +1,83 @@ +package asposefeatures.workingwithsmartart.addnodes.java; + +import com.aspose.slides.IShape; +import com.aspose.slides.ISlide; +import com.aspose.slides.ISmartArt; +import com.aspose.slides.ISmartArtNode; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.SmartArt; +import com.aspose.slides.SmartArtLayoutType; +import com.aspose.slides.SmartArtNode; +import com.aspose.slides.SmartArtNodeCollection; + +public class AsposeAddSmartArtNodes +{ + public static void main(String[] args) + { + String dataPath = "src/asposefeatures/workingwithsmartart/addnodes/data/"; + // ================== + // Adding Smart Art + // ================== + + // Load the desired the presentation + Presentation pres = new Presentation(dataPath + "AsposeSmartArt.pptx"); + + // Traverse through every shape inside first slide + for (IShape shape : pres.getSlides().get_Item(0).getShapes()) + { + + // Check if shape is of SmartArt type + if (shape instanceof SmartArt) + { + + // Typecast shape to SmartArt + SmartArt smart = (SmartArt) shape; + + // Adding a new SmartArt Node + SmartArtNode TemNode = (SmartArtNode) smart.getAllNodes().addNode(); + + // Adding text + TemNode.getTextFrame().setText("Test"); + + // Adding new child node in parent node. It will be added in the + // end of collection + SmartArtNode newNode = (SmartArtNode) TemNode.getChildNodes().addNode(); + + // Adding text + newNode.getTextFrame().setText("New Node Added"); + } + } + + // Saving Presentation + pres.save(dataPath + "AsposeAddSmartArtNode.pptx", SaveFormat.Pptx); + + // ========================================= + // Adding Smart Art to Specific Location + // ========================================= + + // Creating a presentation instance + Presentation pres1 = new Presentation(); + + // Access the presentation slide + ISlide slide = pres1.getSlides().get_Item(0); + + // Add Smart Art IShape + ISmartArt smart = slide.getShapes().addSmartArt(0, 0, 400, 400, + SmartArtLayoutType.StackedList); + + // Accessing the SmartArt node at index 0 + ISmartArtNode node = smart.getAllNodes().get_Item(0); + + // Adding new child node at position 2 in parent node + SmartArtNode chNode = (SmartArtNode) ((SmartArtNodeCollection) node.getChildNodes()) + .addNodeByPosition(2); + + // Add Text + chNode.getTextFrame().setText("Sample Text Added"); + + // Save Presentation + pres1.save(dataPath + "AsposeAddSmartArtNodeByPosition.pptx", SaveFormat.Pptx); + System.out.println("Smart Art added and to specific location."); + } +} diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/managesmartart/java/AsposeSmartArt.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/managesmartart/java/AsposeSmartArt.java new file mode 100644 index 00000000..4e16ff31 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/managesmartart/java/AsposeSmartArt.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Aspose 2002-2016. All Rights Reserved. + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @author Shoaib Khan + * + * @link https://asposejavadocx4j.codeplex.com/ + * @link https://sourceforge.net/projects/asposejavafordocx4j/ + * @link https://github.com/asposemarketplace/Aspose_Java_for_Docx4j + * @link https://bitbucket.org/asposemarketplace/aspose-java-for-docx4j/ + */ + +package asposefeatures.workingwithsmartart.managesmartart.java; + +import com.aspose.slides.IShape; +import com.aspose.slides.ISlide; +import com.aspose.slides.ISmartArt; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.SmartArtLayoutType; + +public class AsposeSmartArt +{ + public static void main(String[] args) + { + String dataPath = "src/asposefeatures/workingwithsmartart/managesmartart/data/"; + + //================== + //Adding Smart Art + //================== + + //Instantiate Presentation Class + Presentation pres = new Presentation(); + + //Get first slide + ISlide slide = pres.getSlides().get_Item(0); + + //Add Smart Art Shape + ISmartArt smart = slide.getShapes().addSmartArt(0, 0, 400, 400, SmartArtLayoutType.BasicBlockList); + + //Saving presentation + pres.save(dataPath + "AsposeSmartArt_Out.pptx", SaveFormat.Pptx); + + //===================== + //Accessing Smart Art + //===================== + //Get first slide + ISlide slide0 = pres.getSlides().get_Item(0); + + //Traverse through every shape inside first slide + for(IShape shape : slide0.getShapes()) + { + //Check if shape is of SmartArt type + if (shape instanceof ISmartArt) + { + //Typecast shape to SmartArtEx + ISmartArt smartArt = (ISmartArt)shape; + } + } + System.out.println("Smart Art added and Accessed."); + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes/AsposeAddSmartArtNode.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/removenodes/data/AsposeAddSmartArtNode.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes/AsposeAddSmartArtNode.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/removenodes/data/AsposeAddSmartArtNode.pptx diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes/AsposeAddSmartArtNodeByPosition.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/removenodes/data/AsposeAddSmartArtNodeByPosition.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes/AsposeAddSmartArtNodeByPosition.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/removenodes/data/AsposeAddSmartArtNodeByPosition.pptx diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/removenodes/java/AsposeRemoveSmartArtNodes.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/removenodes/java/AsposeRemoveSmartArtNodes.java new file mode 100644 index 00000000..332c7271 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/asposefeatures/workingwithsmartart/removenodes/java/AsposeRemoveSmartArtNodes.java @@ -0,0 +1,82 @@ +package asposefeatures.workingwithsmartart.removenodes.java; + +import com.aspose.slides.IShape; +import com.aspose.slides.ISmartArt; +import com.aspose.slides.ISmartArtNode; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.SmartArt; +import com.aspose.slides.SmartArtNodeCollection; + +public class AsposeRemoveSmartArtNodes +{ + public static void main(String[] args) + { + String dataPath = "src/asposefeatures/workingwithsmartart/removenodes/data/"; + // ==================== + // Removing Smart Art + // ==================== + + // Load the desired the presentation + Presentation pres = new Presentation(dataPath + "AsposeAddSmartArtNode.pptx"); + + // Traverse through every shape inside first slide + for (IShape shape : pres.getSlides().get_Item(0).getShapes()) + { + + // Check if shape is of SmartArt type + if (shape instanceof ISmartArt) + { + // Typecast shape to SmartArtEx + ISmartArt smart = (ISmartArt) shape; + + if (smart.getAllNodes().size() > 0) + { + // Accessing SmartArt node at index 0 + ISmartArtNode node = smart.getAllNodes().get_Item(0); + + // Removing the selected node + smart.getAllNodes().removeNode(node); + + } + } + } + + // Save Presentation + pres.save(dataPath + "AsposeRemoveSmartArtNode.pptx", SaveFormat.Pptx); + + // ============================================ + // Removing Smart Art from Specific Location + // ============================================ + + // Load the desired the presentation + Presentation pres1 = new Presentation(dataPath + "AsposeAddSmartArtNodeByPosition.pptx"); + + // Traverse through every shape inside first slide + for (IShape shape : pres1.getSlides().get_Item(0).getShapes()) + { + + // Check if shape is of SmartArt type + if (shape instanceof SmartArt) + { + // Typecast shape to SmartArt + SmartArt smart = (SmartArt) shape; + + if (smart.getAllNodes().size() > 0) + { + // Accessing SmartArt node at index 0 + ISmartArtNode node = smart.getAllNodes().get_Item(0); + + if (node.getChildNodes().size() >= 2) + { + // Removing the child node at position 1 + ((SmartArtNodeCollection) node.getChildNodes()).removeNodeByPosition(1); + } + } + } + } + // Save Presentation + pres1.save(dataPath + "AsposeRemoveSmartArtNodeByPosition.pptx", SaveFormat.Pptx); + System.out.println("Smart Art removed."); + } +} diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/Pptx4jConvertToHTML/pptx-basic.xml b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/converttohtml/data/pptx-basic.xml similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/Pptx4jConvertToHTML/pptx-basic.xml rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/converttohtml/data/pptx-basic.xml diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/AsposeConvertToHTML/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/converttohtml/data/presentation.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/AsposeConvertToHTML/presentation.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/converttohtml/data/presentation.pptx diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/converttohtml/java/AsposeConvertToHTML.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/converttohtml/java/AsposeConvertToHTML.java new file mode 100644 index 00000000..7fd870df --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/converttohtml/java/AsposeConvertToHTML.java @@ -0,0 +1,23 @@ +package featurescomparison.workingwithpresentations.converttohtml.java; + +import com.aspose.slides.HtmlFormatter; +import com.aspose.slides.HtmlOptions; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; + +public class AsposeConvertToHTML +{ + public static void main(String[] args) + { + String dataPath = "src/featurescomparison/workingwithpresentations/converttohtml/data/"; + + //Instantiate Presentation class that represents PPTX file + Presentation pres = new Presentation(dataPath + "presentation.pptx"); + + HtmlOptions htmlOpt = new HtmlOptions(); + htmlOpt.setHtmlFormatter(HtmlFormatter.createDocumentFormatter("",false)); + + //Saving the presentation to HTML + pres.save(dataPath + "AsposeHTML.html", SaveFormat.Html, htmlOpt); + } +} diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/converttohtml/java/Pptx4jConvertToHTML.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/converttohtml/java/Pptx4jConvertToHTML.java new file mode 100644 index 00000000..9c6f8c3a --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/converttohtml/java/Pptx4jConvertToHTML.java @@ -0,0 +1,47 @@ +package featurescomparison.workingwithpresentations.converttohtml.java; + +import java.util.Iterator; +import java.util.Map; + +import org.docx4j.openpackaging.packages.PresentationMLPackage; +import org.docx4j.openpackaging.parts.Part; +import org.docx4j.openpackaging.parts.PresentationML.SlidePart; +import org.pptx4j.convert.out.svginhtml.SvgExporter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Pptx4jConvertToHTML +{ + protected static Logger log = LoggerFactory.getLogger(Pptx4jConvertToHTML.class); + + public static void main(String[] args) throws Exception + { + String dataPath = "src/featurescomparison/workingwithpresentations/converttohtml/data/"; + + String inputfilepath = dataPath + "pptx-basic.xml"; + + // Where to save images + SvgExporter.setImageDirPath(dataPath); + + PresentationMLPackage presentationMLPackage = + (PresentationMLPackage)PresentationMLPackage.load(new java.io.File(inputfilepath)); + + // TODO - render slides in document order! + Iterator partIterator = presentationMLPackage.getParts().getParts().entrySet().iterator(); + while (partIterator.hasNext()) { + + Map.Entry pairs = (Map.Entry)partIterator.next(); + + Part p = (Part)pairs.getValue(); + if (p instanceof SlidePart) { + + System.out.println( + SvgExporter.svg(presentationMLPackage, (SlidePart)p) + ); + } + } + + // NB: file suffix must end with .xhtml in order to see the SVG in a browser + System.out.println("Done..."); + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/openexisting/AsposeOpenExistingPresentations/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/countslides/data/presentation.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/openexisting/AsposeOpenExistingPresentations/presentation.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/countslides/data/presentation.pptx diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/countslides/java/AsposeCountSlides.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/countslides/java/AsposeCountSlides.java new file mode 100644 index 00000000..e8955fa0 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/countslides/java/AsposeCountSlides.java @@ -0,0 +1,16 @@ +package featurescomparison.workingwithpresentations.countslides.java; + +import com.aspose.slides.Presentation; + +public class AsposeCountSlides +{ + public static void main(String[] args) + { + String dataPath = "src/featurescomparison/workingwithpresentations/countslides/data/"; + + //Instantiate a PresentationEx object that represents a PPTX file + Presentation pres = new Presentation(dataPath + "presentation.pptx"); + + System.out.println("Total Slides in Presentation: " + pres.getSlides().size()); + } +} diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/countslides/java/Pptx4jCountSlides.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/countslides/java/Pptx4jCountSlides.java new file mode 100644 index 00000000..6f252c90 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/countslides/java/Pptx4jCountSlides.java @@ -0,0 +1,40 @@ +package featurescomparison.workingwithpresentations.countslides.java; + +/* + * Copyright 2014, Plutext Pty Ltd. + * + * This file is part of docx4j. + docx4j is licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + NOTICE: ORIGINAL FILE MODIFIED + */ + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.docx4j.openpackaging.packages.OpcPackage; +import org.docx4j.openpackaging.packages.PresentationMLPackage; + +public class Pptx4jCountSlides { + + protected static Logger log = LoggerFactory.getLogger(Pptx4jCountSlides.class); + + public static void main(String[] args) throws Exception + { + String dataPath = "src/featurescomparison/workingwithpresentations/countslides/data/"; + + String inputfilepath = dataPath + "presentation.pptx"; + + PresentationMLPackage presentationMLPackage = + (PresentationMLPackage)OpcPackage.load(new java.io.File(inputfilepath)); + + System.out.println("Total Slides: " + presentationMLPackage.getMainPresentationPart().getSlideCount()); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createlayoutslides/java/AsposeCreateLayoutSlides.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createlayoutslides/java/AsposeCreateLayoutSlides.java new file mode 100644 index 00000000..d5aad199 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createlayoutslides/java/AsposeCreateLayoutSlides.java @@ -0,0 +1,75 @@ +package featurescomparison.workingwithpresentations.createlayoutslides.java; + +import com.aspose.slides.ILayoutSlide; +import com.aspose.slides.IMasterLayoutSlideCollection; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.SlideLayoutType; + +public class AsposeCreateLayoutSlides +{ + public static void main(String[] args) throws Exception + { + String dataPath = "src/featurescomparison/workingwithpresentations/createlayoutslides/data/"; + + //Instantiate Presentation class that represents the presentation file + Presentation pres = new Presentation(); + + // Try to search by layout slide type + IMasterLayoutSlideCollection layoutSlides = pres.getMasters().get_Item(0).getLayoutSlides(); + ILayoutSlide layoutSlide = null; + + if(layoutSlides.getByType(SlideLayoutType.TitleAndObject)!=null) + layoutSlide = layoutSlides.getByType(SlideLayoutType.TitleAndObject) ; + + else + layoutSlide=layoutSlides.getByType(SlideLayoutType.Title); + + if (layoutSlide == null) + { + // The situation when a presentation doesn't contain some type of layouts. + // Technographics.pptx presentation only contains Blank and Custom layout types. + // But layout slides with Custom types has different slide names, + // like "Title", "Title and Content", etc. And it is possible to use these + // names for layout slide selection. + // Also it is possible to use the set of placeholder shape types. For example, + // Title slide should have only Title placeholder type, etc. + for (ILayoutSlide titleAndObjectLayoutSlide : layoutSlides) + { + if (titleAndObjectLayoutSlide.getName() == "Title and Object") + { + layoutSlide = titleAndObjectLayoutSlide; + break; + } + } + if (layoutSlide == null) + { + for (ILayoutSlide titleLayoutSlide : layoutSlides) + { + if (titleLayoutSlide.getName() == "Title") + { + layoutSlide = titleLayoutSlide; + break; + } + } + if (layoutSlide == null) + { + layoutSlide = layoutSlides.getByType(SlideLayoutType.Blank); + if (layoutSlide == null) + { + layoutSlide = layoutSlides.add(SlideLayoutType.TitleAndObject, "Title and Object"); + } + } + } + } + + //Adding empty slide with added layout slide + pres.getSlides().insertEmptySlide(0, layoutSlide); + + //Save presentation + pres.save(dataPath + "Aspose-output.pptx", SaveFormat.Pptx); + + //Printing the status + System.out.println("Slides added successfully!"); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createlayoutslides/java/Pptx4jCreateLayoutSlides.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createlayoutslides/java/Pptx4jCreateLayoutSlides.java new file mode 100644 index 00000000..86a44a67 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createlayoutslides/java/Pptx4jCreateLayoutSlides.java @@ -0,0 +1,51 @@ +package featurescomparison.workingwithpresentations.createlayoutslides.java; + +import org.docx4j.openpackaging.packages.PresentationMLPackage; +import org.docx4j.openpackaging.parts.PartName; +import org.docx4j.openpackaging.parts.PresentationML.MainPresentationPart; +import org.docx4j.openpackaging.parts.PresentationML.SlideLayoutPart; +import org.docx4j.openpackaging.parts.PresentationML.SlidePart; + +/* + * Copyright 2007-2008, Plutext Pty Ltd. + * + * This file is part of docx4j. + docx4j is licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + NOTICE: ORIGINAL FILE MODIFIED +*/ + +public class Pptx4jCreateLayoutSlides +{ + public static void main(String[] args) throws Exception { + + String dataPath = "src/featurescomparison/workingwithpresentations/createlayoutslides/data/"; + + // Create skeletal package, including a MainPresentationPart and a SlideLayoutPart + PresentationMLPackage presentationMLPackage = PresentationMLPackage.createPackage(); + + // Need references to these parts to create a slide + // Please note that these parts *already exist* - they are + // created by createPackage() above. See that method + // for instruction on how to create and add a part. + MainPresentationPart pp = (MainPresentationPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/presentation.xml")); + + SlideLayoutPart layoutPart1 = (SlideLayoutPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/slideLayouts/slideLayout1.xml")); + // OK, now we can create a slide + SlidePart slidePart1 = presentationMLPackage.createSlidePart(pp, layoutPart1, new PartName("/ppt/slides/slide1.xml")); + + presentationMLPackage.save(new java.io.File(dataPath + "Pptx4j-New Presentation.pptx")); + + System.out.println("\n\n done .. \n\n"); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createnewpresentation/data/Pptx4j-New Presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createnewpresentation/data/Pptx4j-New Presentation.pptx new file mode 100644 index 00000000..a711709d Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createnewpresentation/data/Pptx4j-New Presentation.pptx differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createnewpresentation/java/AsposeCreateNewPresentation.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createnewpresentation/java/AsposeCreateNewPresentation.java new file mode 100644 index 00000000..0d0ce4a2 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createnewpresentation/java/AsposeCreateNewPresentation.java @@ -0,0 +1,19 @@ +package featurescomparison.workingwithpresentations.createnewpresentation.java; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; + +public class AsposeCreateNewPresentation +{ + public static void main(String[] args) + { + String dataPath = "src/featurescomparison/workingwithpresentations/createnewpresentation/data/"; + + // Instantiate Presentation class that represents the PPTX + Presentation pres = new Presentation(); + + //Write the PPTX file to disk + pres.save(dataPath + "Aspose-New-Presentation.pptx", SaveFormat.Pptx); + System.out.println("Done."); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createnewpresentation/java/Pptx4jCreateNewPresentation.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createnewpresentation/java/Pptx4jCreateNewPresentation.java new file mode 100644 index 00000000..7b657a0a --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createnewpresentation/java/Pptx4jCreateNewPresentation.java @@ -0,0 +1,53 @@ +/* + * Copyright 2007-2008, Plutext Pty Ltd. + * + * This file is part of docx4j. + docx4j is licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + NOTICE: ORIGINAL FILE MODIFIED +*/ + +package featurescomparison.workingwithpresentations.createnewpresentation.java; + +import org.docx4j.openpackaging.packages.PresentationMLPackage; +import org.docx4j.openpackaging.parts.PartName; +import org.docx4j.openpackaging.parts.PresentationML.MainPresentationPart; +import org.docx4j.openpackaging.parts.PresentationML.SlideLayoutPart; +import org.docx4j.openpackaging.parts.PresentationML.SlidePart; + +public class Pptx4jCreateNewPresentation +{ + public static void main(String[] args) throws Exception { + + String dataPath = "src/featurescomparison/workingwithpresentations/createnewpresentation/data/"; + + // Create skeletal package, including a MainPresentationPart and a SlideLayoutPart + PresentationMLPackage presentationMLPackage = PresentationMLPackage.createPackage(); + + // Need references to these parts to create a slide + // Please note that these parts *already exist* - they are + // created by createPackage() above. See that method + // for instruction on how to create and add a part. + MainPresentationPart pp = (MainPresentationPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/presentation.xml")); + SlideLayoutPart layoutPart = (SlideLayoutPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/slideLayouts/slideLayout1.xml")); + + // OK, now we can create a slide + SlidePart slidePart = presentationMLPackage.createSlidePart(pp, layoutPart, + new PartName("/ppt/slides/slide1.xml")); + + presentationMLPackage.save(new java.io.File(dataPath + "Pptx4j-New Presentation.pptx")); + + System.out.println("\n\n done .. \n\n"); + + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createtable/java/AsposeCreateTable.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createtable/java/AsposeCreateTable.java new file mode 100644 index 00000000..ccbb87b7 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createtable/java/AsposeCreateTable.java @@ -0,0 +1,69 @@ +package featurescomparison.workingwithpresentations.createtable.java; + +import java.awt.Color; + +import com.aspose.slides.FillType; +import com.aspose.slides.ISlide; +import com.aspose.slides.ITable; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; + +/** + * + * @author Shoaib Khan + * + */ + +public class AsposeCreateTable +{ + public static void main(String[] args) + { + String dataPath = "src/featurescomparison/workingwithpresentations/createtable/data/"; + + //Instantiate Presentation class that represents PPTX file + Presentation pres = new Presentation(); + + //Access first slide + ISlide sld = pres.getSlides().get_Item(0); + + //Define columns with widths and rows with heights + double[] dblCols = { 50, 50, 50 }; + double[] dblRows = { 50, 30, 30, 30, 30 }; + + //Add table shape to slide + ITable tbl = sld.getShapes().addTable(100, 50, dblCols, dblRows); + + //Set border format for each cell + for(int row = 0; row < tbl.getRows().size(); row++) + { + for (int cell = 0; cell < tbl.getRows().get_Item(row).size(); cell++) + { + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().getFillFormat().setFillType(FillType.Solid); + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().getFillFormat().getSolidFillColor().setColor(Color.RED); + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().setWidth(5); + + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().getFillFormat().setFillType(FillType.Solid); + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().getFillFormat().getSolidFillColor().setColor(Color.RED); + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().setWidth(5); + + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().getFillFormat().setFillType(FillType.Solid); + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().getFillFormat().getSolidFillColor().setColor(Color.RED); + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().setWidth(5); + + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().getFillFormat().setFillType(FillType.Solid); + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().getFillFormat().getSolidFillColor().setColor(Color.RED); + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().setWidth(5); + } + } + //Merge cells 1 & 2 of row 1 + tbl.mergeCells(tbl.getRows().get_Item(0).get_Item(0), tbl.getRows().get_Item(1).get_Item(0), false); + + //Add text to the merged cell + tbl.getRows().get_Item(0).get_Item(0).getTextFrame().setText("Merged Cells"); + + //Save PPTX to Disk + pres.save(dataPath + "Tables-Aspose.pptx", SaveFormat.Pptx); + + System.out.println("Table Created Successfully..."); + } +} diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createtable/java/Pptx4jCreateTable.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createtable/java/Pptx4jCreateTable.java new file mode 100644 index 00000000..e1d57dcb --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/createtable/java/Pptx4jCreateTable.java @@ -0,0 +1,287 @@ +/* + * Copyright 2007-2008, Plutext Pty Ltd. + * + * This file is part of docx4j. + + docx4j is licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + NOTICE: ORIGINAL FILE MODIFIED + */ + +package featurescomparison.workingwithpresentations.createtable.java; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.docx4j.XmlUtils; +import org.docx4j.dml.CTPoint2D; +import org.docx4j.dml.CTPositiveSize2D; +import org.docx4j.dml.CTTable; +import org.docx4j.dml.CTTableCell; +import org.docx4j.dml.CTTableCol; +import org.docx4j.dml.CTTableGrid; +import org.docx4j.dml.CTTableRow; +import org.docx4j.dml.Graphic; +import org.docx4j.dml.GraphicData; +import org.docx4j.openpackaging.packages.PresentationMLPackage; +import org.docx4j.openpackaging.parts.PartName; +import org.docx4j.openpackaging.parts.PresentationML.MainPresentationPart; +import org.docx4j.openpackaging.parts.PresentationML.SlideLayoutPart; +import org.docx4j.openpackaging.parts.PresentationML.SlidePart; +import org.pptx4j.jaxb.Context; +import org.pptx4j.pml.CTGraphicalObjectFrame; + + + +/** + * Demonstrates 2 methods of adding a table + * to a slide. + * + */ +public class Pptx4jCreateTable +{ + protected static Logger log = LoggerFactory.getLogger(Pptx4jCreateTable.class); + + public static void main(String[] args) throws Exception + { + String dataPath = "src/featurescomparison/workingwithpresentations/createtable/data/"; + + // Where will we save our new .ppxt? + String outputfilepath = dataPath + "Tables-Pptx4j.pptx"; + + // Create skeletal package, including a MainPresentationPart and a SlideLayoutPart + PresentationMLPackage presentationMLPackage = PresentationMLPackage.createPackage(); + + // Need references to these parts to create a slide + // Please note that these parts *already exist* - they are + // created by createPackage() above. See that method + // for instruction on how to create and add a part. + MainPresentationPart pp = (MainPresentationPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/presentation.xml")); + SlideLayoutPart layoutPart = (SlideLayoutPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/slideLayouts/slideLayout1.xml")); + + // OK, now we can create a slide + SlidePart slidePart = presentationMLPackage.createSlidePart(pp, layoutPart, + new PartName("/ppt/slides/slide1.xml")); + + // Method 1 - programmatic + slidePart.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add( getTable() ); + + // Method 2 - from string - on slide 2 + SlidePart slide2 = presentationMLPackage.createSlidePart(pp, layoutPart, + new PartName("/ppt/slides/slide2.xml")); + slide2.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add( createGraphicFrameFromString() ); + + // All done: save it + presentationMLPackage.save(new java.io.File(outputfilepath)); + + System.out.println("\n\n done .. saved " + outputfilepath); + } + + public static CTGraphicalObjectFrame getTable() throws JAXBException { + + // instatiation the factory for later object creation. + org.docx4j.dml.ObjectFactory dmlFactory = new org.docx4j.dml.ObjectFactory(); + org.pptx4j.pml.ObjectFactory pmlFactory = new org.pptx4j.pml.ObjectFactory(); + + // Node Creation + CTGraphicalObjectFrame graphicFrame = pmlFactory + .createCTGraphicalObjectFrame(); + org.pptx4j.pml.CTGraphicalObjectFrameNonVisual nvGraphicFramePr = pmlFactory + .createCTGraphicalObjectFrameNonVisual(); + org.docx4j.dml.CTNonVisualDrawingProps cNvPr = dmlFactory + .createCTNonVisualDrawingProps(); + org.docx4j.dml.CTNonVisualGraphicFrameProperties cNvGraphicFramePr = dmlFactory + .createCTNonVisualGraphicFrameProperties(); + org.docx4j.dml.CTGraphicalObjectFrameLocking graphicFrameLocks = new org.docx4j.dml.CTGraphicalObjectFrameLocking(); + org.docx4j.dml.CTTransform2D xfrm = dmlFactory.createCTTransform2D(); + Graphic graphic = dmlFactory.createGraphic(); + GraphicData graphicData = dmlFactory.createGraphicData(); + + // Build the parent-child relationship of this slides.xml + graphicFrame.setNvGraphicFramePr(nvGraphicFramePr); + nvGraphicFramePr.setCNvPr(cNvPr); + cNvPr.setName("1"); + nvGraphicFramePr.setCNvGraphicFramePr(cNvGraphicFramePr); + cNvGraphicFramePr.setGraphicFrameLocks(graphicFrameLocks); + graphicFrameLocks.setNoGrp(true); + nvGraphicFramePr.setNvPr(pmlFactory.createNvPr()); + +// +// +// +// + graphicFrame.setXfrm(xfrm); + + CTPositiveSize2D ext = dmlFactory.createCTPositiveSize2D(); + ext.setCx(6096000); + ext.setCy(741680); + + xfrm.setExt(ext); + + CTPoint2D off = dmlFactory.createCTPoint2D(); + xfrm.setOff(off); + off.setX(1524000); + off.setY(1397000); + + graphicFrame.setGraphic(graphic); + + graphic.setGraphicData(graphicData); + graphicData + .setUri("http://schemas.openxmlformats.org/drawingml/2006/table"); + + CTTable ctTable = dmlFactory.createCTTable(); + JAXBElement tbl = dmlFactory.createTbl(ctTable); + graphicData.getAny().add(tbl); + + CTTableGrid ctTableGrid = dmlFactory.createCTTableGrid(); + CTTableCol gridCol = dmlFactory.createCTTableCol(); + ctTable.setTblGrid(ctTableGrid); + ctTableGrid.getGridCol().add(gridCol); + ctTableGrid.getGridCol().add(gridCol); + gridCol.setW(300000); + + CTTableRow ctTableRow = dmlFactory.createCTTableRow(); + ctTableRow.setH(370840); + + + ctTableRow.getTc().add(createTableCell()); + ctTableRow.getTc().add(createTableCell()); + + for (int i = 0; i < 4; i++) { + ctTable.getTr().add(ctTableRow); + } + + return graphicFrame; + } + + public static CTTableCell createTableCell() throws JAXBException { + String contents = + "" + + "" + +"" + +"" + +"" + +"" + +"" + +"11" + +"" + +"" + +"" + +"" + + ""; + //+" + return ((CTTableCell)XmlUtils.unmarshalString(contents,org.docx4j.jaxb.Context.jc, CTTableCell.class)); + + } + + public static CTGraphicalObjectFrame createGraphicFrameFromString() throws JAXBException { + + String tableau = + "" + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " {5C22544A-7EE6-4342-B048-85BDC9FD1C3A}" + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " 11" + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " 12" + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " 21" + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " 22" + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " "; + + + return (CTGraphicalObjectFrame) XmlUtils.unmarshalString(tableau, Context.jcPML, + CTGraphicalObjectFrame.class); + + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/AsposeEditExistingCharts/AsposeChart.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/editexistingcharts/data/AsposeChart.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/AsposeEditExistingCharts/AsposeChart.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/editexistingcharts/data/AsposeChart.pptx diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/Pptx4jEditExistingCharts/pptx-chart.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/editexistingcharts/data/pptx-chart.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/Pptx4jEditExistingCharts/pptx-chart.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/editexistingcharts/data/pptx-chart.pptx diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/editexistingcharts/java/AsposeEditExistingCharts.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/editexistingcharts/java/AsposeEditExistingCharts.java new file mode 100644 index 00000000..0bed90d1 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/editexistingcharts/java/AsposeEditExistingCharts.java @@ -0,0 +1,73 @@ +package featurescomparison.workingwithpresentations.editexistingcharts.java; + +import com.aspose.slides.ChartType; +import com.aspose.slides.IChart; +import com.aspose.slides.IChartDataWorkbook; +import com.aspose.slides.IChartSeries; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; + +public class AsposeEditExistingCharts +{ + public static void main(String[] args) + { + String dataPath = "src/featurescomparison/workingwithpresentations/editexistingcharts/data/"; + + //Instantiate Presentation class that represents PPTX file + Presentation pres = new Presentation(dataPath + "AsposeChart.pptx"); + + //Access first slide + ISlide sld = pres.getSlides().get_Item(0); + + // Add chart with default data + IChart chart = (IChart)sld.getShapes().get_Item(0); + + //Setting the index of chart data sheet + int defaultWorksheetIndex = 0; + + //Getting the chart data worksheet + IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook(); + + //Changing chart Category Name + fact.getCell(defaultWorksheetIndex, 1, 0, "Modified Category 1"); + fact.getCell(defaultWorksheetIndex, 2, 0, "Modified Category 2"); + + + //Take first chart series + IChartSeries series = chart.getChartData().getSeries().get_Item(0); + + //Now updating series data + fact.getCell(defaultWorksheetIndex, 0, 1, "New_Series1");//modifying series name + series.getDataPoints().get_Item(0).getValue().setData (90); + series.getDataPoints().get_Item(1).getValue().setData ( 123); + series.getDataPoints().get_Item(2).getValue().setData ( 44); + + //Take Second chart series + series = chart.getChartData().getSeries().get_Item(1); + + //Now updating series data + fact.getCell(defaultWorksheetIndex, 0, 2, "New_Series2");//modifying series name + series.getDataPoints().get_Item(0).getValue().setData (23); + series.getDataPoints().get_Item(1).getValue().setData ( 67); + series.getDataPoints().get_Item(2).getValue().setData ( 99); + + + //Now, Adding a new series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 3, "Series 3"), chart.getType()); + + //Take 3rd chart series + series = chart.getChartData().getSeries().get_Item(2); + + //Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 3, 20)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 50)); + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 30)); + + chart.setType(ChartType.ClusteredCylinder); + + // Save presentation with chart + pres.save(dataPath + "ChartModified-Aspose.pptx", SaveFormat.Pptx); + System.out.println("Done"); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/editexistingcharts/java/Pptx4jEditExistingCharts.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/editexistingcharts/java/Pptx4jEditExistingCharts.java new file mode 100644 index 00000000..1b486fd9 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/editexistingcharts/java/Pptx4jEditExistingCharts.java @@ -0,0 +1,171 @@ +package featurescomparison.workingwithpresentations.editexistingcharts.java; + +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; + +import org.docx4j.dml.chart.CTBarChart; +import org.docx4j.dml.chart.CTBarSer; +import org.docx4j.dml.chart.CTNumVal; +import org.docx4j.openpackaging.exceptions.Docx4JException; +import org.docx4j.openpackaging.io.SaveToZipFile; +import org.docx4j.openpackaging.packages.OpcPackage; +import org.docx4j.openpackaging.packages.PresentationMLPackage; +import org.docx4j.openpackaging.packages.SpreadsheetMLPackage; +import org.docx4j.openpackaging.parts.Part; +import org.docx4j.openpackaging.parts.PartName; +import org.docx4j.openpackaging.parts.DrawingML.Chart; +import org.docx4j.openpackaging.parts.SpreadsheetML.WorksheetPart; +import org.docx4j.openpackaging.parts.WordprocessingML.EmbeddedPackagePart; +import org.docx4j.utils.BufferUtil; +import org.xlsx4j.sml.CTRst; +import org.xlsx4j.sml.Cell; +import org.xlsx4j.sml.Row; +import org.xlsx4j.sml.STCellType; + +/** + * NOTICE: ORIGINAL FILE MODIFIED + * Simple demonstration of editing charts in a PowerPoint deck + * + * @author Jeff Beard + * + */ +public class Pptx4jEditExistingCharts +{ + + /** + * Main method + * + * @param args + * @throws Docx4JException + */ + public static void main(String[] args) throws Docx4JException + { + String dataPath = "src/featurescomparison/workingwithpresentations/editexistingcharts/data/"; + + // Input file + String inputfilepath = dataPath + "pptx-chart.pptx"; + + // The names of the parts which will be edited + // Alter these to match what is in your input pptx + // .. the chart + String chartPartName = "/ppt/charts/chart1.xml"; + // .. the xlsx + String xlsPartName = "/ppt/embeddings/Microsoft_Excel_Sheet1.xlsx"; + + // Output file + String outputfilepath = dataPath + "ChartModified-Pptx4j.pptx"; + + // Values to change + Random rand = new Random(); + + String firstValue = String.valueOf(rand.nextInt(99)); + String secondValue = String.valueOf(rand.nextInt(99)); + + // Open the PPT template file + PresentationMLPackage ppt = (PresentationMLPackage) OpcPackage + .load(new java.io.File(inputfilepath)); + + /* + * Get the Chart object and update the values. Afterwards, we'll update + * the associated spreadsheet so that the data is synchronized. + */ + Chart chart = (Chart) ppt.getParts().get(new PartName(chartPartName)); + + List objects = chart.getJaxbElement().getChart().getPlotArea() + .getAreaChartOrArea3DChartOrLineChart(); + + for (Object object : objects) { + + if (object instanceof CTBarChart) { + + List ctBarSers = ((CTBarChart) object).getSer(); + + for (CTBarSer ctBarSer : ctBarSers) + { + List ctNumVals = ctBarSer.getVal().getNumRef().getNumCache().getPt(); + for (CTNumVal ctNumVal : ctNumVals) + { + System.out.println("ctNumVal Val BEFORE: " + ctNumVal.getV()); + if (ctNumVal.getIdx() == 0) { + ctNumVal.setV(firstValue); + } + else if (ctNumVal.getIdx() == 1) { + ctNumVal.setV(secondValue); + } + System.out.println("ctNumVal Val AFTER: " + ctNumVal.getV()); + } + } + } + } + + /* + * Get the spreadsheet and find the cell values that need to be updated + */ + + EmbeddedPackagePart epp = (EmbeddedPackagePart) ppt + .getParts().get(new PartName(xlsPartName)); + + if (epp==null) { + throw new Docx4JException("Could find EmbeddedPackagePart: " + xlsPartName); + } + + InputStream is = BufferUtil.newInputStream(epp.getBuffer()); + + SpreadsheetMLPackage spreadSheet = (SpreadsheetMLPackage) SpreadsheetMLPackage.load(is); + + Map partsMap = spreadSheet.getParts().getParts(); + Iterator> it = partsMap.entrySet().iterator(); + + while(it.hasNext()) { + Map.Entry pairs = it.next(); + + if (partsMap.get(pairs.getKey()) instanceof WorksheetPart) { + + WorksheetPart wsp = (WorksheetPart) partsMap.get(pairs.getKey()) ; + + List rows = wsp.getJaxbElement().getSheetData().getRow(); + + for (Row row : rows) { + List cells = row.getC(); + for (Cell cell : cells) + { + if (cell.getR().equals("B2") && cell.getV() != null) { + System.out.println("B2 CELL VAL: " + cell.getV()); + // change the B2 cell value + cell.setT(STCellType.STR); + cell.setV(firstValue); + } + else if (cell.getR().equals("B3") && cell.getV() != null) { + System.out.println("B3 CELL VAL: " + cell.getV()); + // Change the B3 cell value + cell.setT(STCellType.STR); + cell.setV(secondValue); + } + } + } + } + } + + /* + * Convert the Spreadsheet to a binary format, set it on the + * EmbeddedPackagePart, add it back onto the deck and save to a file. + * + */ + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + SaveToZipFile saver = new SaveToZipFile(spreadSheet); + + saver.save(baos); + epp.setBinaryData(baos.toByteArray()); + + // Write the new file to disk + ppt.save(new java.io.File(outputfilepath)); + + System.out.println("\n\n done .. saved " + outputfilepath); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/helloworld/java/AsposeHelloWorld.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/helloworld/java/AsposeHelloWorld.java new file mode 100644 index 00000000..ab0b5767 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/helloworld/java/AsposeHelloWorld.java @@ -0,0 +1,31 @@ +package featurescomparison.workingwithpresentations.helloworld.java; + +import com.aspose.slides.IAutoShape; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.ShapeType; + +public class AsposeHelloWorld +{ + public static void main(String[] args) + { + String dataPath = "src/featurescomparison/workingwithpresentations/helloworld/data/"; + + // Instantiate Presentation class that represents the PPTX + Presentation pres = new Presentation(); + + //Get the first slide + ISlide sld = (ISlide)pres.getSlides().get_Item(0); + + //Add an AutoShape of Rectangle type + IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 150, 50); + + //Add ITextFrame to the Rectangle + ashp.addTextFrame("Hello World"); + + //Write the PPTX file to disk + pres.save(dataPath + "AsposeHelloWorld.pptx", SaveFormat.Pptx); + System.out.println("Done."); + } +} diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/helloworld/java/Pptx4jHelloWorld.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/helloworld/java/Pptx4jHelloWorld.java new file mode 100644 index 00000000..8bc5b556 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/helloworld/java/Pptx4jHelloWorld.java @@ -0,0 +1,96 @@ +package featurescomparison.workingwithpresentations.helloworld.java; + +import java.net.URI; + +import org.docx4j.XmlUtils; +import org.docx4j.openpackaging.contenttype.ContentTypeManager; +import org.docx4j.openpackaging.contenttype.ContentTypes; +import org.docx4j.openpackaging.packages.PresentationMLPackage; +import org.docx4j.openpackaging.parts.PartName; +import org.docx4j.openpackaging.parts.PresentationML.MainPresentationPart; +import org.docx4j.openpackaging.parts.PresentationML.SlideLayoutPart; +import org.docx4j.openpackaging.parts.PresentationML.SlidePart; +import org.pptx4j.jaxb.Context; +import org.pptx4j.pml.Shape; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Pptx4jHelloWorld { + + protected static Logger log = LoggerFactory.getLogger(Pptx4jHelloWorld.class); + + private static boolean MACRO_ENABLE = true; + + public static void main(String[] args) throws Exception { + + String dataPath = "src/featurescomparison/workingwithpresentations/helloworld/data/"; + + // Where will we save our new .ppxt? + String outputfilepath = dataPath + "Pptx4jHelloWorld.pptx"; + if (MACRO_ENABLE) outputfilepath += "m"; + + // Create skeletal package, including a MainPresentationPart and a SlideLayoutPart + PresentationMLPackage presentationMLPackage = PresentationMLPackage.createPackage(); + + if (MACRO_ENABLE) { + ContentTypeManager ctm = presentationMLPackage.getContentTypeManager(); + ctm.removeContentType(new PartName("/ppt/presentation.xml") ); + ctm.addOverrideContentType(new URI("/ppt/presentation.xml"), ContentTypes.PRESENTATIONML_MACROENABLED); + } + + // Need references to these parts to create a slide + // Please note that these parts *already exist* - they are + // created by createPackage() above. See that method + // for instruction on how to create and add a part. + MainPresentationPart pp = (MainPresentationPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/presentation.xml")); + SlideLayoutPart layoutPart = (SlideLayoutPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/slideLayouts/slideLayout1.xml")); + + // OK, now we can create a slide + SlidePart slidePart = new SlidePart(new PartName("/ppt/slides/slide1.xml")); + slidePart.setContents( SlidePart.createSld() ); + pp.addSlide(0, slidePart); + + // Slide layout part + slidePart.addTargetPart(layoutPart); + + + // Create and add shape + Shape sample = ((Shape)XmlUtils.unmarshalString(SAMPLE_SHAPE, Context.jcPML) ); + slidePart.getContents().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add(sample); + + // All done: save it + presentationMLPackage.save(new java.io.File(outputfilepath)); + + System.out.println("\n\n done .. saved " + outputfilepath); + + } + + + private static String SAMPLE_SHAPE = + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "Hello World" + + "" + + "" + + "" + + "" ++ ""; + +} diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/openexisting/Pptx4jOpenExistingPresentations/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/openexisting/data/presentation.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/openexisting/Pptx4jOpenExistingPresentations/presentation.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/openexisting/data/presentation.pptx diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/openexisting/java/AsposeOpenExistingPresentations.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/openexisting/java/AsposeOpenExistingPresentations.java new file mode 100644 index 00000000..e1c569fb --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/openexisting/java/AsposeOpenExistingPresentations.java @@ -0,0 +1,19 @@ +package featurescomparison.workingwithpresentations.openexisting.java; + +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; + +public class AsposeOpenExistingPresentations +{ + public static void main(String[] args) + { + String dataPath = "src/featurescomparison/workingwithpresentations/openexisting/data/"; + + //Instantiate Presentation class that represents PPTX file + Presentation pres = new Presentation(dataPath + "presentation.pptx"); + + // Save presentation with chart + pres.save(dataPath + "Aspose-Duplicate.pptx", SaveFormat.Pptx); + System.out.println("Done"); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/openexisting/java/Pptx4jOpenExistingPresentations.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/openexisting/java/Pptx4jOpenExistingPresentations.java new file mode 100644 index 00000000..8b4914d8 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithpresentations/openexisting/java/Pptx4jOpenExistingPresentations.java @@ -0,0 +1,22 @@ +package featurescomparison.workingwithpresentations.openexisting.java; + +import org.docx4j.openpackaging.packages.OpcPackage; +import org.docx4j.openpackaging.packages.PresentationMLPackage; + +public class Pptx4jOpenExistingPresentations +{ + public static void main(String[] args) throws Exception + { + String dataPath = "src/featurescomparison/workingwithpresentations/openexisting/data/"; + + String inputfilepath = dataPath + "presentation.pptx"; + + PresentationMLPackage presentationMLPackage = + (PresentationMLPackage)OpcPackage.load(new java.io.File(inputfilepath)); + + System.out.println("\n\n saving .. \n\n"); + presentationMLPackage.save(new java.io.File(dataPath + "Pptx4j-Duplicate.pptx")); + + System.out.println("\n\n done .. \n\n"); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addautoshapes/java/Aspose4jAutoShapes.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addautoshapes/java/Aspose4jAutoShapes.java new file mode 100644 index 00000000..b9b14223 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addautoshapes/java/Aspose4jAutoShapes.java @@ -0,0 +1,32 @@ +package featurescomparison.workingwithslides.addautoshapes.java; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.ShapeType; + +public class Aspose4jAutoShapes +{ + public static void main(String[] args) + { + String dataPath = "src/featurescomparison/workingwithslides/addautoshapes/data/"; + + //Instantiate PresentationEx class that represents the PPTX file + Presentation pres = new Presentation(); + + //Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + for (int i = 1 ; i <= ShapeType.ChartPlus ; i++) + { + System.out.println(i + ". Done."); + //Add an auto shape of type line + sld.getShapes().addAutoShape(i, 50, 100, 150, 100); + sld = pres.getSlides().addEmptySlide(pres.getLayoutSlides().get_Item(0)); + } + //Write the PPTX to Disk + pres.save(dataPath + "AsposeShapes.pptx", SaveFormat.Pptx); + + System.out.println("Done..."); + } +} diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addautoshapes/java/Pptx4jAutoShapes.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addautoshapes/java/Pptx4jAutoShapes.java new file mode 100644 index 00000000..068ba0cb --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addautoshapes/java/Pptx4jAutoShapes.java @@ -0,0 +1,197 @@ +package featurescomparison.workingwithslides.addautoshapes.java; + +import javax.xml.bind.JAXBException; + +import org.docx4j.XmlUtils; +import org.docx4j.dml.STShapeType; +import org.docx4j.openpackaging.exceptions.InvalidFormatException; +import org.docx4j.openpackaging.packages.PresentationMLPackage; +import org.docx4j.openpackaging.parts.PartName; +import org.docx4j.openpackaging.parts.PresentationML.MainPresentationPart; +import org.docx4j.openpackaging.parts.PresentationML.SlideLayoutPart; +import org.docx4j.openpackaging.parts.PresentationML.SlidePart; +import org.pptx4j.jaxb.Context; +import org.pptx4j.pml.Shape; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Pptx4jAutoShapes { + + protected static Logger log = LoggerFactory.getLogger(Pptx4jAutoShapes.class); + + public static void main(String[] args) throws Exception + { + String dataPath = "src/featurescomparison/workingwithslides/addautoshapes/data/"; + + // Where will we save our new .ppxt? + String outputfilepath = dataPath + "Pptx4jAutoShapes.pptx"; + + // Create skeletal package + PresentationMLPackage presentationMLPackage = PresentationMLPackage.createPackage(); + + MainPresentationPart pp = (MainPresentationPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/presentation.xml")); + + SlideLayoutPart layoutPart = (SlideLayoutPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/slideLayouts/slideLayout1.xml")); + + boolean noLine = false; + + /* ST_ShapeType has 203 values + * + * Create a slide for each shape */ + int i = 1; + for (STShapeType st : STShapeType.values() ) { + + System.out.println("Adding slide for shape: " + st.value() ); + + SlidePart slidePart = createSlidePart(pp, layoutPart, i); + + // Create and add shapes + Shape title = ((Shape)XmlUtils.unmarshalString( + getSlideTitle(st.value()), Context.jcPML) ); + slidePart.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add(title); + + + Shape sample = ((Shape)XmlUtils.unmarshalString( + getPresetShape(st.value(), noLine), Context.jcPML) ); + slidePart.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add(sample); + + i++; + } + // All done: save it + presentationMLPackage.save(new java.io.File(outputfilepath)); + + System.out.println("\n\n done .. saved " + outputfilepath); + + } + + + /** + * Create a slide and add it to the package + * + * @param pp + * @param layoutPart + * @param i + * @return the slide + * @throws InvalidFormatException + * @throws JAXBException + */ + private static SlidePart createSlidePart(MainPresentationPart pp, SlideLayoutPart layoutPart, int i) + throws InvalidFormatException, JAXBException { + + // Slide part + SlidePart slidePart = new SlidePart(new PartName("/ppt/slides/slide" + i +".xml") ); + pp.addSlideIdListEntry(slidePart); + + slidePart.setJaxbElement( SlidePart.createSld() ); + + // Slide layout part + slidePart.addTargetPart(layoutPart); + + return slidePart; + } + + + /** + * get XML for the specified present shape + * + * @param preset + * @param noLine + * @return + */ + private static String getPresetShape(String preset, boolean noLine) { + + String txBody = ""; + String ln = ""; + + // Shape will say "click here to add title" + // if txBody is not present. + // If txBody is present, shape will be invisible + // unless a:ln is present + if (!noLine) { +// txBody = "" +// + "" +// + "" +// + "" +// + "" +// + "" +// + " " +// + "" +// + "" +// + "" +// + ""; + + ln = "" + +"" + +"" + +"" + +""; + } + + /* + * If you don't have a:ln, there will be no lines, + * so the shape will be invisible. + * + * If you add , you'll get + * a title (and the dotted outline of the shape + * will be visible). + * + * Without a p:txBody, the words "Click to + * add title" will appear. (maybe title because + * of our p:ph/@type?) + * + */ + + + return + "" + + "" + + "" + + "" + //+ "" + //+ "" + + "" +// + "" +// + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + ln + + "" + + txBody + + ""; + } + + private static String getSlideTitle(String preset) { + return "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + preset + "" + + "" + + "" + + "" + + "" ++ ""; + } +} diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addhyperlink/java/AsposeCreateHyperlink.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addhyperlink/java/AsposeCreateHyperlink.java new file mode 100644 index 00000000..da246b30 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addhyperlink/java/AsposeCreateHyperlink.java @@ -0,0 +1,46 @@ +package featurescomparison.workingwithslides.addhyperlink.java; + +import com.aspose.slides.IAutoShape; +import com.aspose.slides.IHyperlinkManager; +import com.aspose.slides.IShape; +import com.aspose.slides.ISlide; +import com.aspose.slides.ITextFrame; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.ShapeType; + +public class AsposeCreateHyperlink +{ + public static void main(String[] args) + { + String dataPath = "src/featurescomparison/workingwithslides/addhyperlink/data/"; + + //Instantiate Presentation class that represents PPTX + Presentation pres = new Presentation(); + + //Access first slide + ISlide slide = pres.getSlides().get_Item(0); + + //Add an AutoShape of Rectangle Type + IShape pptxShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 150, 150, 150, 50); + + //Cast the shape to AutoShape + IAutoShape pptxAutoShape = (IAutoShape)pptxShape; + + //Access ITextFrame associated with the AutoShape + pptxAutoShape.addTextFrame(""); + + ITextFrame ITextFrame = pptxAutoShape.getTextFrame(); + + //Add some text to the frame + ITextFrame.getParagraphs().get_Item(0).getPortions().get_Item(0).setText("Aspose.Slides"); + + //Set Hyperlink for the portion text + IHyperlinkManager HypMan = ITextFrame.getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getHyperlinkManager(); + HypMan.setExternalHyperlinkClick("http://www.aspose.com"); + + //Save the PPTX to Disk + pres.save(dataPath + "AsposeHyperlink.pptx", SaveFormat.Pptx); + System.out.println("Done."); + } +} diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addhyperlink/java/Pptx4jCreateHyperlink.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addhyperlink/java/Pptx4jCreateHyperlink.java new file mode 100644 index 00000000..da0885e0 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addhyperlink/java/Pptx4jCreateHyperlink.java @@ -0,0 +1,285 @@ +package featurescomparison.workingwithslides.addhyperlink.java; + +import java.util.ArrayList; +import java.util.List; + +import org.docx4j.XmlUtils; +import org.docx4j.openpackaging.packages.PresentationMLPackage; +import org.docx4j.openpackaging.parts.PartName; +import org.docx4j.openpackaging.parts.PresentationML.MainPresentationPart; +import org.docx4j.openpackaging.parts.PresentationML.SlideLayoutPart; +import org.docx4j.openpackaging.parts.PresentationML.SlidePart; +import org.docx4j.openpackaging.parts.relationships.Namespaces; +import org.pptx4j.jaxb.Context; +import org.pptx4j.pml.CTGraphicalObjectFrame; +import org.pptx4j.pml.Shape; + + +public class Pptx4jCreateHyperlink { + /** + * @param args + * @throws Exception + */ + static int rows = 1; + static int columns = 2; + static List colColors = getCellColors(); + static List colValues = getCellValues(); + + public static void main(String[] args) throws Exception { + startPptx(); + + } + private static void startPptx() throws Exception { + + // generate Ppt file + String dataPath = "src/featurescomparison/workingwithslides/addhyperlink/data/"; + PresentationMLPackage presentationMLPackage = PresentationMLPackage.createPackage(); + MainPresentationPart pp = (MainPresentationPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/presentation.xml")); + SlideLayoutPart layoutPart = (SlideLayoutPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/slideLayouts/slideLayout1.xml")); + + // OK, now we can create a slide + SlidePart slidePart = null; + slidePart = presentationMLPackage.createSlidePart(pp, layoutPart, new PartName("/ppt/slides/slide1.xml")); + + org.docx4j.relationships.ObjectFactory factory = new org.docx4j.relationships.ObjectFactory(); + + //first Link relation + org.docx4j.relationships.Relationship rel1 = factory.createRelationship(); + rel1.setType(Namespaces.PRESENTATIONML_SLIDE); + rel1.setTarget("/ppt/slides/slide"+5+".xml"); + slidePart.getRelationshipsPart().addRelationship(rel1); + + String linkedTable = table1.replaceFirst("replaceID", rel1.getId()); + + //second link relation + org.docx4j.relationships.Relationship rel2 = factory.createRelationship(); + rel2.setType(Namespaces.PRESENTATIONML_SLIDE); + rel2.setTarget("/ppt/slides/slide"+10+".xml"); + slidePart.getRelationshipsPart().addRelationship(rel2); + + linkedTable = linkedTable.replaceFirst("replaceID", rel2.getId()); + + + CTGraphicalObjectFrame graphicFrame2=(CTGraphicalObjectFrame) XmlUtils.unmarshalString(linkedTable, Context.jcPML,CTGraphicalObjectFrame.class); + slidePart.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add(graphicFrame2); + + for (int i=2;i<15;i++) + { + slidePart = presentationMLPackage.createSlidePart(pp, layoutPart, new PartName("/ppt/slides/slide"+i+".xml")); + Shape sample = ((Shape)XmlUtils.unmarshalString(getTextData(i), Context.jcPML) ); + slidePart.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add(sample); + } + presentationMLPackage.save(new java.io.File(dataPath + "PPTx4j-Hyperlink.pptx")); + System.out.println("Done"); + + + } + + private static String getTextData(int i) { + return "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + ""+ "Slide : "+ i +"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + ""; + + } + private static List getCellValues() { + List list = new ArrayList(); + list.add("Link to slide 5"); + list.add("Link to slide 10"); + return list; + } + private static List getCellColors() { + List list = new ArrayList(); + list.add("ddddff"); + list.add("ffdddd"); + return list; + } + private static String table1 = "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + getColumnWidths() + + "" + + getColumnData() + + "" + + "" + + "" + + ""; + + private static String getColumnWidths() { + StringBuffer str = new StringBuffer(""); + for(int i = 0;i"); + } + + return str.toString(); + } + private static String getColumnData() { + int counter = -1; + StringBuffer str = new StringBuffer(""); + for(int r = 0;r"); + + for(int c = 0;c" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + ""+ colValues.get(counter) +"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + ""); + + } + str.append(""); + } + + return str.toString(); + } +} diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/AsposeAddImageToSlide/greentick.png b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addimagetoslide/data/greentick.png similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/AsposeAddImageToSlide/greentick.png rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addimagetoslide/data/greentick.png diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addimagetoslide/java/AsposeAddImageToSlide.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addimagetoslide/java/AsposeAddImageToSlide.java new file mode 100644 index 00000000..e251bfda --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addimagetoslide/java/AsposeAddImageToSlide.java @@ -0,0 +1,45 @@ +package featurescomparison.workingwithslides.addimagetoslide.java; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; + +import com.aspose.slides.IPPImage; +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; +import com.aspose.slides.ShapeType; + +/** + * + * @author Shoaib Khan + * + */ +public class AsposeAddImageToSlide +{ + public static void main(String[] args) + { + String dataPath = "src/featurescomparison/workingwithslides/addimagetoslide/data/"; + + //Instantiate Presentation class that represents the PPTX + Presentation pres = new Presentation(); + + //Get the first slide + ISlide sld = pres.getSlides().get_Item(0); + + //Instantiate the Image class + IPPImage imgx = null; + + try{ + imgx = pres.getImages().addImage(new FileInputStream(new File(dataPath + "greentick.png"))); + } + catch(IOException e){} + + //Add Picture Frame with height and width equivalent of Picture + sld.getShapes().addPictureFrame(ShapeType.Rectangle, 50, 150, imgx.getWidth(), imgx.getHeight(), imgx); + + //Write the PPTX file to disk + pres.save(dataPath + "ImageInSlide-Aspose.pptx", SaveFormat.Pptx); + System.out.println("Done."); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addimagetoslide/java/Pptx4jAddImageToSlide.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addimagetoslide/java/Pptx4jAddImageToSlide.java new file mode 100644 index 00000000..561477b8 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/addimagetoslide/java/Pptx4jAddImageToSlide.java @@ -0,0 +1,139 @@ +/* + * Copyright 2010-11, Plutext Pty Ltd. + * + * This file is part of docx4j. + + docx4j is licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + NOTICE: ORIGINAL FILE MODIFIED + */ + +package featurescomparison.workingwithslides.addimagetoslide.java; + +import java.io.File; + +import javax.xml.bind.JAXBException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.docx4j.openpackaging.packages.PresentationMLPackage; +import org.docx4j.openpackaging.parts.PartName; +import org.docx4j.openpackaging.parts.PresentationML.MainPresentationPart; +import org.docx4j.openpackaging.parts.PresentationML.SlideLayoutPart; +import org.docx4j.openpackaging.parts.PresentationML.SlidePart; +import org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage; +import org.docx4j.relationships.Relationship; +import org.pptx4j.jaxb.Context; +import org.pptx4j.pml.Pic; + +public class Pptx4jAddImageToSlide +{ + public static void main(String[] args) throws Exception { + + final Logger log = LoggerFactory.getLogger(Pptx4jAddImageToSlide.class); + + String dataPath = "src/featurescomparison/workingwithslides/addimagetoslide/data/"; + + // Where will we save our new .pptx? + String outputfilepath = dataPath + "ImageInSlide-Pptx4j.pptx"; + + // Create skeletal package, including a MainPresentationPart and a SlideLayoutPart + PresentationMLPackage presentationMLPackage = PresentationMLPackage.createPackage(); + + // Need references to these parts to create a slide + // Please note that these parts *already exist* - they are + // created by createPackage() above. See that method + // for instruction on how to create and add a part. + MainPresentationPart pp = (MainPresentationPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/presentation.xml")); + SlideLayoutPart layoutPart = (SlideLayoutPart)presentationMLPackage.getParts().getParts().get( + new PartName("/ppt/slideLayouts/slideLayout1.xml")); + + // OK, now we can create a slide + SlidePart slidePart = presentationMLPackage.createSlidePart(pp, layoutPart, + new PartName("/ppt/slides/slide1.xml")); + + // Add image part + File file = new File(dataPath + "greentick.png" ); + BinaryPartAbstractImage imagePart + = BinaryPartAbstractImage.createImagePart(presentationMLPackage, slidePart, file); + + + // Add p:pic to slide + slidePart.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add( + createPicture(imagePart.getSourceRelationship().getId())); + + + // Do it again on another slide + SlidePart slidePart2 = presentationMLPackage.createSlidePart(pp, layoutPart, + new PartName("/ppt/slides/slide2.xml")); + Relationship rel = slidePart2.addTargetPart(imagePart); + + slidePart2.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add( + createPicture(rel.getId())); + + // All done: save it + presentationMLPackage.save(new java.io.File(outputfilepath)); + + System.out.println("\n\n done .. saved " + outputfilepath); + + } + + private static Object createPicture(String relId) throws JAXBException { + + // Create p:pic + java.util.HashMapmappings = new java.util.HashMap(); + + mappings.put("id1", "4"); + mappings.put("name", "Picture 3"); + mappings.put("descr", "greentick.png"); + mappings.put("rEmbedId", relId ); + mappings.put("offx", Long.toString(4214812)); + mappings.put("offy", Long.toString(3071812)); + mappings.put("extcx", Long.toString(714375)); + mappings.put("extcy", Long.toString(714375)); + + return org.docx4j.XmlUtils.unmarshallFromTemplate(SAMPLE_PICTURE, + mappings, Context.jcPML, Pic.class ) ; + + + } + + + private static String SAMPLE_PICTURE = + " " + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + ""; +} \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/removeslide/AsposeRemoveSlide/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/removeslide/data/presentation.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/removeslide/AsposeRemoveSlide/presentation.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/removeslide/data/presentation.pptx diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/removeslide/java/AsposeRemoveSlide.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/removeslide/java/AsposeRemoveSlide.java new file mode 100644 index 00000000..bb10d7b0 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/removeslide/java/AsposeRemoveSlide.java @@ -0,0 +1,31 @@ +package featurescomparison.workingwithslides.removeslide.java; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; +import com.aspose.slides.SaveFormat; + +public class AsposeRemoveSlide +{ + public static void main(String[] args) + { + String dataPath = "src/featurescomparison/workingwithslides/removeslide/data/"; + + //Instantiate a Presentation object that represents a presentation file + Presentation pres = new Presentation(dataPath + "presentation.pptx"); + + //Accessing a slide using its index in the slides collection + ISlide slide = pres.getSlides().get_Item(1); + + //Removing a slide using its reference + pres.getSlides().remove(slide); + + //Removing a slide using its slide index + pres.getSlides().removeAt(0); + + //Writing the presentation file + pres.save(dataPath + "RemovedSlide-Aspose.pptx",SaveFormat.Pptx); + + //Printing the status + System.out.println("Slides removed successfully!"); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/removeslide/java/Pptx4jRemoveSlide.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/removeslide/java/Pptx4jRemoveSlide.java new file mode 100644 index 00000000..9f71b201 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/removeslide/java/Pptx4jRemoveSlide.java @@ -0,0 +1,52 @@ +/* + * Copyright 2007-2008, Plutext Pty Ltd. + * + * This file is part of docx4j. + + docx4j is licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + NOTICE: ORIGINAL FILE MODIFIED + */ + +package featurescomparison.workingwithslides.removeslide.java; + +import org.docx4j.openpackaging.packages.OpcPackage; +import org.docx4j.openpackaging.packages.PresentationMLPackage; +import org.docx4j.openpackaging.parts.PresentationML.MainPresentationPart; +import org.docx4j.relationships.Relationship; + +public class Pptx4jRemoveSlide +{ + public static void main(String[] args) throws Exception + { + String dataPath = "src/featurescomparison/workingwithslides/removeslide/data/"; + + String inputfilepath = dataPath + "presentation.pptx"; + + PresentationMLPackage presentationMLPackage = + (PresentationMLPackage)OpcPackage.load(new java.io.File(inputfilepath)); + + MainPresentationPart mpp = presentationMLPackage.getMainPresentationPart(); + + //mpp.removeSlide(10); + Relationship rel = mpp.getRelationshipsPart().getRelationshipByID("rId2"); + mpp.removeSlide(rel); + + System.out.println("\n\n saving .. \n\n"); + String outputfilepath = dataPath + "RemovedSlide-Pptx4j.pptx"; + presentationMLPackage.save(new java.io.File(outputfilepath)); + + System.out.println("\n\n done .. \n\n"); + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/traverseslide/Pptx4jTraverseSlides/pptx-basic.xml b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/traverseslide/data/pptx-basic.xml similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/traverseslide/Pptx4jTraverseSlides/pptx-basic.xml rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/traverseslide/data/pptx-basic.xml diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/removeslide/Pptx4jRemoveSlide/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/traverseslide/data/presentation.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/removeslide/Pptx4jRemoveSlide/presentation.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/traverseslide/data/presentation.pptx diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/traverseslide/java/AsposeTraverseSlides.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/traverseslide/java/AsposeTraverseSlides.java new file mode 100644 index 00000000..54af9ed1 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/traverseslide/java/AsposeTraverseSlides.java @@ -0,0 +1,22 @@ +package featurescomparison.workingwithslides.traverseslide.java; + +import com.aspose.slides.ISlide; +import com.aspose.slides.Presentation; + +public class AsposeTraverseSlides +{ + public static void main(String[] args) + { + String dataPath = "src/featurescomparison/workingwithslides/traverseslide/data/"; + + //Instantiate a Presentation object that represents a presentation file + Presentation pres = new Presentation(dataPath + "presentation.pptx"); + + //Accessing slides + for (ISlide slide : pres.getSlides()) + { + System.out.println(slide.getSlideNumber()); + } + System.out.println("Done..."); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/traverseslide/java/Pptx4jTraverseSlides.java b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/traverseslide/java/Pptx4jTraverseSlides.java new file mode 100644 index 00000000..41acfedf --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Java/src/featurescomparison/workingwithslides/traverseslide/java/Pptx4jTraverseSlides.java @@ -0,0 +1,188 @@ +/* + * Copyright 2011, Plutext Pty Ltd. + * + * This file is part of docx4j. + + docx4j is licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + NOTICE: ORIGINAL FILE MODIFIED + */ +package featurescomparison.workingwithslides.traverseslide.java; + +import java.util.List; + +import javax.xml.bind.JAXBContext; + +import org.docx4j.TraversalUtil; +import org.docx4j.XmlUtils; +import org.docx4j.TraversalUtil.Callback; +import org.docx4j.dml.CTTextBody; +import org.docx4j.dml.CTTextParagraph; +import org.docx4j.openpackaging.packages.OpcPackage; +import org.docx4j.openpackaging.packages.PresentationMLPackage; +import org.docx4j.openpackaging.packages.WordprocessingMLPackage; +import org.docx4j.openpackaging.parts.PartName; +import org.docx4j.openpackaging.parts.PresentationML.SlidePart; +import org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart; +import org.docx4j.samples.AbstractSample; +import org.docx4j.wml.Body; + +/** + * This sample is useful if you want to see what objects are used in your + * document.xml. + * + * This shows a general approach for traversing the JAXB object tree in the Main + * Document part. It can also be applied to headers, footers etc. + * + * It is an alternative to XSLT, and doesn't require marshalling/unmarshalling. + * + * If many cases, the method getJAXBNodesViaXPath may be more convenient. + * + * + */ + +public class Pptx4jTraverseSlides extends AbstractSample +{ + public static JAXBContext context = org.docx4j.jaxb.Context.jc; + + /** + * @param args + */ + public static void main(String[] args) throws Exception + { + + /* + * You can invoke this from an OS command line with something like: + * + * java -cp dist/docx4j.jar:dist/log4j-1.2.15.jar + * org.docx4j.samples.OpenMainDocumentAndTraverse inputdocx + * + * Note the minimal set of supporting jars. + * + * If there are any images in the document, you will also need: + * + * dist/xmlgraphics-commons-1.4.jar:dist/commons-logging-1.1.1.jar + */ + String dataPath = "src/featurescomparison/workingwithslides/traverseslide/data/"; + + inputfilepath = dataPath + "pptx-basic.xml"; + + PresentationMLPackage pMLPackage = (PresentationMLPackage) OpcPackage + .load(new java.io.File(inputfilepath)); + + SlidePart slide = (SlidePart) pMLPackage.getParts().get( + new PartName("/ppt/slides/slide1.xml")); + + new TraversalUtil(slide.getJaxbElement().getCSld().getSpTree() + .getSpOrGrpSpOrGraphicFrame(), + + new Callback() + { + + String indent = ""; + + // @Override + public List apply(Object o) + { + + String text = ""; + + try + { + System.out.println(indent + + o.getClass().getName() + + "\n\n" + + XmlUtils.marshaltoString(o, true, + org.pptx4j.jaxb.Context.jcPML)); + } + catch (RuntimeException me) + { + System.out.println(indent + o.getClass().getName()); + } + + if (o instanceof org.pptx4j.pml.Shape) + { + CTTextBody txBody = ((org.pptx4j.pml.Shape) o).getTxBody(); + if (txBody != null) + { + for (CTTextParagraph tp : txBody.getP()) + { + + System.out.println(indent + + tp.getClass().getName() + + "\n\n" + + XmlUtils + .marshaltoString( + tp, + true, + true, + org.pptx4j.jaxb.Context.jcPML, + "http://schemas.openxmlformats.org/presentationml/2006/main", + "txBody", + CTTextParagraph.class)); + + } + } + } + + return null; + } + + // @Override + public boolean shouldTraverse(Object o) + { + return true; + } + + // Depth first + // @Override + public void walkJAXBElements(Object parent) + { + + indent += " "; + + List children = getChildren(parent); + if (children != null) + { + + for (Object o : children) + { + + // if its wrapped in javax.xml.bind.JAXBElement, get its + // value + o = XmlUtils.unwrap(o); + + this.apply(o); + + if (this.shouldTraverse(o)) + { + walkJAXBElements(o); + } + + } + } + + indent = indent.substring(0, indent.length() - 4); + } + + // @Override + public List getChildren(Object o) + { + return TraversalUtil.getChildrenImpl(o); + } + } + ); + System.out.println("Done..."); + } +} \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/LICENSE b/Plugins/Aspose.Slides Java for Pptx4j/Maven/LICENSE new file mode 100644 index 00000000..a041d8f4 --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Maven/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2001-2016 Aspose Pty Ltd + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/pom.xml b/Plugins/Aspose.Slides Java for Pptx4j/Maven/pom.xml similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/pom.xml rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/pom.xml diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/Utils.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/Utils.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/Utils.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/Utils.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/charts/charttrendlines/AsposeAddChartTrendLines.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/charts/charttrendlines/AsposeAddChartTrendLines.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/charts/charttrendlines/AsposeAddChartTrendLines.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/charts/charttrendlines/AsposeAddChartTrendLines.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/charts/numberformatforchartdatacell/AsposeNumberFormatForChartDataCell.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/charts/numberformatforchartdatacell/AsposeNumberFormatForChartDataCell.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/charts/numberformatforchartdatacell/AsposeNumberFormatForChartDataCell.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/charts/numberformatforchartdatacell/AsposeNumberFormatForChartDataCell.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/charts/piechartsectorcolor/AsposeSettingPieChartSectorColors.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/charts/piechartsectorcolor/AsposeSettingPieChartSectorColors.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/charts/piechartsectorcolor/AsposeSettingPieChartSectorColors.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/charts/piechartsectorcolor/AsposeSettingPieChartSectorColors.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/mediacontrols/addaudioframe/AsposeAudioFrame.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/mediacontrols/addaudioframe/AsposeAudioFrame.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/mediacontrols/addaudioframe/AsposeAudioFrame.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/mediacontrols/addaudioframe/AsposeAudioFrame.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/presentation/converttopdf/AsposeConverter.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/presentation/converttopdf/AsposeConverter.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/presentation/converttopdf/AsposeConverter.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/presentation/converttopdf/AsposeConverter.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/presentation/shadoweffectsontext/AsposeShadowEffectsOnText.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/presentation/shadoweffectsontext/AsposeShadowEffectsOnText.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/presentation/shadoweffectsontext/AsposeShadowEffectsOnText.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/presentation/shadoweffectsontext/AsposeShadowEffectsOnText.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/security/applypasswordprotection/AsposeApplyPasswordProtection.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/security/applypasswordprotection/AsposeApplyPasswordProtection.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/security/applypasswordprotection/AsposeApplyPasswordProtection.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/security/applypasswordprotection/AsposeApplyPasswordProtection.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/security/applyprotectionwithproperties/AsposeApplyProtectionwithPropertiesAccess.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/security/applyprotectionwithproperties/AsposeApplyProtectionwithPropertiesAccess.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/security/applyprotectionwithproperties/AsposeApplyProtectionwithPropertiesAccess.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/security/applyprotectionwithproperties/AsposeApplyProtectionwithPropertiesAccess.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/slides/cloneslide/AsposeCloneSlide.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/slides/cloneslide/AsposeCloneSlide.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/slides/cloneslide/AsposeCloneSlide.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/slides/cloneslide/AsposeCloneSlide.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/slides/cloneslidetospecificposition/AsposeCloneToSpecifiedPosition.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/slides/cloneslidetospecificposition/AsposeCloneToSpecifiedPosition.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/slides/cloneslidetospecificposition/AsposeCloneToSpecifiedPosition.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/slides/cloneslidetospecificposition/AsposeCloneToSpecifiedPosition.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/slides/manageslidetransition/AsposeTransitions.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/slides/manageslidetransition/AsposeTransitions.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/slides/manageslidetransition/AsposeTransitions.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/slides/manageslidetransition/AsposeTransitions.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/slides/slidecomments/AsposeComments.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/slides/slidecomments/AsposeComments.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/slides/slidecomments/AsposeComments.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/slides/slidecomments/AsposeComments.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/slides/slidethumbnails/AsposeThumbnail.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/slides/slidethumbnails/AsposeThumbnail.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/slides/slidethumbnails/AsposeThumbnail.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/slides/slidethumbnails/AsposeThumbnail.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/smartart/addnodes/AsposeAddSmartArtNodes.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/smartart/addnodes/AsposeAddSmartArtNodes.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/smartart/addnodes/AsposeAddSmartArtNodes.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/smartart/addnodes/AsposeAddSmartArtNodes.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/smartart/managesmartart/AsposeSmartArt.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/smartart/managesmartart/AsposeSmartArt.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/smartart/managesmartart/AsposeSmartArt.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/smartart/managesmartart/AsposeSmartArt.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/AsposeConvertToHTML.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/AsposeConvertToHTML.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/AsposeConvertToHTML.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/AsposeConvertToHTML.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/Pptx4jConvertToHTML.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/Pptx4jConvertToHTML.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/Pptx4jConvertToHTML.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/Pptx4jConvertToHTML.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createnewpresentation/AsposeCreateNewPresentation.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createnewpresentation/AsposeCreateNewPresentation.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createnewpresentation/AsposeCreateNewPresentation.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createnewpresentation/AsposeCreateNewPresentation.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createnewpresentation/Pptx4jCreateNewPresentation.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createnewpresentation/Pptx4jCreateNewPresentation.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createnewpresentation/Pptx4jCreateNewPresentation.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createnewpresentation/Pptx4jCreateNewPresentation.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createtable/AsposeCreateTable.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createtable/AsposeCreateTable.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createtable/AsposeCreateTable.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createtable/AsposeCreateTable.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createtable/Pptx4jCreateTable.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createtable/Pptx4jCreateTable.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createtable/Pptx4jCreateTable.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/createtable/Pptx4jCreateTable.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/AsposeEditExistingCharts.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/AsposeEditExistingCharts.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/AsposeEditExistingCharts.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/AsposeEditExistingCharts.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/Pptx4jEditExistingCharts.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/Pptx4jEditExistingCharts.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/Pptx4jEditExistingCharts.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/Pptx4jEditExistingCharts.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/helloworld/AsposeHelloWorld.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/helloworld/AsposeHelloWorld.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/helloworld/AsposeHelloWorld.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/helloworld/AsposeHelloWorld.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/helloworld/Pptx4jHelloWorld.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/helloworld/Pptx4jHelloWorld.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/helloworld/Pptx4jHelloWorld.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/helloworld/Pptx4jHelloWorld.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/openexisting/AsposeOpenExistingPresentations.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/openexisting/AsposeOpenExistingPresentations.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/openexisting/AsposeOpenExistingPresentations.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/openexisting/AsposeOpenExistingPresentations.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/openexisting/Pptx4jOpenExistingPresentations.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/openexisting/Pptx4jOpenExistingPresentations.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/openexisting/Pptx4jOpenExistingPresentations.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/presentations/openexisting/Pptx4jOpenExistingPresentations.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addautoshapes/Aspose4jAutoShapes.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addautoshapes/Aspose4jAutoShapes.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addautoshapes/Aspose4jAutoShapes.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addautoshapes/Aspose4jAutoShapes.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addautoshapes/Pptx4jAutoShapes.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addautoshapes/Pptx4jAutoShapes.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addautoshapes/Pptx4jAutoShapes.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addautoshapes/Pptx4jAutoShapes.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/AsposeAddImageToSlide.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/AsposeAddImageToSlide.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/AsposeAddImageToSlide.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/AsposeAddImageToSlide.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/Pptx4jAddImageToSlide.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/Pptx4jAddImageToSlide.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/Pptx4jAddImageToSlide.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/Pptx4jAddImageToSlide.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/removeslide/AsposeRemoveSlide.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/removeslide/AsposeRemoveSlide.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/removeslide/AsposeRemoveSlide.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/removeslide/AsposeRemoveSlide.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/removeslide/Pptx4jRemoveSlide.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/removeslide/Pptx4jRemoveSlide.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/removeslide/Pptx4jRemoveSlide.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/removeslide/Pptx4jRemoveSlide.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/traverseslide/AsposeTraverseSlides.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/traverseslide/AsposeTraverseSlides.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/traverseslide/AsposeTraverseSlides.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/traverseslide/AsposeTraverseSlides.java diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/traverseslide/Pptx4jTraverseSlides.java b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/traverseslide/Pptx4jTraverseSlides.java similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/java/com/aspose/slides/examples/featurescomparison/slides/traverseslide/Pptx4jTraverseSlides.java rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/java/com/aspose/slides/examples/featurescomparison/slides/traverseslide/Pptx4jTraverseSlides.java diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/mediacontrols/addaudioframe/AsposeAudioFrame/logon.wav b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/mediacontrols/addaudioframe/AsposeAudioFrame/logon.wav new file mode 100644 index 00000000..9d1ba566 Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/mediacontrols/addaudioframe/AsposeAudioFrame/logon.wav differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/presentation/converttopdf/AsposeConverter/presentation.ppt b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/presentation/converttopdf/AsposeConverter/presentation.ppt new file mode 100644 index 00000000..1d1c5581 Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/presentation/converttopdf/AsposeConverter/presentation.ppt differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/cloneslide/AsposeCloneSlide/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/cloneslide/AsposeCloneSlide/presentation.pptx new file mode 100644 index 00000000..cec60b81 Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/cloneslide/AsposeCloneSlide/presentation.pptx differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/cloneslidetospecificposition/AsposeCloneToSpecifiedPosition/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/cloneslidetospecificposition/AsposeCloneToSpecifiedPosition/presentation.pptx new file mode 100644 index 00000000..cec60b81 Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/cloneslidetospecificposition/AsposeCloneToSpecifiedPosition/presentation.pptx differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/manageslidetransition/AsposeTransitions/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/manageslidetransition/AsposeTransitions/presentation.pptx new file mode 100644 index 00000000..cec60b81 Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/manageslidetransition/AsposeTransitions/presentation.pptx differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/slidethumbnails/AsposeThumbnail/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/slidethumbnails/AsposeThumbnail/presentation.pptx new file mode 100644 index 00000000..cec60b81 Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/slides/slidethumbnails/AsposeThumbnail/presentation.pptx differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/addnodes/AsposeAddSmartArtNodes/AsposeSmartArt.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/addnodes/AsposeAddSmartArtNodes/AsposeSmartArt.pptx new file mode 100644 index 00000000..c211a89b Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/addnodes/AsposeAddSmartArtNodes/AsposeSmartArt.pptx differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes/AsposeAddSmartArtNode.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes/AsposeAddSmartArtNode.pptx new file mode 100644 index 00000000..c0ee0d24 Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes/AsposeAddSmartArtNode.pptx differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes/AsposeAddSmartArtNodeByPosition.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes/AsposeAddSmartArtNodeByPosition.pptx new file mode 100644 index 00000000..bc33ac08 Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/asposefeatures/smartart/removenodes/AsposeRemoveSmartArtNodes/AsposeAddSmartArtNodeByPosition.pptx differ diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/traverseslide/AsposeTraverseSlides/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/AsposeConvertToHTML/presentation.pptx similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/traverseslide/AsposeTraverseSlides/presentation.pptx rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/AsposeConvertToHTML/presentation.pptx diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/Pptx4jConvertToHTML/pptx-basic.xml b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/Pptx4jConvertToHTML/pptx-basic.xml new file mode 100644 index 00000000..023bd3ef --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/converttohtml/Pptx4jConvertToHTML/pptx-basic.xml @@ -0,0 +1,156 @@ + + +Basic featuresMy subtitleSVG in HTML output - statusXSLT framework works (ie slides render), but need to flesh out support for various shapesText boxes should be positioned correctly (21/1)Style resolution is working, but only implemented for some properties (21/1)TODO: bulletsUnderline, italics etcNot done yet: Border and shadingLines (done)Images (done 28/7/2010)My text boxMy text box with borderMy text box, with some run level formatting. Italics, bold, underline. Larger.Basic slideBullet 1Level 2Bullet 2432Added a note.1Click to edit Master title styleClick to edit Master text stylesClick to edit Master text stylesSecond levelThird levelFourth levelFifth levelClick to edit Master text stylesClick to edit Master text stylesSecond levelThird levelFourth levelFifth level7/29/2010‹#›Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth levelClick to edit Master text stylesSecond levelThird levelFourth levelFifth level7/29/2010‹#›Click to edit Master title styleClick to edit Master text styles7/29/2010‹#›Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth level7/29/2010‹#›Click to edit Master title styleClick to edit Master subtitle style7/29/2010‹#›Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth level7/29/2010‹#›Click to edit Master title style7/29/2010‹#›7/29/2010‹#›Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth levelClick to edit Master text styles7/29/2010‹#›Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth level7/29/2010‹#›Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth level7/29/2010‹#›Click to edit Master title styleClick to edit Master text styles7/29/2010‹#›/9j/4AAQSkZJRgABAQEAeAB4AAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB +AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEB +AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCADAAQADASIA +AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA +AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 +ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm +p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA +AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx +BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK +U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 +uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/iii +igAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKK +ACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooA +KKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAo +oooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACii +igAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACivjj9tb9prxv8A +sw+B/hRqvw2+FnhX4vePvjL+0R8Jf2dvCXhfxx8U9X+DfhCz1z4s6lf6bY+IfEfjnQfhR8atasNJ +0eWyEl3b6Z8PNavLmOU+SqNGFk4z9mX9tq6+KKftcaH+0P4F8Cfs6eMf2JfH0Hg74563o3xoj+J/ +7P1npF98JfCnxst/GWg/HHxV8PfghcDStC8CeLbO4+IVn41+HPge+8BX9pdLqS3WkS2OtXc0ZwxE +MdUpSThlrxKxs5v2MKLwdPIauKtOryRqrD0+J8inVdF1FCOYQbf7rEexdROnVwtGUZSrY2OHnhqV +OLrVJwxdTN6OGlKFJTlSjXrZDm1Km6ypqVTCci96vhlW++qK+ePCf7Xf7J/j34R+Kvj/AOBv2n/2 +ePGfwH8Cy6nD43+NnhP41fDbxF8I/B02i2tle6xD4q+JGj+Jbzwb4el0my1LTrvU49X1mzewtb+y +uLoRRXUDyedeH/2zvh98Tvif+znoP7PniT4G/tAfBb476T8d7i8+O/w3/ab+D+t2Hh7XvgxbeEZI +PDvgrwNo+raxrnxok1m71/WLLxdqHgG+lt/hMdAt5/GscSeItMVb5Ze19g4yVX2Sryg04uFGVGpi +Kdaq2lGlSrU6Ulh6lVwhiarp4ehKpXrUac5UouMZqUeSdSpRhLmjyzrUb+2pQd7Tq0rN1Kcbzgk3 +KKSdvsyivDPAP7T/AOzT8VviP47+Dvwu/aH+BnxJ+Lvwtl1K3+Jvws8A/FrwD4x+I/w6n0fWF8Pa +vD478D+HfEGo+JvCMula+y6HqUfiDS9Pex1hl0y6WK9IgPxNoH7e+l/FH/gph43/AGK/hv8AtHfs +j6LpHwM+HvgfW/iJ8Ldbx46/aO+Lnj7xYnxYu/GHgz4Z3Gj/AB38EWXw5f4G6H4N8EeIviKmpfCX +4zak1r40+x6taeAljsdTvFTtUnhowaccVRrYqlUTTg8Hh6VSpWxkeVudXC03T9nOrh4VlCc4OajT +U6kCq1Rp4upUai8HVoYetTl7tRYvE16GHw+D5ZWUMVVniISjSqyp2pKdWTjCDkfqZRXg/wAG/wBq +f9mL9oq98Zab+z7+0b8B/jrqPw6nsbX4g2Hwb+L3w++J174EutTl1SDTbbxla+CfEOuT+GJ9Qn0P +WobGHW47GS7l0fVI7dZH0+7WHzGP/goT+w5qfwo+Mfxs8Hftcfs1fEj4b/ALRl1n4t+Jvhv8e/hD +4w0jwKLpLxdE0vxTrOl+NZNB8Max4pvrGfSPC9l4m1XRv7b1gDT7SVpg+zKtWpYejWxNaap0MPhF +j61R3caeClFShi5WTf1ealH2dVJwqc0VBycop7U6NWrWjh6dOUq08XTwEadrS+u1r+ywjTty4idp +ONKVptRlLltFtfY1FfJH7MP7dP7K37Xvw2+EnxK+CXxr+GfiWH4zaBJq/hbwZbfEj4c6x8QLLV9L +8LeHPF/jXwFrnh3wl4u8TJb/ABC+GOk+LNA/4Wb4W06/1S68Fz6laf2tLHbXllc3PYeMv2u/2Tvh +1oGpeK/iD+0/+zx4F8LaNrHjLw9q/iXxl8avht4Y0DStf+HPibSvBfxC0PUtY1vxLY6dY6x4E8Y6 +5onhPxlpl1cxXvhjxNrGlaDrcFjqmoWlrN0YmnPCVqmHxKVGtS5vaU5yinFQqU6Up3vaVP2tajBV +It05Sq0lGT9pDm58NUjjKVGthW69PEThToypxlL2lWpGpOFGKtze2lGjWfsWlVXsaqcE6c1H6Hor +588Z/ta/sqfDjxt8Ovhr8Q/2mv2fPAXxG+MEWhT/AAk8AeM/jP8ADjwv42+KUHijU00TwzN8OvCu +ueJLHXfG8XiLWZE0jQpPDNhqaavqbpYae1xdMIjc139qX9mPwv8AGXQf2c/Ev7RnwI8O/tCeKra1 +vPC/wI134vfD/SfjL4ktL62vryyutB+F9/4ht/G+sW15aaXqd1az6fodxFcW2nX08TPFaXDRrlk3 +TioycquJq4OlGzvUxdBtV8LTW88TRaaq0I3q02mpxjYrmjyynzLlhQp4qcrrlhhayUqOJk9o0KsW +nTrNqnNNOMmmj3eiiipGFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAfl//AMFX +fgD4p/aH+CfwO8O6D+zh/wANZ+H/AAN+2D+z78WPin8BN3wTl/4T74TeBdY1i78b6X/ZH7Q3jr4c +fCbxJ5tldQxf8I54p8Wafa6r5vlEOiyFPh7QP2S/2n/A/wALv27PEX7JX7Iej/sf+Afi5qv7Kd38 +Cv2Hddg/ZO8Q6r4P8XfCnxOLv9or9on4WfCrQPiL8S/2FPhf8ZvG3hCXwe/wQ0DV/Hlz8PdX+L/w +V8LfE742WGjXWtakt1/RDRWeHp/VqWYUqU5xWZY+WYV5pqFWNaeH4cw0qUKlKNOc8M6fDGXzjh8Q +68KdepicRTUK7w1TDOq1Wr4PETjGUsHhMPgqcGuanKjhcfm2ZUpNT5pUK0sRnGJhXrYOeGqYnCU6 +WBxEquDni6GK/nT8Dfsa/HbX/hz/AMFBdc/aX+Cf7bfxXuP2jfiJ+yh8Q/hbb2/xI/4JveE/2418 +VfA/R9BsPDnxCv8AUfgt4j+Av7FmgeMvgr468GeGPGHh/Tdb8S+N9C8QeDdB8NWfiG4+JN5c658O +dN91+E3wT/bx+I3xc/Yj+Kf7ROh+KrW4+E7/APBQXw7rHjPxzrH7O1v8bfB/w4+KemeD/D/7Ot/8 +bNH/AGfdaX4I6x8YdXsNEvZPEDfs76ZqPw70yGz0iTUE0rUZ9R8z9t6KVWjSrU8VQnBLD4qjKjLD +05SpUqPPl+HyypXw8aUoOji6uDw1KjVxcW8TOnGnRdT2GHwtKgoOdN4OUak/aYOvOvCpPlqTrc1X +EV40MR7SM41cJSq1+ejhXFUKUqcZQgpVMTKv+Tv/AATW8AfGv4J/Cv4A/stfF/8AYvvfh/qH7K/w +n8T/AA5vP2qb/wAcfADxD4D+KGu2mvaTpd54x+CWn+C/Hvi/45of2hhZzfFr4j/8La+HnwPvNK1c +iw1W38Va2YvIw/jN+xv8dfi98R/+CuFhoLWnw/0f9sP9jD4K/Ar4I/E/UNesTpz+PNG8A/tG+GPE +kupad4dv9Q8Z6DpvhrUPiF4VOoaheaBB9us9Rnl8Pxa49je28X6/UVpmKeaUsZDFyvPMKOMpYytS +hTozrSx0a0a9dU6cI4WjUaryUIUMPSw0FGCjh0lJSvCVJYGvh6+GfI8JisFi8LTk3VhQlgMRhsTh +6UZVHOtVpKrhYObxFWtWmp1FKtrFw/nT+Cv7K/7WEmleJNf174V/tj3fx9+Gf7A/xi/Zz+COi/tt +z/8ABIXVf2GrzUvGOk/D2GL4QyaH+wTpXgz44+Ovh3feI/AmgDwnB8YPA+ieE7HwLYeIv7X0rwj4 +i8RPpF71n7Kf7K/7Zuu/G341/FL46aR+0JbQ/EH/AIJ+f8MxaF4h/a31L/gnppvjvTfiFZeL9c1r ++wNK8Nf8E7fC8Pg7Sfg1GPFdzqng698TeI/iB4vtp/8AhK7O+svCsUejQ+K/6AKKWNhHMHiHibz+ +s5fmmXzV3ywWc4Ti3CZjjKMXdUsfiY8Z5xVrYiKtWrrC1MRTq+zrRxEYb/ZKGDoYZ+xhgsZgcXRc +N2stxnC+OwWFqXvGeDw9XhLK40qDj+7pzxUacoynRlh/59vhV8NP2yPh38Of+CTHxQ1T9hz4zan4 +z/Yb+E/jj9mj42/AXRvit+x9J8S9Yi8Tfs7/AA98GWvxl+FXiHU/2ltL+DPij4aw+OPh6NEfS/F/ +xU+HfxSbTtbh10/DqOKxnspan7J37E37Tlj8f/2XPjD8fP2e/DfhA+BP2tv+Ct3x98U2R8f/AA2+ +JVp8MB+1V43ttZ+Ces+Hdatb201XWL/X9FvtasbfVtB8NWGv6JaTXsHirSvC/wDaDWcn9ClFdFav +OvmuNzmpyvGY2nj6c7JxpUXmeYZfmuOq0IxalGrXzHLqWLUqk6saE6tanh40aHsaVHGlQp0MtweU +0E6WBwVfC1qdJNzlU+p5fnOU4ajWnV9pKdGnlud4nCSgnF1oUcNPESq1vrNTE/zf/tTfsN/tLat+ +0R+30tzpX7efxK/Z2/brX4bXGoad+xFq/wDwSbt7NfCmgfBbw98INe+Hnxal/wCCh+iaH8ZPDPiD +w7qfhzU/FXw+1r4IfELVPCdhY+M31nR7TwH8Q7LWL3W/q2z+EP7Rnwy/b2h8V/szfCn9qXwT8Nfi +r8RfAN/+2B4t+L/jn9jTxR+yF8YfDXg74Jy+Crj4q+ENF0/4n+Mf23/C37Qi2Oh/DTwBpNv4d8Mf +Db4O63qXg59Y8beC7/T5JvFus/snRWWFbwkcHCD9osHSo4ZOrrPE4LDLCxwuX42pDkqYrA4eGDoK +OHqScatSEMTiPb4ujh8RR3xTeKVVSbpurCuoujaH1etilTVfF4WLUqeHxdWVKE5V6cE3aVK31epU +ozKKKKQgooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoooo +AKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAGSErHI +wOCqOQfQhSQeeOvrX5u6X+0B8Wb34MaPocvipV+Mtjo+m/EbxD4qGkeF2uLr4VXeiaL4wsPEC6AN +GXw/bprOqeJdJ+FLCPS4ZpJ9P8T63pnl3mlSy2/6SkAgggEEYIPIIPUEdwa5RPAfgeNXRPBvhREk +8Paf4RdE8O6Qqv4U0mWefSvDDqLMBvD2mT3NzNp+ikHTbOW4nktraN5ZCxT92pOUvfjL6s4Re1Oe +GliaymltL2tZ4WlWpzcqFfCLEUq9GpJ0JUifvU3Be7JuXvLRuM4Sozi5bxUadWpVpyjacMTSw84z +goyb87+G3xl/4WJ4l1jwqvhmXR9V8I6dfv45SXU/taeHdfj8Z+IvCWj6FATptm+prrlt4S13xPb6 +g6acY9Bm8OXiWVzD4hhmteZ8K/HrW9V8cL4H8U+BLLwhqVz451LwrY2M/iLxFNrqaPa+GfHniXS/ +FF/Y6z8O/DOh3ll4gh8DzW+mTeCPFHjnw7JLLqsI8VPqHh2+06X2Xwv4I0bwlqXjXV9NNzNqPj7x +QfFniC6uzaGSTUE0PRvDlpbW5tbS0CWFhpGg6fbWsU4uLgFZpp7qeWd3POy/A34KTaXrGiTfB/4W +y6L4i1iLxF4g0iX4f+E5NL13xBAZzDrmsae2kG01PWITc3Ji1O9hnvYzcTlJwZZN02l7OkrrneDg +qsmruGNqzoVarSVozp4WMsVhqKXKq1OnQdVyqzqYlN2c6tm4x+sydFWUrYWnTq04KV2nKdecaFep +L924ynV5I04Rhh38/WP7R/jKfV7HxRB4X0G++HWr+Bf2ePEWq2t743ttM1bwlcfGTxR4i8ORv4Yh +h8G3h8d3MtydL+1W+taz4Ns1g02H+wpbvUNSu7KLd8HfFz4qeJINAuPEPh7wto+rX/xe+NXgHRNL +8K+M7m48Pa9b/Dqz+J1tp8XjG61/4ZXWt6bANS8GQW7XvhWWG7vJVg8TSQWtlLdfD5vdW+EvwrbV +/Dmvt8M/h82veD7Oy07wjrbeDPDh1fwtp+mrImnWPhzUjppvNEs9PSWVbK20ya1htVlkWBIw7A7F +h4G8E6Vqd5rWl+D/AAtpus6jrU/iTUNWsPD+k2ep33iK506bSLnXry/t7SO6udauNJuLjS59Unle ++l06eaykna2leJnUXPDERhKVOVRYpUZ6TlRVSph3hXvBSlShGvzNr7cYS9rdVaabfuWitKuHqTjd +8sqcKGKp4ije3ParWq0Kimpx/he7Ck4rn+T/AA7+0T47h8CeBvib4/0PSLaPVv2dvFXxV1Twj4Fn +1TXrLVNSt9U+GyeHrm0uLvw0niXTZZrXxLfxXeh2cXiGPSxeyIl54qmsbW8l9/8Ag58R9Z+Jnhq/ +1fX/AARrHgXVNM1u40efT9S0rx7pljqKR2Wn6hDqvh9/iV8PPhX4t1DS3i1FbCe71DwNo0aa1p+r +WVm2o2dpBqd51Gl/Dr4faJZzadovgTwbpGn3FtrllcWOl+GNEsLOez8T3MN54ltJrW0sYoJbbxDe +W9vd65A6NFq1zBDPfpcSxI62vCPgfwX8P9JbQfAfhDwv4J0Nrua/bRvCPh/SfDektfXCRR3F62na +NaWVmbudIIEmuDD50qQxK7sI0A0Uovm5oKKdGpyRi+bkr1cxxOKbc7RlUjSwlalhISklFqknDD0I +KnCnMk73jJ2ddt81taEcNSpQiklyxlKtCVaUY2tzvmq1Zc0pdRRRRUFBRRRQAUUUUAFFFFABRRRQ +AUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAB +RRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFF +FFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUU +UAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQ +AUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH/9kCAAAAAJEDLAIAAAAAlQMvAgAAAACZ +AzECAAAAAJ0DMwIAAAAAoQM2AgAAAACkAzgCAAAAAKgDOgIAAAAArAM9AgAAAACwAz8CAAAAALQD +QgIAAAAAuANEAgAAAAC8A0YCAAAAAMADSQIAAAAAxANLAgAAAADIA00CAAAAAMsDUAIAAAAAzwNS +AgAAAADTA1UCAAAAANcDVwIAAAAA2wNZAgAAAADfA1wCAAAAAOMDXgIAAAAAMy handout master7/29/2010‹#›7/29/2010Click to edit Master text stylesSecond levelThird levelFourth levelFifth level‹#›iVBORw0KGgoAAAANSUhEUgAAAEEAAABOCAIAAADww+zHAAAAAXNSR0IArs4c6QAACi5JREFUaEPt +Wk2MHEcVrur5252d2fF6bSAQTOIEELEQhBywgPB7QEKRkTgE+ZRjFFkWUWzWBgkBEhzsIEsQK0FI +wA0RcQkIaWOELASJAxdQQESLbJNDYplkY2Lvxrs7O/3D996rqq7umemdHWaisbTt51J1T3XP+977 +3k/1rFYP31C3+BHc4vqT+jsYJsOJO36YDD9o9fBbk6HJ8FpodWRj+Lsn404dPBpNhibDa6Grx+Lh +756MO3VtIZkMTYbXQtdP3voY1JFbPx70l14e3ouTcad+47WlydBkeC12eo3hbTfKO3f8MEprDv+s +HT8Mb7tR3jn23BrFUWejHcVhkoyrIdDf/um5Edrk6APvyz1tY20tCIKzv1361R8vXrwylncoeoTm ++c7PfteNYe3m6o8XL1/8z+aRr3zyMx/dP0J7uUcVYbj6ZrS8otsb4WYn7kQa98RxAm7ESSDI4ziI +kziMkw/fWbnrtmo/DF/4xrM/OXF4TAC2eDcDALvqetdsBbJ7F8l8q7KnNb17tjY3W4XgeqtRa05X +L7+y2c/AQAsKffojdyRJzEc0cinKrfBAO1T40ijSUUdBNkPdiZJOmEQdXNFRpELuenWJvNTz0Jo+ +iughov3ojyIMoBCkHekQerPQESXtjlrraEgbMGJSMVBb5JyR295/4NtU46wHtkGkqal6Dnn3FVlQ +hAFxHIaggYKxkxh8JlGaT/lAQPM4iCHgqO0KHJy7pfsKLSj6es5CivVMvv/4aR1oyOoG5aJEJU+c +PRUrjQlkgIwpqLdx4Jn1+qy7AXNC0Oso9kOCkEVAf+/UKdyPcaOTVCsx0uzZs6dx5UmGQUmWx4KD +c/E2ALiq5e6Rh7vTmZmWCK4MQgP1rRMn5RE/OEOqP/UEjTgeObowgAcy3z04Dty2uvpmo7ELt2DE +3GGQUxHMizAYynMyPP6YUVdgOACJTpBdndn6Q9puMAg/e47uojyz8PcHxG6UGCkH+uTxE07FRx9b +qFXMGeIh3Oo92+Dm98mD+crKtWZzN0Yxk3zqk2orDAlSEApYKgvHiVRHj524GSpIqFlitWVqosDf +prCiJAUT+bSIS0isHNMswEMJKPk6e6NS1hCkKYAEzAFS09BcSm7ceMMmWWEXXWm15kUwHyimBwzc +gmVDcOn69eXcXf4VzEW2zkvwAwTrwo4S6aBowOyu5HEzSwWj8GBt2GFjkOIaR/0elEaT5zo1ECzZ +TIhmmOB6KDV8CwxhxxyYhJ1wtFK0f7j0avvSK230pNorYfBBJymJ0SnkuIp/aF/5A7dP99w/rN98 +676v/ebpbz5w17saKPB4lHSyIzzGvo9rb6x/9xcvvvr66uH777xv/9wIVXePGvt+OorCUqn8w2f+ +/svz/xrXfnrc74yRgINSpVyeKpWrlIxByxFTSY393cw4yJN75ttUH8aKZAfDWM078MN3/DCwqca6 +cEx+GDB9yjIZB9mU9zbF/51b8aJD3i7Rf/2PxcbVf1avXa6uLZeTtr761+myUuhMMLqJnGLcc6A9 +NRtNt+K5ezZad3dqe8O5T6wBEL07kXZ+MFMMh4Efj3+Jeu7p1tKF6Zf/Nr387yopqlldjDLpJdDe +wTDAEl6JMVGN2zutj63PHVzf+9B1scuWLtouBnrin56ZfemF6aUX6q9fruIlZTnwlNasXyGGHDBa +n6gSRCZAmKgK8MRqem/YPLjWOLjefOg6fXEfz2wDw/OLzT/8uvHnc81oU1cCVdGqqpVMINA7o73n +B8elvm5xALwJuSUmPDKZ+ezN5qHVqa+uaOr1MywrwmBh68cX3vH8ucbKcplMLsJKi+q5OV4VmI88 +IvWEkV5kRcUPxifiGe8UMOjTSlI/tFI7tBp8fo1eazGWAgz6wvn6z5/c/eJf6k5dMnkvAAQDDhHt +LZcw8VXPwch8JMZmFtHI5neSomIYxjP3tGuP/Lf05RUQrCcG/fvFxlNn5i++VCuXVImVdoQRDOIB +RyQ6tRgkmumKl4ty81ymyjgBd1kKkbpdc+ecSqwqt3XUsWseBgDS6tnF5o/OzF9i7UldaOaUZur7 +ABw24xxR3aWmbErtl2RT8/vesK4geNb8hl32I8LA4vtBP3j4PefPz1RLqhoojNAsnYsrbAT7oWyc +4GVVQ6f+lSFfLvxQFkb5GPjUsEiiQoBhDY+BpODTZ+b33f3+5y7MVCqqXEbo0OjPS2UVQEr4ycdQ +BJvquKQyI6uGBRojrzd3yb1ZkQUYsQYCt9M38qSCOYub0BqwumRuoW8RM8BaFaWvvbZ07/37r1yp +INND0HvEoTE/HpE6hEnluJTxgxflEgYSPBBXy/JFzS9zQiGvzJlo9iLY0cklXOcHLNalPfTuWyqL +TOKOJRKUZhhCqh5xLKGcS694yFbVmsgm7pQ8IxNX7Fxi7cMoA4AZBdG19yakvQCQSUIwjN7QnpHQ +qQS3V9T88KB6x57M9Bq9slOm0tnC7JB0897Ps6mLOBIkbHR9v8EAM0B7WSQYRG8BIJB6JlmJ9RSD +hWHKdmGly7UYJvfbXGQqg08qa/s07uGH5geZS2x+MzKYeJOjgrlUs4HRnVhdnTaTrkrnW727Whul +XaeUrW5pnfbSqzO/yUttpecO0Fu7DJesQ/CDtMutEtxEJ7/GZSudYZpXp6VW9KzW5qIrz7ZCu0qc +LwviAUm7lkXlNsI30nvuNRhSV1i3UHDbsHZg8t2RX8UlvntVup5bCFfdjN5eZcixKO07BICrD/jz +BGB458fx1xdpNLuoEIKZ4M6WvO5iZzjmcpTXOPlZtXsblGmTJEdlmws/xJ32ZhkDQCnQ7/4UYSAY +Xkyb4MYajgoX3MKofAx47VPafdgq0UPvbHGQtG58gp2DVOKuwHAsIp+IK4hI9LcYet/nUj/4MW2C +pE+eNVUsm2cdzcynDINUzG5EM56xpQ2bngxhXH/q3CKoLJFK4gT8oAkMd3zR5labmlxgiIXSPGuT +rKRav5Pt3kikidWWCKlrPiQpanS957YhW6czAACGMJATMOJ9rspJwFeCqsIEUq3zXxOgNcLeX4Tb +pJxggd8jSRdEz8k2TtQasaA1ou6IGyFpnKS/kk6JuiPbX1H3habIa7fgDRVEqmSEMBiloTr0rtqR +r9NpRdUsDPRz5pvk67k7NOra7s1pL0rIaXfP566IfjkxnwoYoEL2E2yYAABpH7pRH3gww6VcpSNe +WUa5EkFNlGufvO2oK3NuN+d2Qj3eA0j9tt0efW+f7VuaSSXWbTqy8eBxSbxh3MJEEkbJFXIFmu2A ++23QSdMpEYxFwta4m2ngzN/tBJ8VzvxkeDjEimGgs714AyO2CpZCqixcitN4KDOLjDgwPKHtRG5H +waeG3ALecYnnPot8GDkAEgkpeLtzoFs4wMg0kg1cryupV7zDeAJa7YW1UZeVdnsg8Y9EhQgcQoFu +Nz0CJhMY2Wju5w3SviseZLNlDCQe4Fg3TjBvODijMVn/B0u5lQ9JVbacAAAAAElFTkSuQmCCMy titleJason Harropjharrop272010-01-19T01:06:55Z2010-07-28T17:42:47Z8500115Microsoft Office PowerPointOn-screen Show (4:3)244400falseTheme1Slide Titles4Office ThemeBasic featuresBasic slideSVG in HTML output - statusSlide 4Plutext Pty Ltdfalsefalsefalse12.0000 \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/AsposeEditExistingCharts/AsposeChart.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/AsposeEditExistingCharts/AsposeChart.pptx new file mode 100644 index 00000000..8188dc9b Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/AsposeEditExistingCharts/AsposeChart.pptx differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/Pptx4jEditExistingCharts/pptx-chart.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/Pptx4jEditExistingCharts/pptx-chart.pptx new file mode 100644 index 00000000..fd3cc56e Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/editexistingcharts/Pptx4jEditExistingCharts/pptx-chart.pptx differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/openexisting/AsposeOpenExistingPresentations/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/openexisting/AsposeOpenExistingPresentations/presentation.pptx new file mode 100644 index 00000000..904f23ac Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/openexisting/AsposeOpenExistingPresentations/presentation.pptx differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/openexisting/Pptx4jOpenExistingPresentations/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/openexisting/Pptx4jOpenExistingPresentations/presentation.pptx new file mode 100644 index 00000000..904f23ac Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/presentations/openexisting/Pptx4jOpenExistingPresentations/presentation.pptx differ diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/Pptx4jAddImageToSlide/greentick.png b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/AsposeAddImageToSlide/greentick.png similarity index 100% rename from Plugins/Aspose_Slides_Java_for_Pptx4j/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/Pptx4jAddImageToSlide/greentick.png rename to Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/AsposeAddImageToSlide/greentick.png diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/Pptx4jAddImageToSlide/greentick.png b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/Pptx4jAddImageToSlide/greentick.png new file mode 100644 index 00000000..61f40327 Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/addimagetoslide/Pptx4jAddImageToSlide/greentick.png differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/removeslide/AsposeRemoveSlide/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/removeslide/AsposeRemoveSlide/presentation.pptx new file mode 100644 index 00000000..904f23ac Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/removeslide/AsposeRemoveSlide/presentation.pptx differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/removeslide/Pptx4jRemoveSlide/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/removeslide/Pptx4jRemoveSlide/presentation.pptx new file mode 100644 index 00000000..904f23ac Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/removeslide/Pptx4jRemoveSlide/presentation.pptx differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/traverseslide/AsposeTraverseSlides/presentation.pptx b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/traverseslide/AsposeTraverseSlides/presentation.pptx new file mode 100644 index 00000000..904f23ac Binary files /dev/null and b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/traverseslide/AsposeTraverseSlides/presentation.pptx differ diff --git a/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/traverseslide/Pptx4jTraverseSlides/pptx-basic.xml b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/traverseslide/Pptx4jTraverseSlides/pptx-basic.xml new file mode 100644 index 00000000..023bd3ef --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/Maven/src/main/resources/com/aspose/slides/examples/featurescomparison/slides/traverseslide/Pptx4jTraverseSlides/pptx-basic.xml @@ -0,0 +1,156 @@ + + +Basic featuresMy subtitleSVG in HTML output - statusXSLT framework works (ie slides render), but need to flesh out support for various shapesText boxes should be positioned correctly (21/1)Style resolution is working, but only implemented for some properties (21/1)TODO: bulletsUnderline, italics etcNot done yet: Border and shadingLines (done)Images (done 28/7/2010)My text boxMy text box with borderMy text box, with some run level formatting. Italics, bold, underline. Larger.Basic slideBullet 1Level 2Bullet 2432Added a note.1Click to edit Master title styleClick to edit Master text stylesClick to edit Master text stylesSecond levelThird levelFourth levelFifth levelClick to edit Master text stylesClick to edit Master text stylesSecond levelThird levelFourth levelFifth level7/29/2010‹#›Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth levelClick to edit Master text stylesSecond levelThird levelFourth levelFifth level7/29/2010‹#›Click to edit Master title styleClick to edit Master text styles7/29/2010‹#›Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth level7/29/2010‹#›Click to edit Master title styleClick to edit Master subtitle style7/29/2010‹#›Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth level7/29/2010‹#›Click to edit Master title style7/29/2010‹#›7/29/2010‹#›Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth levelClick to edit Master text styles7/29/2010‹#›Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth level7/29/2010‹#›Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth level7/29/2010‹#›Click to edit Master title styleClick to edit Master text styles7/29/2010‹#›/9j/4AAQSkZJRgABAQEAeAB4AAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB +AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEB +AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCADAAQADASIA +AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA +AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 +ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm +p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA +AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx +BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK +U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 +uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/iii +igAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKK +ACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooA +KKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAo +oooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACii +igAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACivjj9tb9prxv8A +sw+B/hRqvw2+FnhX4vePvjL+0R8Jf2dvCXhfxx8U9X+DfhCz1z4s6lf6bY+IfEfjnQfhR8atasNJ +0eWyEl3b6Z8PNavLmOU+SqNGFk4z9mX9tq6+KKftcaH+0P4F8Cfs6eMf2JfH0Hg74563o3xoj+J/ +7P1npF98JfCnxst/GWg/HHxV8PfghcDStC8CeLbO4+IVn41+HPge+8BX9pdLqS3WkS2OtXc0ZwxE +MdUpSThlrxKxs5v2MKLwdPIauKtOryRqrD0+J8inVdF1FCOYQbf7rEexdROnVwtGUZSrY2OHnhqV +OLrVJwxdTN6OGlKFJTlSjXrZDm1Km6ypqVTCci96vhlW++qK+ePCf7Xf7J/j34R+Kvj/AOBv2n/2 +ePGfwH8Cy6nD43+NnhP41fDbxF8I/B02i2tle6xD4q+JGj+Jbzwb4el0my1LTrvU49X1mzewtb+y +uLoRRXUDyedeH/2zvh98Tvif+znoP7PniT4G/tAfBb476T8d7i8+O/w3/ab+D+t2Hh7XvgxbeEZI +PDvgrwNo+raxrnxok1m71/WLLxdqHgG+lt/hMdAt5/GscSeItMVb5Ze19g4yVX2Sryg04uFGVGpi +Kdaq2lGlSrU6Ulh6lVwhiarp4ehKpXrUac5UouMZqUeSdSpRhLmjyzrUb+2pQd7Tq0rN1Kcbzgk3 +KKSdvsyivDPAP7T/AOzT8VviP47+Dvwu/aH+BnxJ+Lvwtl1K3+Jvws8A/FrwD4x+I/w6n0fWF8Pa +vD478D+HfEGo+JvCMula+y6HqUfiDS9Pex1hl0y6WK9IgPxNoH7e+l/FH/gph43/AGK/hv8AtHfs +j6LpHwM+HvgfW/iJ8Ldbx46/aO+Lnj7xYnxYu/GHgz4Z3Gj/AB38EWXw5f4G6H4N8EeIviKmpfCX +4zak1r40+x6taeAljsdTvFTtUnhowaccVRrYqlUTTg8Hh6VSpWxkeVudXC03T9nOrh4VlCc4OajT +U6kCq1Rp4upUai8HVoYetTl7tRYvE16GHw+D5ZWUMVVniISjSqyp2pKdWTjCDkfqZRXg/wAG/wBq +f9mL9oq98Zab+z7+0b8B/jrqPw6nsbX4g2Hwb+L3w++J174EutTl1SDTbbxla+CfEOuT+GJ9Qn0P +WobGHW47GS7l0fVI7dZH0+7WHzGP/goT+w5qfwo+Mfxs8Hftcfs1fEj4b/ALRl1n4t+Jvhv8e/hD +4w0jwKLpLxdE0vxTrOl+NZNB8Max4pvrGfSPC9l4m1XRv7b1gDT7SVpg+zKtWpYejWxNaap0MPhF +j61R3caeClFShi5WTf1ealH2dVJwqc0VBycop7U6NWrWjh6dOUq08XTwEadrS+u1r+ywjTty4idp +ONKVptRlLltFtfY1FfJH7MP7dP7K37Xvw2+EnxK+CXxr+GfiWH4zaBJq/hbwZbfEj4c6x8QLLV9L +8LeHPF/jXwFrnh3wl4u8TJb/ABC+GOk+LNA/4Wb4W06/1S68Fz6laf2tLHbXllc3PYeMv2u/2Tvh +1oGpeK/iD+0/+zx4F8LaNrHjLw9q/iXxl8avht4Y0DStf+HPibSvBfxC0PUtY1vxLY6dY6x4E8Y6 +5onhPxlpl1cxXvhjxNrGlaDrcFjqmoWlrN0YmnPCVqmHxKVGtS5vaU5yinFQqU6Up3vaVP2tajBV +It05Sq0lGT9pDm58NUjjKVGthW69PEThToypxlL2lWpGpOFGKtze2lGjWfsWlVXsaqcE6c1H6Hor +588Z/ta/sqfDjxt8Ovhr8Q/2mv2fPAXxG+MEWhT/AAk8AeM/jP8ADjwv42+KUHijU00TwzN8OvCu +ueJLHXfG8XiLWZE0jQpPDNhqaavqbpYae1xdMIjc139qX9mPwv8AGXQf2c/Ev7RnwI8O/tCeKra1 +vPC/wI134vfD/SfjL4ktL62vryyutB+F9/4ht/G+sW15aaXqd1az6fodxFcW2nX08TPFaXDRrlk3 +TioycquJq4OlGzvUxdBtV8LTW88TRaaq0I3q02mpxjYrmjyynzLlhQp4qcrrlhhayUqOJk9o0KsW +nTrNqnNNOMmmj3eiiipGFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAfl//AMFX +fgD4p/aH+CfwO8O6D+zh/wANZ+H/AAN+2D+z78WPin8BN3wTl/4T74TeBdY1i78b6X/ZH7Q3jr4c +fCbxJ5tldQxf8I54p8Wafa6r5vlEOiyFPh7QP2S/2n/A/wALv27PEX7JX7Iej/sf+Afi5qv7Kd38 +Cv2Hddg/ZO8Q6r4P8XfCnxOLv9or9on4WfCrQPiL8S/2FPhf8ZvG3hCXwe/wQ0DV/Hlz8PdX+L/w +V8LfE742WGjXWtakt1/RDRWeHp/VqWYUqU5xWZY+WYV5pqFWNaeH4cw0qUKlKNOc8M6fDGXzjh8Q +68KdepicRTUK7w1TDOq1Wr4PETjGUsHhMPgqcGuanKjhcfm2ZUpNT5pUK0sRnGJhXrYOeGqYnCU6 +WBxEquDni6GK/nT8Dfsa/HbX/hz/AMFBdc/aX+Cf7bfxXuP2jfiJ+yh8Q/hbb2/xI/4JveE/2418 +VfA/R9BsPDnxCv8AUfgt4j+Av7FmgeMvgr468GeGPGHh/Tdb8S+N9C8QeDdB8NWfiG4+JN5c658O +dN91+E3wT/bx+I3xc/Yj+Kf7ROh+KrW4+E7/APBQXw7rHjPxzrH7O1v8bfB/w4+KemeD/D/7Ot/8 +bNH/AGfdaX4I6x8YdXsNEvZPEDfs76ZqPw70yGz0iTUE0rUZ9R8z9t6KVWjSrU8VQnBLD4qjKjLD +05SpUqPPl+HyypXw8aUoOji6uDw1KjVxcW8TOnGnRdT2GHwtKgoOdN4OUak/aYOvOvCpPlqTrc1X +EV40MR7SM41cJSq1+ejhXFUKUqcZQgpVMTKv+Tv/AATW8AfGv4J/Cv4A/stfF/8AYvvfh/qH7K/w +n8T/AA5vP2qb/wAcfADxD4D+KGu2mvaTpd54x+CWn+C/Hvi/45of2hhZzfFr4j/8La+HnwPvNK1c +iw1W38Va2YvIw/jN+xv8dfi98R/+CuFhoLWnw/0f9sP9jD4K/Ar4I/E/UNesTpz+PNG8A/tG+GPE +kupad4dv9Q8Z6DpvhrUPiF4VOoaheaBB9us9Rnl8Pxa49je28X6/UVpmKeaUsZDFyvPMKOMpYytS +hTozrSx0a0a9dU6cI4WjUaryUIUMPSw0FGCjh0lJSvCVJYGvh6+GfI8JisFi8LTk3VhQlgMRhsTh +6UZVHOtVpKrhYObxFWtWmp1FKtrFw/nT+Cv7K/7WEmleJNf174V/tj3fx9+Gf7A/xi/Zz+COi/tt +z/8ABIXVf2GrzUvGOk/D2GL4QyaH+wTpXgz44+Ovh3feI/AmgDwnB8YPA+ieE7HwLYeIv7X0rwj4 +i8RPpF71n7Kf7K/7Zuu/G341/FL46aR+0JbQ/EH/AIJ+f8MxaF4h/a31L/gnppvjvTfiFZeL9c1r ++wNK8Nf8E7fC8Pg7Sfg1GPFdzqng698TeI/iB4vtp/8AhK7O+svCsUejQ+K/6AKKWNhHMHiHibz+ +s5fmmXzV3ywWc4Ti3CZjjKMXdUsfiY8Z5xVrYiKtWrrC1MRTq+zrRxEYb/ZKGDoYZ+xhgsZgcXRc +N2stxnC+OwWFqXvGeDw9XhLK40qDj+7pzxUacoynRlh/59vhV8NP2yPh38Of+CTHxQ1T9hz4zan4 +z/Yb+E/jj9mj42/AXRvit+x9J8S9Yi8Tfs7/AA98GWvxl+FXiHU/2ltL+DPij4aw+OPh6NEfS/F/ +xU+HfxSbTtbh10/DqOKxnspan7J37E37Tlj8f/2XPjD8fP2e/DfhA+BP2tv+Ct3x98U2R8f/AA2+ +JVp8MB+1V43ttZ+Ces+Hdatb201XWL/X9FvtasbfVtB8NWGv6JaTXsHirSvC/wDaDWcn9ClFdFav +OvmuNzmpyvGY2nj6c7JxpUXmeYZfmuOq0IxalGrXzHLqWLUqk6saE6tanh40aHsaVHGlQp0MtweU +0E6WBwVfC1qdJNzlU+p5fnOU4ajWnV9pKdGnlud4nCSgnF1oUcNPESq1vrNTE/zf/tTfsN/tLat+ +0R+30tzpX7efxK/Z2/brX4bXGoad+xFq/wDwSbt7NfCmgfBbw98INe+Hnxal/wCCh+iaH8ZPDPiD +w7qfhzU/FXw+1r4IfELVPCdhY+M31nR7TwH8Q7LWL3W/q2z+EP7Rnwy/b2h8V/szfCn9qXwT8Nfi +r8RfAN/+2B4t+L/jn9jTxR+yF8YfDXg74Jy+Crj4q+ENF0/4n+Mf23/C37Qi2Oh/DTwBpNv4d8Mf +Db4O63qXg59Y8beC7/T5JvFus/snRWWFbwkcHCD9osHSo4ZOrrPE4LDLCxwuX42pDkqYrA4eGDoK +OHqScatSEMTiPb4ujh8RR3xTeKVVSbpurCuoujaH1etilTVfF4WLUqeHxdWVKE5V6cE3aVK31epU +ozKKKKQgooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoooo +AKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAGSErHI +wOCqOQfQhSQeeOvrX5u6X+0B8Wb34MaPocvipV+Mtjo+m/EbxD4qGkeF2uLr4VXeiaL4wsPEC6AN +GXw/bprOqeJdJ+FLCPS4ZpJ9P8T63pnl3mlSy2/6SkAgggEEYIPIIPUEdwa5RPAfgeNXRPBvhREk +8Paf4RdE8O6Qqv4U0mWefSvDDqLMBvD2mT3NzNp+ikHTbOW4nktraN5ZCxT92pOUvfjL6s4Re1Oe +GliaymltL2tZ4WlWpzcqFfCLEUq9GpJ0JUifvU3Be7JuXvLRuM4Sozi5bxUadWpVpyjacMTSw84z +goyb87+G3xl/4WJ4l1jwqvhmXR9V8I6dfv45SXU/taeHdfj8Z+IvCWj6FATptm+prrlt4S13xPb6 +g6acY9Bm8OXiWVzD4hhmteZ8K/HrW9V8cL4H8U+BLLwhqVz451LwrY2M/iLxFNrqaPa+GfHniXS/ +FF/Y6z8O/DOh3ll4gh8DzW+mTeCPFHjnw7JLLqsI8VPqHh2+06X2Xwv4I0bwlqXjXV9NNzNqPj7x +QfFniC6uzaGSTUE0PRvDlpbW5tbS0CWFhpGg6fbWsU4uLgFZpp7qeWd3POy/A34KTaXrGiTfB/4W +y6L4i1iLxF4g0iX4f+E5NL13xBAZzDrmsae2kG01PWITc3Ji1O9hnvYzcTlJwZZN02l7OkrrneDg +qsmruGNqzoVarSVozp4WMsVhqKXKq1OnQdVyqzqYlN2c6tm4x+sydFWUrYWnTq04KV2nKdecaFep +L924ynV5I04Rhh38/WP7R/jKfV7HxRB4X0G++HWr+Bf2ePEWq2t743ttM1bwlcfGTxR4i8ORv4Yh +h8G3h8d3MtydL+1W+taz4Ns1g02H+wpbvUNSu7KLd8HfFz4qeJINAuPEPh7wto+rX/xe+NXgHRNL +8K+M7m48Pa9b/Dqz+J1tp8XjG61/4ZXWt6bANS8GQW7XvhWWG7vJVg8TSQWtlLdfD5vdW+EvwrbV +/Dmvt8M/h82veD7Oy07wjrbeDPDh1fwtp+mrImnWPhzUjppvNEs9PSWVbK20ya1htVlkWBIw7A7F +h4G8E6Vqd5rWl+D/AAtpus6jrU/iTUNWsPD+k2ep33iK506bSLnXry/t7SO6udauNJuLjS59Unle ++l06eaykna2leJnUXPDERhKVOVRYpUZ6TlRVSph3hXvBSlShGvzNr7cYS9rdVaabfuWitKuHqTjd +8sqcKGKp4ije3ParWq0Kimpx/he7Ck4rn+T/AA7+0T47h8CeBvib4/0PSLaPVv2dvFXxV1Twj4Fn +1TXrLVNSt9U+GyeHrm0uLvw0niXTZZrXxLfxXeh2cXiGPSxeyIl54qmsbW8l9/8Ag58R9Z+Jnhq/ +1fX/AARrHgXVNM1u40efT9S0rx7pljqKR2Wn6hDqvh9/iV8PPhX4t1DS3i1FbCe71DwNo0aa1p+r +WVm2o2dpBqd51Gl/Dr4faJZzadovgTwbpGn3FtrllcWOl+GNEsLOez8T3MN54ltJrW0sYoJbbxDe +W9vd65A6NFq1zBDPfpcSxI62vCPgfwX8P9JbQfAfhDwv4J0Nrua/bRvCPh/SfDektfXCRR3F62na +NaWVmbudIIEmuDD50qQxK7sI0A0Uovm5oKKdGpyRi+bkr1cxxOKbc7RlUjSwlalhISklFqknDD0I +KnCnMk73jJ2ddt81taEcNSpQiklyxlKtCVaUY2tzvmq1Zc0pdRRRRUFBRRRQAUUUUAFFFFABRRRQ +AUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAB +RRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFF +FFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUU +UAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQ +AUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH/9kCAAAAAJEDLAIAAAAAlQMvAgAAAACZ +AzECAAAAAJ0DMwIAAAAAoQM2AgAAAACkAzgCAAAAAKgDOgIAAAAArAM9AgAAAACwAz8CAAAAALQD +QgIAAAAAuANEAgAAAAC8A0YCAAAAAMADSQIAAAAAxANLAgAAAADIA00CAAAAAMsDUAIAAAAAzwNS +AgAAAADTA1UCAAAAANcDVwIAAAAA2wNZAgAAAADfA1wCAAAAAOMDXgIAAAAAMy handout master7/29/2010‹#›7/29/2010Click to edit Master text stylesSecond levelThird levelFourth levelFifth level‹#›iVBORw0KGgoAAAANSUhEUgAAAEEAAABOCAIAAADww+zHAAAAAXNSR0IArs4c6QAACi5JREFUaEPt +Wk2MHEcVrur5252d2fF6bSAQTOIEELEQhBywgPB7QEKRkTgE+ZRjFFkWUWzWBgkBEhzsIEsQK0FI +wA0RcQkIaWOELASJAxdQQESLbJNDYplkY2Lvxrs7O/3D996rqq7umemdHWaisbTt51J1T3XP+977 +3k/1rFYP31C3+BHc4vqT+jsYJsOJO36YDD9o9fBbk6HJ8FpodWRj+Lsn404dPBpNhibDa6Grx+Lh +756MO3VtIZkMTYbXQtdP3voY1JFbPx70l14e3ouTcad+47WlydBkeC12eo3hbTfKO3f8MEprDv+s +HT8Mb7tR3jn23BrFUWejHcVhkoyrIdDf/um5Edrk6APvyz1tY20tCIKzv1361R8vXrwylncoeoTm ++c7PfteNYe3m6o8XL1/8z+aRr3zyMx/dP0J7uUcVYbj6ZrS8otsb4WYn7kQa98RxAm7ESSDI4ziI +kziMkw/fWbnrtmo/DF/4xrM/OXF4TAC2eDcDALvqetdsBbJ7F8l8q7KnNb17tjY3W4XgeqtRa05X +L7+y2c/AQAsKffojdyRJzEc0cinKrfBAO1T40ijSUUdBNkPdiZJOmEQdXNFRpELuenWJvNTz0Jo+ +iughov3ojyIMoBCkHekQerPQESXtjlrraEgbMGJSMVBb5JyR295/4NtU46wHtkGkqal6Dnn3FVlQ +hAFxHIaggYKxkxh8JlGaT/lAQPM4iCHgqO0KHJy7pfsKLSj6es5CivVMvv/4aR1oyOoG5aJEJU+c +PRUrjQlkgIwpqLdx4Jn1+qy7AXNC0Oso9kOCkEVAf+/UKdyPcaOTVCsx0uzZs6dx5UmGQUmWx4KD +c/E2ALiq5e6Rh7vTmZmWCK4MQgP1rRMn5RE/OEOqP/UEjTgeObowgAcy3z04Dty2uvpmo7ELt2DE +3GGQUxHMizAYynMyPP6YUVdgOACJTpBdndn6Q9puMAg/e47uojyz8PcHxG6UGCkH+uTxE07FRx9b +qFXMGeIh3Oo92+Dm98mD+crKtWZzN0Yxk3zqk2orDAlSEApYKgvHiVRHj524GSpIqFlitWVqosDf +prCiJAUT+bSIS0isHNMswEMJKPk6e6NS1hCkKYAEzAFS09BcSm7ceMMmWWEXXWm15kUwHyimBwzc +gmVDcOn69eXcXf4VzEW2zkvwAwTrwo4S6aBowOyu5HEzSwWj8GBt2GFjkOIaR/0elEaT5zo1ECzZ +TIhmmOB6KDV8CwxhxxyYhJ1wtFK0f7j0avvSK230pNorYfBBJymJ0SnkuIp/aF/5A7dP99w/rN98 +676v/ebpbz5w17saKPB4lHSyIzzGvo9rb6x/9xcvvvr66uH777xv/9wIVXePGvt+OorCUqn8w2f+ +/svz/xrXfnrc74yRgINSpVyeKpWrlIxByxFTSY393cw4yJN75ttUH8aKZAfDWM078MN3/DCwqca6 +cEx+GDB9yjIZB9mU9zbF/51b8aJD3i7Rf/2PxcbVf1avXa6uLZeTtr761+myUuhMMLqJnGLcc6A9 +NRtNt+K5ezZad3dqe8O5T6wBEL07kXZ+MFMMh4Efj3+Jeu7p1tKF6Zf/Nr387yopqlldjDLpJdDe +wTDAEl6JMVGN2zutj63PHVzf+9B1scuWLtouBnrin56ZfemF6aUX6q9fruIlZTnwlNasXyGGHDBa +n6gSRCZAmKgK8MRqem/YPLjWOLjefOg6fXEfz2wDw/OLzT/8uvHnc81oU1cCVdGqqpVMINA7o73n +B8elvm5xALwJuSUmPDKZ+ezN5qHVqa+uaOr1MywrwmBh68cX3vH8ucbKcplMLsJKi+q5OV4VmI88 +IvWEkV5kRcUPxifiGe8UMOjTSlI/tFI7tBp8fo1eazGWAgz6wvn6z5/c/eJf6k5dMnkvAAQDDhHt +LZcw8VXPwch8JMZmFtHI5neSomIYxjP3tGuP/Lf05RUQrCcG/fvFxlNn5i++VCuXVImVdoQRDOIB +RyQ6tRgkmumKl4ty81ymyjgBd1kKkbpdc+ecSqwqt3XUsWseBgDS6tnF5o/OzF9i7UldaOaUZur7 +ABw24xxR3aWmbErtl2RT8/vesK4geNb8hl32I8LA4vtBP3j4PefPz1RLqhoojNAsnYsrbAT7oWyc +4GVVQ6f+lSFfLvxQFkb5GPjUsEiiQoBhDY+BpODTZ+b33f3+5y7MVCqqXEbo0OjPS2UVQEr4ycdQ +BJvquKQyI6uGBRojrzd3yb1ZkQUYsQYCt9M38qSCOYub0BqwumRuoW8RM8BaFaWvvbZ07/37r1yp +INND0HvEoTE/HpE6hEnluJTxgxflEgYSPBBXy/JFzS9zQiGvzJlo9iLY0cklXOcHLNalPfTuWyqL +TOKOJRKUZhhCqh5xLKGcS694yFbVmsgm7pQ8IxNX7Fxi7cMoA4AZBdG19yakvQCQSUIwjN7QnpHQ +qQS3V9T88KB6x57M9Bq9slOm0tnC7JB0897Ps6mLOBIkbHR9v8EAM0B7WSQYRG8BIJB6JlmJ9RSD +hWHKdmGly7UYJvfbXGQqg08qa/s07uGH5geZS2x+MzKYeJOjgrlUs4HRnVhdnTaTrkrnW727Whul +XaeUrW5pnfbSqzO/yUttpecO0Fu7DJesQ/CDtMutEtxEJ7/GZSudYZpXp6VW9KzW5qIrz7ZCu0qc +LwviAUm7lkXlNsI30nvuNRhSV1i3UHDbsHZg8t2RX8UlvntVup5bCFfdjN5eZcixKO07BICrD/jz +BGB458fx1xdpNLuoEIKZ4M6WvO5iZzjmcpTXOPlZtXsblGmTJEdlmws/xJ32ZhkDQCnQ7/4UYSAY +Xkyb4MYajgoX3MKofAx47VPafdgq0UPvbHGQtG58gp2DVOKuwHAsIp+IK4hI9LcYet/nUj/4MW2C +pE+eNVUsm2cdzcynDINUzG5EM56xpQ2bngxhXH/q3CKoLJFK4gT8oAkMd3zR5labmlxgiIXSPGuT +rKRav5Pt3kikidWWCKlrPiQpanS957YhW6czAACGMJATMOJ9rspJwFeCqsIEUq3zXxOgNcLeX4Tb +pJxggd8jSRdEz8k2TtQasaA1ou6IGyFpnKS/kk6JuiPbX1H3habIa7fgDRVEqmSEMBiloTr0rtqR +r9NpRdUsDPRz5pvk67k7NOra7s1pL0rIaXfP566IfjkxnwoYoEL2E2yYAABpH7pRH3gww6VcpSNe +WUa5EkFNlGufvO2oK3NuN+d2Qj3eA0j9tt0efW+f7VuaSSXWbTqy8eBxSbxh3MJEEkbJFXIFmu2A ++23QSdMpEYxFwta4m2ngzN/tBJ8VzvxkeDjEimGgs714AyO2CpZCqixcitN4KDOLjDgwPKHtRG5H +waeG3ALecYnnPot8GDkAEgkpeLtzoFs4wMg0kg1cryupV7zDeAJa7YW1UZeVdnsg8Y9EhQgcQoFu +Nz0CJhMY2Wju5w3SviseZLNlDCQe4Fg3TjBvODijMVn/B0u5lQ9JVbacAAAAAElFTkSuQmCCMy titleJason Harropjharrop272010-01-19T01:06:55Z2010-07-28T17:42:47Z8500115Microsoft Office PowerPointOn-screen Show (4:3)244400falseTheme1Slide Titles4Office ThemeBasic featuresBasic slideSVG in HTML output - statusSlide 4Plutext Pty Ltdfalsefalsefalse12.0000 \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java for Pptx4j/README.md b/Plugins/Aspose.Slides Java for Pptx4j/README.md new file mode 100644 index 00000000..8da5dbfa --- /dev/null +++ b/Plugins/Aspose.Slides Java for Pptx4j/README.md @@ -0,0 +1,57 @@ +## Aspose.Slides Java for Pptx4j +Aspose.Slides Java for Pptx4j is a project to provide comparative source code examples to do the same file processing tasks using Aspose.Slides for Java API and Pptx4j. Additionally, this project provides source code examples for advanced features offered by Aspose.Slides for Java which are missing in Pptx4j. + +Below are some code comparisons and features of Aspose.Slides for Java that are not available in Pptx4j. + +* [Code Comparison for common features in **Aspose.Slides** and **Pptx4j**](http://www.aspose.com/docs/display/slidesjava/2.2+Code+Comparison+for+Common+Features+in+Aspose.Slides+and+pptx4j) +* [Missing Features of **Pptx4j** available in **Aspose.Slides**](http://www.aspose.com/docs/display/slidesjava/2.3+Missing+Features+of+pptx4j+in+Aspose.Slides) + +These examples are helpful for developers who want to compare Pptx4j with Aspose.Slides OR migrate from Pptx4j to Aspose. + +### Feedback and Suggestions + +* Many more examples are yet to come. [Keep visiting us](https://products.aspose.com/slides/java). +* Raise your queries and suggest more examples via [Aspose Forums](http://www.aspose.com/community/forums/default.aspx) or via this social coding site. + +## Why Aspose for Pptx4j ? + +The developers looking for file format libraries may need to walk through the features provided by the libraries available on the market. Mainly, two factors are considered when choosing an option: + +* Features +* Efforts required to use the library + +If you are a Java developer looking to choose a file format library to process files, you may want to compare Pptx4j library with Aspose. In this case, this project will help you to compare features and code in both libraries. Please visit project documentation for a comprehensive comparison. + +## What is Doc4j ? + +docx4j is an open source (ASLv2) Java library for creating and manipulating Microsoft Open XML (Word docx, Powerpoint pptx, and Excel xlsx) files. + +It is similar to Microsoft's OpenXML SDK, but for Java. docx4j uses JAXB to create the in-memory object representation. + +Its emphasis is on power: if the file format supports it, you can do it with docx4j. But first, you'll need to take the time to understand JAXB, and the Open XML file structure + +docx4j was created by Plutext Pty Ltd in 2008 - using OpenXML4J for the OPC piece. Plutext still drives the project, but since then docx4j has benefited from contributions from many individuals. The contributors are listed in docx4j's pom.xml. + +Read More at [docx4java.org](http://www.docx4java.org/) + +## What is the use of Aspose Java Products? + +Aspose are file format experts and provide APIs and components for various file formats including MS Office, OpenOffice, PDF and Image formats. + +These APIs are available on a number of development platforms including Java. If you are a Java developer, you can use Aspose native Java APIs in your Java applications to process various file formats in just a few lines of codes. + +All the Aspose APIs don’t have any dependency over any other engine. For example, you don’t need to have MS Office installed on the server to process MS Office files. Below you can read mor about Aspose.Slides for Java: + +### Aspose.Slides for Java + +[![Aspose.Slides for Java](http://www.aspose.com/App_Themes/V2/images/productLogos/JAVA/aspose_slides-for-java.jpg)](https://products.aspose.com/slides/java) + +Aspose.Slides for Java is a unique PowerPoint management component that enables Java based applications to read, write and manipulate PowerPoint documents without using Microsoft PowerPoint. + +One can generate, modify, copy, convert, render and print presentations without installing Microsoft PowerPoint. + +Aspose.Slides for Java supports presentation file formats including PPT, PPS, POT, PresentationML (OOXML, PPTX) and Open Document Presentations (ODP). + +[Learn More](https://products.aspose.com/slides/java) + + diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipseFeature/build.properties b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipseFeature/build.properties new file mode 100644 index 00000000..64f93a9f --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipseFeature/build.properties @@ -0,0 +1 @@ +bin.includes = feature.xml diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipseFeature/feature.xml b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipseFeature/feature.xml new file mode 100644 index 00000000..7c6e7041 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipseFeature/feature.xml @@ -0,0 +1,49 @@ + + + + + Aspose.Slides Maven Project wizard creates Maven Project for using Aspose.Slides for Java API within Eclipse IDE. +Aspose.Slides for Java is a unique PowerPoint management component that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint. +Aspose.Slides for Java is the first and only Java component that provides functionality to manage PowerPoint documents within your own applications. +Aspose.Slides Maven Project wizard fetch and configures the latest +Maven dependency reference of Aspose.Slides for Java from the +Aspose +Cloud Maven Repository. +The wizard also gives you option to download the Code Examples +to use Aspose.Slides for Java API. +Once you are finished with this wizard - created Maven project +and downloaded Code Examples, next you can insert those Code +Examples to use Aspose.Slides for Java API in your Project from +File -> New -> Other -> Aspose.Slides Code Example +The newly created project and the Code Examples you added is +now ready to be enhanced, all required resources and references +are also automatically added. + + + + The MIT License (MIT) +Copyright (c) 2001-2020 Aspose Pty Ltd + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + + + + + + + diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/build.properties b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/build.properties new file mode 100644 index 00000000..8de5aeee --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + resources/ diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/plugin.xml b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/plugin.xml new file mode 100644 index 00000000..f3ec8601 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/plugin.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/Aspose.png b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/Aspose.png new file mode 100644 index 00000000..b4031271 Binary files /dev/null and b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/Aspose.png differ diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/classpath-template.txt b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/classpath-template.txt new file mode 100644 index 00000000..b93237ae --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/classpath-template.txt @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/long_banner.png b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/long_banner.png new file mode 100644 index 00000000..821b3197 Binary files /dev/null and b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/long_banner.png differ diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/org-eclipse-jdt-core.txt b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/org-eclipse-jdt-core.txt new file mode 100644 index 00000000..ec4300d5 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/org-eclipse-jdt-core.txt @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/pom-xml-template.txt b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/pom-xml-template.txt new file mode 100644 index 00000000..f2a37440 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/resources/pom-xml-template.txt @@ -0,0 +1,20 @@ + + + 4.0.0 + com.mycompany + mavenproject1 + 2 + jar + + + Aspose-Maven-Repository + Aspose Maven Repository + https://repository.aspose.com/repo/ + + + + UTF-8 + 1.7 + 1.7 + + \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/Activator.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/Activator.java new file mode 100644 index 00000000..83fed312 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/Activator.java @@ -0,0 +1,80 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "AsposeSlidesEclipsePlugin"; + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + public static String getResourceFilePath(String resourceFileName) { + String fileURL = null; + try { + URL url = getDefault().getBundle().getEntry("resources/" + resourceFileName); + fileURL = FileLocator.toFileURL(url).toURI().normalize().getPath(); + } catch (IOException | URISyntaxException e) { + e.printStackTrace(); + } + return fileURL; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework. + * BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework. + * BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/MavenSettings.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/MavenSettings.java new file mode 100644 index 00000000..7b3239b6 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/MavenSettings.java @@ -0,0 +1,85 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides; + +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.eclipse.core.runtime.preferences.InstanceScope; + +/** + * + * @author Adeel + */ +public final class MavenSettings { + + private static final String PROP_LAST_ARCHETYPE_GROUPID = "lastArchetypeGroupId"; + private static final String PROP_LAST_ARCHETYPE_VERSION = "lastArchetypeVersion"; + + private IEclipsePreferences getPreferences() { + return InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); + } + + /** + * + * @return + */ + public String getLastArchetypeGroupId() { + return getPreferences().get(PROP_LAST_ARCHETYPE_GROUPID, "com.mycompany"); + } + + /** + * + * @return + */ + public String getLastArchetypeVersion() { + return getPreferences().get(PROP_LAST_ARCHETYPE_VERSION, "1.0-SNAPSHOT"); + } + + /** + * + * @param version + */ + public void setLastArchetypeVersion(String version) { + putProperty(PROP_LAST_ARCHETYPE_VERSION, version); + } + + /** + * + * @param groupId + */ + public void setLastArchetypeGroupId(String groupId) { + putProperty(PROP_LAST_ARCHETYPE_GROUPID, groupId); + } + + private String putProperty(String key, String value) { + String retval = getProperty(key); + if (value != null) { + getPreferences().put(key, value); + } else { + getPreferences().remove(key); + } + return retval; + } + private static final MavenSettings INSTANCE = new MavenSettings(); + + /** + * + * @return + */ + public static MavenSettings getDefault() { + return INSTANCE; + } + + private String getProperty(String key) { + return getPreferences().get(key, null); + } + +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/AsposeMavenProjectSupport.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/AsposeMavenProjectSupport.java new file mode 100644 index 00000000..de121d05 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/AsposeMavenProjectSupport.java @@ -0,0 +1,158 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven; + +import java.net.URI; +import java.nio.file.Files; +import org.eclipse.core.resources.ICommand; +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IProjectDescription; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.operation.IRunnableWithProgress; +import com.aspose.slides.Activator; +import com.aspose.slides.maven.utils.AsposeJavaAPI; +import com.aspose.slides.maven.utils.AsposeMavenProjectManager; +import com.aspose.slides.maven.utils.AsposeSlidesJavaAPI; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; + +public class AsposeMavenProjectSupport implements IRunnableWithProgress { + + private String projectName; + private URI location; + private String packageName; + private boolean downloadExamples; + private String version; + private String groupId; + + public AsposeMavenProjectSupport(String projectName, URI location, String packageName, boolean downloadExamples, + String version, String groupId) { + this.projectName = projectName; + this.location = location; + this.packageName = packageName; + this.downloadExamples = downloadExamples; + this.version = version; + this.groupId = groupId; + } + + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { + monitor.beginTask("Processing...", IProgressMonitor.UNKNOWN); + createProject(monitor); + monitor.done(); + } + + private IProject createProject(IProgressMonitor monitor) { + IProject project = createBaseProject(projectName, location); + try { + monitor.setTaskName("Creating project..."); + String[] paths = { "src/main/java/" + packageName.replace(".", "/"), "src/test/java", "src/main/resources" }; + addToProjectStructure(project, paths); + + Files.copy(new File(Activator.getResourceFilePath("pom-xml-template.txt")).toPath(), + new File(location.getPath() + "/pom.xml").toPath()); + Files.copy(new File(Activator.getResourceFilePath("classpath-template.txt")).toPath(), + new File(location.getPath() + "/.classpath").toPath()); + + Files.createDirectories(new File(location.getPath() + "/.settings").toPath()); + Files.copy(new File(Activator.getResourceFilePath("org-eclipse-jdt-core.txt")).toPath(), + new File(location.getPath() + "/.settings/org.eclipse.jdt.core.prefs").toPath()); + + AsposeMavenProjectManager asposeMavenProjectManager = AsposeMavenProjectManager + .initialize(new File(location)); + asposeMavenProjectManager.configureProjectMavenPOM(groupId, projectName, version); + project.refreshLocal(IResource.DEPTH_INFINITE, null); + + if (downloadExamples) { + monitor.setTaskName("Downloading code examples..."); + AsposeMavenProjectManager.initialize(new File(location)); + AsposeJavaAPI component = AsposeSlidesJavaAPI.initialize(AsposeMavenProjectManager.getInstance()); + component.checkAndUpdateRepo(); + } + + } catch (CoreException e) { + e.printStackTrace(); + project = null; + } catch (IOException e) { + e.printStackTrace(); + } + + return project; + } + + private IProject createBaseProject(String projectName, URI location) { + IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); + String natures[] = { "org.eclipse.jdt.core.javanature", "org.eclipse.m2e.core.maven2Nature" }; + + if (!newProject.exists()) { + URI projectLocation = location; + IProjectDescription desc = newProject.getWorkspace().newProjectDescription(newProject.getName()); + + ICommand commandJavaBuilder = (ICommand) desc.newCommand(); + ICommand commandMaven2Builder = (ICommand) desc.newCommand(); + commandJavaBuilder.setBuilderName("org.eclipse.jdt.core.javabuilder"); + commandMaven2Builder.setBuilderName("org.eclipse.m2e.core.maven2Builder"); + ICommand buildspecs[] = { commandJavaBuilder, commandMaven2Builder }; + + desc.setBuildSpec(buildspecs); + desc.setNatureIds(natures); + + if (location != null && ResourcesPlugin.getWorkspace().getRoot().getLocationURI().equals(location)) { + projectLocation = null; + } + + desc.setLocationURI(projectLocation); + try { + newProject.create(desc, null); + if (!newProject.isOpen()) { + newProject.open(null); + } + } catch (CoreException e) { + e.printStackTrace(); + } + } + + return newProject; + } + + private void createFolder(IFolder folder) throws CoreException { + IContainer parent = folder.getParent(); + if (parent instanceof IFolder) { + createFolder((IFolder) parent); + } + if (!folder.exists()) { + folder.create(false, true, null); + } + } + + /** + * Create a folder structure with a parent root, overlay, and a few child + * folders. + * + * @param newProject + * @param paths + * @throws CoreException + */ + private void addToProjectStructure(IProject newProject, String[] paths) throws CoreException { + for (String path : paths) { + IFolder etcFolders = newProject.getFolder(path); + createFolder(etcFolders); + } + } + +} \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/AsposeMavenProjectWizard.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/AsposeMavenProjectWizard.java new file mode 100644 index 00000000..fe01598c --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/AsposeMavenProjectWizard.java @@ -0,0 +1,54 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven; + +import java.lang.reflect.InvocationTargetException; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.ui.INewWizard; +import org.eclipse.ui.IWorkbench; + +public class AsposeMavenProjectWizard extends Wizard implements INewWizard { + + private AsposeMavenProjectWizardPage wizardPage; + + public AsposeMavenProjectWizard() { + setWindowTitle("Aspose.Slides Maven Project"); + } + + @Override + public void init(IWorkbench workbench, IStructuredSelection selection) { + + } + + @Override + public void addPages() { + super.addPages(); + wizardPage = new AsposeMavenProjectWizardPage(); + addPage(wizardPage); + } + + @Override + public boolean performFinish() { + AsposeMavenProjectSupport asposeMavenProjectSupport = new AsposeMavenProjectSupport(wizardPage.getProjectName(), + wizardPage.getLocationURI(), wizardPage.getPackageName(), wizardPage.isDownloadExamplesChecked(), + wizardPage.getVersion(), wizardPage.getGroupId()); + try { + new ProgressMonitorDialog(this.getShell()).run(true, false, asposeMavenProjectSupport); + } catch (InvocationTargetException | InterruptedException e) { + e.printStackTrace(); + } + return true; + } + +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/AsposeMavenProjectWizardPage.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/AsposeMavenProjectWizardPage.java new file mode 100644 index 00000000..2bb1b392 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/AsposeMavenProjectWizardPage.java @@ -0,0 +1,370 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven; + +import java.io.File; +import java.net.URI; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.DirectoryDialog; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.wb.swt.SWTResourceManager; +import com.aspose.slides.Activator; +import com.aspose.slides.maven.utils.MavenSettings; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.jface.fieldassist.ControlDecoration; +import org.eclipse.jface.fieldassist.FieldDecoration; +import org.eclipse.jface.fieldassist.FieldDecorationRegistry; + +public class AsposeMavenProjectWizardPage extends WizardPage { + + public static final String PROP_PROJECT_NAME = "projectName"; + public static final String PROP_GROUP_ID = "groupId"; + + private Text txtProjectLocation; + private Text txtProjectName; + private Text txtProjectFolder; + private Text txtArtifactId; + private Text txtGroupId; + private Text txtVersion; + private Text txtPackage; + private Button chkDownloadExamples; + + private ControlDecoration txtProjectNameDecoration; + private ControlDecoration txtProjectLocationDecoration; + private ControlDecoration txtGroupIdDecoration; + private ControlDecoration txtVersionDecoration; + private ControlDecoration txtProjectFolderDecoration; + private ControlDecoration txtPackageDecoration; + + /** + * Create the wizard. + */ + public AsposeMavenProjectWizardPage() { + super("wizardPage"); + setTitle("New Project"); + setDescription("Name and Location"); + } + + private String getDefaultProjectName() { + String defaultName = "asposemavenproject"; + IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); + try { + for (int i = 1; i < 100; i++) { + + boolean match = false; + for (IProject project : projects) { + if (project.getDescription().getName().equals(defaultName + i)) { + match = true; + break; + } + + } + if (!match) { + defaultName = defaultName + i; + break; + } + } + } catch (CoreException e) { + e.printStackTrace(); + } + return defaultName; + } + + private void initControls() { + txtGroupId.setText(MavenSettings.getDefault().getLastArchetypeGroupId()); + txtVersion.setText(MavenSettings.getDefault().getLastArchetypeVersion()); + txtProjectName.setText(getDefaultProjectName()); + txtProjectName.setSelection(txtProjectName.getCharCount()); + txtProjectLocation.setText(ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString()); + txtProjectFolder.setText(txtProjectLocation.getText() + File.separator + txtProjectName.getText()); + txtArtifactId.setText(txtProjectName.getText()); + txtPackage.setText(txtGroupId.getText() + "." + txtProjectName.getText()); + } + + private void initDecorators() { + FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault() + .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR); + + txtProjectNameDecoration = new ControlDecoration(txtProjectName, SWT.TOP | SWT.RIGHT); + txtProjectNameDecoration.setImage(fieldDecoration.getImage()); + txtProjectNameDecoration.hide(); + + txtProjectLocationDecoration = new ControlDecoration(txtProjectLocation, SWT.TOP | SWT.RIGHT); + txtProjectLocationDecoration.setImage(fieldDecoration.getImage()); + txtProjectLocationDecoration.hide(); + + txtGroupIdDecoration = new ControlDecoration(txtGroupId, SWT.TOP | SWT.RIGHT); + txtGroupIdDecoration.setImage(fieldDecoration.getImage()); + txtGroupIdDecoration.hide(); + + txtVersionDecoration = new ControlDecoration(txtVersion, SWT.TOP | SWT.RIGHT); + txtVersionDecoration.setImage(fieldDecoration.getImage()); + txtVersionDecoration.hide(); + + txtProjectFolderDecoration = new ControlDecoration(txtProjectFolder, SWT.TOP | SWT.RIGHT); + txtProjectFolderDecoration.setImage(fieldDecoration.getImage()); + txtProjectFolderDecoration.hide(); + + txtPackageDecoration = new ControlDecoration(txtPackage, SWT.TOP | SWT.RIGHT); + txtPackageDecoration.setImage(fieldDecoration.getImage()); + txtPackageDecoration.hide(); + } + + private void onProjectNameChange() { + txtProjectNameDecoration.hide(); + setPageComplete(true); + if (txtProjectName.getText().trim().length() == 0) { + txtProjectNameDecoration.setDescriptionText("Project Name is not a valid folder name"); + txtProjectNameDecoration.show(); + setPageComplete(false); + } + txtProjectFolder.setText(txtProjectLocation.getText() + File.separator + txtProjectName.getText()); + txtArtifactId.setText(txtProjectName.getText()); + txtPackage.setText("com.mycompany." + txtProjectName.getText()); + } + + private void onProjectLocationChange() { + txtProjectLocationDecoration.hide(); + setPageComplete(true); + if (!new File(txtProjectLocation.getText().trim()).isDirectory()) { + txtProjectLocationDecoration.setDescriptionText("Project Folder is not a valid path"); + txtProjectLocationDecoration.show(); + setPageComplete(false); + } + txtProjectFolder.setText(txtProjectLocation.getText() + File.separator + txtProjectName.getText()); + } + + private void onVersionChange() { + txtVersionDecoration.hide(); + setPageComplete(true); + if (txtVersion.getText().trim().length() == 0) { + txtVersionDecoration.setDescriptionText("Version may not be empty"); + txtVersionDecoration.show(); + setPageComplete(false); + } + } + + private void onPackageChange() { + txtPackageDecoration.hide(); + setPageComplete(true); + String packageName = txtPackage.getText().trim(); + if (!(packageName.equals("") + || packageName.matches("([\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{L}_$][\\p{L}\\p{N}_$]*"))) { + txtPackageDecoration.setDescriptionText("Package may not be empty"); + txtPackageDecoration.show(); + setPageComplete(false); + } + } + + private void onGroupIdChange() { + txtGroupIdDecoration.hide(); + setPageComplete(true); + if (txtGroupId.getText().trim().length() == 0) { + txtGroupIdDecoration.setDescriptionText("GroupdId may not be empty"); + txtGroupIdDecoration.show(); + setPageComplete(false); + } + txtPackage.setText(txtGroupId.getText() + "." + txtProjectName.getText()); + } + + private void onProjectFolderChange() { + txtProjectFolderDecoration.hide(); + setPageComplete(true); + File projLoc = new File( + (new File(txtProjectLocation.getText()).getAbsoluteFile()).toURI().normalize().getPath()); + File destFolder = new File( + (new File(txtProjectFolder.getText()).getAbsoluteFile()).toURI().normalize().getPath()); + + while (projLoc != null && !projLoc.exists()) { + projLoc = projLoc.getParentFile(); + } + if (projLoc == null || !projLoc.canWrite()) { + txtProjectFolderDecoration.setDescriptionText("Project Folder cannot be created"); + txtProjectFolderDecoration.show(); + setPageComplete(false); + } else { + File[] kids = destFolder.listFiles(); + if (destFolder.exists() && kids != null && kids.length > 0) { + txtProjectFolderDecoration.setDescriptionText("Project Folder already exists and is not empty"); + txtProjectFolderDecoration.show(); + setPageComplete(false); + } + } + } + + public String getProjectName() { + return txtProjectName.getText(); + } + + public String getPackageName() { + return txtPackage.getText(); + } + + public URI getLocationURI() { + return new File(txtProjectFolder.getText()).toURI(); + } + + public String getVersion() { + return txtVersion.getText(); + } + + public String getGroupId() { + return txtGroupId.getText(); + } + + public boolean isDownloadExamplesChecked() { + return chkDownloadExamples.getSelection(); + } + + /** + * Create contents of the wizard. + * + * @param parent + */ + public void createControl(Composite parent) { + Composite container = new Composite(parent, SWT.NULL); + + setControl(container); + + Label lblNewLabel = new Label(container, SWT.NONE); + lblNewLabel.setImage(SWTResourceManager.getImage(Activator.getResourceFilePath("long_banner.png"))); + lblNewLabel.setBounds(10, 0, 500, 80); + + Label lblPleaseEnterProject = new Label(container, SWT.NONE); + lblPleaseEnterProject.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD)); + lblPleaseEnterProject.setBounds(5, 98, 179, 15); + lblPleaseEnterProject.setText("Please enter project detail:"); + + Label lblPleaseEnterMaven = new Label(container, SWT.NONE); + lblPleaseEnterMaven.setText("Please enter maven artifact detail:"); + lblPleaseEnterMaven.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD)); + lblPleaseEnterMaven.setBounds(5, 194, 213, 15); + + Label lblProjectName = new Label(container, SWT.NONE); + lblProjectName.setBounds(5, 118, 84, 15); + lblProjectName.setText("Project Name:"); + + Label lblProjectLocation = new Label(container, SWT.NONE); + lblProjectLocation.setBounds(5, 146, 94, 15); + lblProjectLocation.setText("Project Location:"); + + Label lblProjectFolder = new Label(container, SWT.NONE); + lblProjectFolder.setText("Project Folder:"); + lblProjectFolder.setBounds(5, 173, 94, 15); + + Label lblArtifactId = new Label(container, SWT.NONE); + lblArtifactId.setText("Artifact Id:"); + lblArtifactId.setBounds(5, 215, 94, 15); + + Label lblGroupId = new Label(container, SWT.NONE); + lblGroupId.setText("Group Id:"); + lblGroupId.setBounds(5, 242, 94, 15); + + Label lblVersion = new Label(container, SWT.NONE); + lblVersion.setText("Version:"); + lblVersion.setBounds(5, 270, 94, 15); + + Label lblPackage = new Label(container, SWT.NONE); + lblPackage.setText("Package:"); + lblPackage.setBounds(5, 296, 94, 15); + + txtProjectName = new Text(container, SWT.BORDER); + txtProjectName.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + onProjectNameChange(); + } + }); + txtProjectName.setBounds(118, 116, 319, 21); + + txtProjectLocation = new Text(container, SWT.BORDER); + txtProjectLocation.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + onProjectLocationChange(); + } + }); + txtProjectLocation.setBounds(118, 143, 319, 21); + + Button btnNewButton = new Button(container, SWT.NONE); + btnNewButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + DirectoryDialog dialog = new DirectoryDialog(new Shell(), SWT.NULL); + String path = dialog.open(); + if (path != null) { + txtProjectLocation.setText(path); + } + } + }); + btnNewButton.setBounds(443, 141, 75, 25); + btnNewButton.setText("Browse..."); + + txtProjectFolder = new Text(container, SWT.BORDER); + txtProjectFolder.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + onProjectFolderChange(); + } + }); + txtProjectFolder.setEditable(false); + txtProjectFolder.setBounds(118, 170, 319, 21); + + txtArtifactId = new Text(container, SWT.BORDER); + txtArtifactId.setEnabled(false); + txtArtifactId.setEditable(false); + txtArtifactId.setBounds(118, 212, 319, 21); + + txtGroupId = new Text(container, SWT.BORDER); + txtGroupId.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + onGroupIdChange(); + } + }); + txtGroupId.setBounds(118, 239, 319, 21); + + txtVersion = new Text(container, SWT.BORDER); + txtVersion.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + onVersionChange(); + } + }); + txtVersion.setBounds(118, 266, 319, 21); + + txtPackage = new Text(container, SWT.BORDER); + txtPackage.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + onPackageChange(); + } + }); + txtPackage.setBounds(118, 293, 319, 21); + + chkDownloadExamples = new Button(container, SWT.CHECK); + chkDownloadExamples.setBounds(5, 325, 492, 16); + chkDownloadExamples.setText("Also Download Code Examples (for using Aspose.Slides for Java)"); + + Label lblNewLabel_1 = new Label(container, SWT.NONE); + lblNewLabel_1.setBounds(443, 296, 55, 15); + lblNewLabel_1.setText("(Optional)"); + + initDecorators(); + initControls(); + } +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/artifacts/Metadata.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/artifacts/Metadata.java new file mode 100644 index 00000000..28f2ae3b --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/artifacts/Metadata.java @@ -0,0 +1,362 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2014.09.26 at 03:01:37 PM PKT +// +package com.aspose.slides.maven.artifacts; + +import javax.xml.bind.annotation.*; +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * Java class for anonymous complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ * < + * pre> + * <complexType> <complexContent> <restriction + * base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> <element + * name="groupId" type="{http://www.w3.org/2001/XMLSchema}string"/> <element + * name="artifactId" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="versioning"> <complexType> <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> <element name="latest" + * type="{http://www.w3.org/2001/XMLSchema}string"/> <element name="release" + * type="{http://www.w3.org/2001/XMLSchema}string"/> <element + * name="versions"> <complexType> <complexContent> <restriction + * base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> <element + * name="version" type="{http://www.w3.org/2001/XMLSchema}string" + * maxOccurs="unbounded" minOccurs="0"/> </sequence> </restriction> + * </complexContent> </complexType> </element> <element + * name="lastUpdated" type="{http://www.w3.org/2001/XMLSchema}long"/> + * </sequence> </restriction> </complexContent> </complexType> + * </element> </sequence> </restriction> </complexContent> + * </complexType> + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "groupId", + "artifactId", + "version", + "versioning", + "classifier" +}) +@XmlRootElement(name = "metadata") +public class Metadata { + + /** + * + */ + @XmlElement(required = true) + protected String groupId; + + /** + * + */ + @XmlElement(required = true) + protected String artifactId; + + /** + * + */ + @XmlElement(required = true) + protected String version; + + /** + * + */ + @XmlElement(required = true) + protected Metadata.Versioning versioning; + + /** + * + */ + protected String classifier; + + /** + * Gets the value of the groupId property. + * + * @return possible object is {@link String } + */ + public String getGroupId() { + return groupId; + } + + /** + * Sets the value of the groupId property. + * + * @param value allowed object is {@link String } + */ + public void setGroupId(String value) { + this.groupId = value; + } + + /** + * Gets the value of the artifactId property. + * + * @return possible object is {@link String } + */ + public String getArtifactId() { + return artifactId; + } + + /** + * Sets the value of the artifactId property. + * + * @param value allowed object is {@link String } + */ + public void setArtifactId(String value) { + this.artifactId = value; + } + + /** + * Gets the value of the version property. + * + * @return possible object is {@link String } + */ + public String getVersion() { + return version; + } + + /** + * Sets the value of the version property. + * + * @param value allowed object is {@link String } + */ + public void setVersion(String value) { + this.version = value; + } + + /** + * Gets the value of the versioning property. + * + * @return possible object is {@link Metadata.Versioning } + */ + public Metadata.Versioning getVersioning() { + return versioning; + } + + /** + * Sets the value of the versioning property. + * + * @param value allowed object is {@link Metadata.Versioning } + */ + public void setVersioning(Metadata.Versioning value) { + this.versioning = value; + } + + /** + *

+ * Java class for anonymous complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained + * within this class. + *

+ * < + * pre> + * <complexType> <complexContent> <restriction + * base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> + * <element name="latest" + * type="{http://www.w3.org/2001/XMLSchema}string"/> <element + * name="release" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="versions"> <complexType> <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> <element name="version" + * type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" + * minOccurs="0"/> </sequence> </restriction> </complexContent> + * </complexType> </element> <element name="lastUpdated" + * type="{http://www.w3.org/2001/XMLSchema}long"/> </sequence> + * </restriction> </complexContent> </complexType> + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "latest", + "release", + "versions", + "lastUpdated" + }) + public static class Versioning { + + /** + * + */ + @XmlElement(required = true) + protected String latest; + + /** + * + */ + @XmlElement(required = true) + protected String release; + + /** + * + */ + @XmlElement(required = true) + protected Metadata.Versioning.Versions versions; + + /** + * + */ + protected long lastUpdated; + + /** + * Gets the value of the latest property. + * + * @return possible object is {@link String } + */ + public String getLatest() { + return latest; + } + + /** + * Sets the value of the latest property. + * + * @param value allowed object is {@link String } + */ + public void setLatest(String value) { + this.latest = value; + } + + /** + * Gets the value of the release property. + * + * @return possible object is {@link String } + */ + public String getRelease() { + return release; + } + + /** + * Sets the value of the release property. + * + * @param value allowed object is {@link String } + */ + public void setRelease(String value) { + this.release = value; + } + + /** + * Gets the value of the versions property. + * + * @return possible object is {@link Metadata.Versioning.Versions } + */ + public Metadata.Versioning.Versions getVersions() { + return versions; + } + + /** + * Sets the value of the versions property. + * + * @param value allowed object is {@link Metadata.Versioning.Versions } + */ + public void setVersions(Metadata.Versioning.Versions value) { + this.versions = value; + } + + /** + * Gets the value of the lastUpdated property. + * @return + */ + public long getLastUpdated() { + return lastUpdated; + } + + /** + * Sets the value of the lastUpdated property. + * @param value + */ + public void setLastUpdated(long value) { + this.lastUpdated = value; + } + + /** + *

+ * Java class for anonymous complex type. + *

+ *

+ * The following schema fragment specifies the expected content + * contained within this class. + *

+ * < + * pre> + * <complexType> <complexContent> <restriction + * base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> + * <element name="version" + * type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" + * minOccurs="0"/> </sequence> </restriction> </complexContent> + * </complexType> + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "version" + }) + public static class Versions { + + /** + * + */ + protected List version; + + /** + * Gets the value of the version property. + *

+ *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned + * list will be present inside the JAXB object. This is why there is + * not a set method for the version property. + *

+ *

+ * For example, to add a new item, do as follows: + *

+             *    getVersion().add(newItem);
+             * 
+ *

+ *

+ *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * @return + */ + public List getVersion() { + if (version == null) { + version = new ArrayList(); + } + return this.version; + } + + } + + } + + /** + * Gets the value of the classifier property. + * + * @return possible object is {@link String } + */ + public String getClassifier() { + return classifier; + } + + /** + * Sets the value of the version property. + * + * @param value allowed object is {@link String } + */ + public void setClassifier(String value) { + this.classifier = value; + } + +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/artifacts/ObjectFactory.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/artifacts/ObjectFactory.java new file mode 100644 index 00000000..125ca1e3 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/artifacts/ObjectFactory.java @@ -0,0 +1,55 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2014.09.26 at 03:01:37 PM PKT +// +package com.aspose.slides.maven.artifacts; + +import javax.xml.bind.annotation.XmlRegistry; + +/** + * This object contains factory methods for each Java content interface and Java + * element interface generated in the com.aspose.maven.artifacts package. + *

+ * An ObjectFactory allows you to programatically construct new instances of the + * Java representation for XML content. The Java representation of XML content + * can consist of schema derived interfaces and classes representing the binding + * of schema type definitions, element declarations and model groups. Factory + * methods for each of these are provided in this class. + */ +@XmlRegistry +public class ObjectFactory { + + /** + * Create a new ObjectFactory that can be used to create new instances of + * schema derived classes for package: com.aspose.maven.apis.artifacts + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Metadata.Versioning.Versions } + * @return + */ + public Metadata.Versioning.Versions createMetadataVersioningVersions() { + return new Metadata.Versioning.Versions(); + } + + /** + * Create an instance of {@link Metadata } + * @return + */ + public Metadata createMetadata() { + return new Metadata(); + } + + /** + * Create an instance of {@link Metadata.Versioning } + * @return + */ + public Metadata.Versioning createMetadataVersioning() { + return new Metadata.Versioning(); + } + +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/artifacts/maven-metada.xml b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/artifacts/maven-metada.xml new file mode 100644 index 00000000..b0cfdb9c --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/artifacts/maven-metada.xml @@ -0,0 +1,17 @@ + + + com.aspose + aspose-slides + 14.5.0 + + 14.8.0 + 14.8.0 + + 14.5.0 + 14.6.0 + 14.7.0 + 14.8.0 + + 20140924084136 + + \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/artifacts/maven-metadata.xsd b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/artifacts/maven-metadata.xsd new file mode 100644 index 00000000..cc684e88 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/artifacts/maven-metadata.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/examples/AsposeExampleSupport.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/examples/AsposeExampleSupport.java new file mode 100644 index 00000000..bf6c82d3 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/examples/AsposeExampleSupport.java @@ -0,0 +1,107 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.examples; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; + +import org.apache.commons.io.FileUtils; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.w3c.dom.NodeList; +import com.aspose.slides.maven.utils.AsposeConstants; +import com.aspose.slides.maven.utils.AsposeMavenProjectManager; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; + +public class AsposeExampleSupport implements IRunnableWithProgress { + + private String selectedProjectPath; + private String exampleCategory; + private IProject project; + + final static String localExampleFolder = "aspose/GitConsRepos/Aspose.Slides/Examples"; + final static String localExampleSourceFolder = "src/main/java/com/aspose/slides/examples"; + final static String localExampleResourceFolder = "src/main/resources/com/aspose/slides/examples"; + + public AsposeExampleSupport(String selectedProjectPath, String exampleCategory, IProject project) { + this.selectedProjectPath = selectedProjectPath; + this.exampleCategory = exampleCategory; + this.project = project; + } + + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { + monitor.beginTask("Adding example code in project " + project.getName() + "...", IProgressMonitor.UNKNOWN); + createExample(); + monitor.done(); + } + + public void createExample() { + String srcExamplePath = System.getProperty("user.home") + File.separator + localExampleFolder + File.separator + + localExampleSourceFolder; + String srcExampleResourcePath = System.getProperty("user.home") + File.separator + localExampleFolder + + File.separator + localExampleResourceFolder; + + String destProjectExamplePath = selectedProjectPath + File.separator + localExampleSourceFolder; + String destProjectExampleResourcePath = selectedProjectPath + File.separator + localExampleResourceFolder; + + File srcExampleCategoryPath = new File(srcExamplePath + File.separator + exampleCategory); + File destExampleCategoryPath = new File(destProjectExamplePath + File.separator + exampleCategory); + + Path srcUtil = new File(srcExamplePath + File.separator + "Utils.java").toPath(); + Path destUtil = new File(destProjectExamplePath + File.separator + "Utils.java").toPath(); + if(!srcUtil.toFile().exists()) { + srcUtil = new File(srcExamplePath + File.separator + "RunExamples.java").toPath(); + destUtil = new File(destProjectExamplePath + File.separator + "RunExamples.java").toPath(); + } + + File srcExampleResourceCategoryPath = new File(srcExampleResourcePath + File.separator + exampleCategory); + File destExampleResourceCategoryPath = new File( + destProjectExampleResourcePath + File.separator + exampleCategory); + + String repositoryPOM_XML = System.getProperty("user.home") + File.separator + localExampleFolder + + File.separator + AsposeConstants.MAVEN_POM_XML; + + try { + + if(srcExampleCategoryPath.exists()) { + FileUtils.copyDirectory(srcExampleCategoryPath, destExampleCategoryPath); + } + if(srcUtil.toFile().exists()) { + Files.copy(srcUtil, destUtil, StandardCopyOption.REPLACE_EXISTING); + } + if(srcExampleResourceCategoryPath.exists()) { + FileUtils.copyDirectory(srcExampleResourceCategoryPath, destExampleResourceCategoryPath); + } + + NodeList examplesNoneAsposeDependencies = AsposeMavenProjectManager.getInstance() + .getDependenciesFromPOM(repositoryPOM_XML, AsposeConstants.ASPOSE_GROUP_ID); + AsposeMavenProjectManager.getInstance().addMavenDependenciesInProject(examplesNoneAsposeDependencies); + + NodeList examplesNoneAsposeRepositories = AsposeMavenProjectManager.getInstance() + .getRepositoriesFromPOM(repositoryPOM_XML, AsposeConstants.ASPOSE_MAVEN_REPOSITORY); + AsposeMavenProjectManager.getInstance().addMavenRepositoriesInProject(examplesNoneAsposeRepositories); + + project.refreshLocal(IResource.DEPTH_INFINITE, null); + + } catch (IOException | CoreException e) { + e.printStackTrace(); + } + + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/examples/AsposeExampleWizard.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/examples/AsposeExampleWizard.java new file mode 100644 index 00000000..54f6b85e --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/examples/AsposeExampleWizard.java @@ -0,0 +1,60 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.examples; + +import java.lang.reflect.InvocationTargetException; +import org.eclipse.core.resources.IProject; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.ui.INewWizard; +import org.eclipse.ui.IWorkbench; + +public class AsposeExampleWizard extends Wizard implements INewWizard { + + private AsposeExampleWizardPage wizardPage; + + public AsposeExampleWizard() { + setWindowTitle("Aspose.Slides Code Example"); + } + + @Override + public void init(IWorkbench workbench, IStructuredSelection selection) { + + } + + @Override + public void addPages() { + super.addPages(); + wizardPage = new AsposeExampleWizardPage(); + addPage(wizardPage); + } + + @Override + public boolean performFinish() { + + String selectedProjectPath = wizardPage.getSelectedProjectPath(); + String exampleCategory = wizardPage.getSelectedExampleCategory(); + IProject project = wizardPage.getIProject(); + + AsposeExampleSupport asposeExampleSupport = new AsposeExampleSupport(selectedProjectPath, exampleCategory, + project); + try { + new ProgressMonitorDialog(this.getShell()).run(true, false, asposeExampleSupport); + } catch (InvocationTargetException | InterruptedException e) { + e.printStackTrace(); + } + + return true; + } + +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/examples/AsposeExampleWizardPage.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/examples/AsposeExampleWizardPage.java new file mode 100644 index 00000000..d9089d43 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/examples/AsposeExampleWizardPage.java @@ -0,0 +1,302 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.examples; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.net.URI; +import java.util.LinkedList; +import java.util.Queue; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.fieldassist.ControlDecoration; +import org.eclipse.jface.fieldassist.FieldDecoration; +import org.eclipse.jface.fieldassist.FieldDecorationRegistry; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.swt.widgets.TreeItem; +import org.eclipse.swt.widgets.Label; +import org.eclipse.wb.swt.SWTResourceManager; +import com.aspose.slides.Activator; +import com.aspose.slides.maven.utils.AsposeConstants; +import com.aspose.slides.maven.utils.AsposeJavaAPI; +import com.aspose.slides.maven.utils.AsposeMavenProjectManager; +import com.aspose.slides.maven.utils.AsposeSlidesJavaAPI; +import com.aspose.slides.maven.utils.FormatExamples; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.ModifyEvent; + +public class AsposeExampleWizardPage extends WizardPage { + + private Combo cbProject; + private Combo cbVersion; + private Tree examplesTree; + + private ControlDecoration cbProjectDecoration; + private ControlDecoration cbVersionDecoration; + private ControlDecoration examplesTreeDecoration; + + /** + * Create the wizard. + */ + public AsposeExampleWizardPage() { + super("wizardPage"); + setTitle("New Aspose.Slides Code Example"); + setDescription("Aspose.Slides Java API - Code Examples"); + } + + public IProject getIProject() { + return (IProject) cbProject.getData(cbProject.getText()); + } + + public String getSelectedProjectPath() { + String projectPath = null; + try { + IProject project = (IProject) cbProject.getData(cbProject.getText()); + projectPath = project.getDescription().getLocationURI().getPath(); + + } catch (CoreException e) { + e.printStackTrace(); + } + return projectPath; + } + + public String getSelectedProjectName() { + return cbProject.getText(); + } + + public String getSelectedExampleCategory() { + String categoryFolderPath = examplesTree.getSelection()[0].getData().toString().replace('\\', '/'); + int index = categoryFolderPath.indexOf(AsposeExampleSupport.localExampleSourceFolder) + AsposeExampleSupport.localExampleSourceFolder.length() + 1; + return categoryFolderPath.substring(index, categoryFolderPath.length()); + } + + private void downloadExamplesRepo() { + // download code examples with status progress + try { + new ProgressMonitorDialog(this.getShell()).run(true, false, new IRunnableWithProgress() { + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { + monitor.beginTask("Downloading latest example categories...", IProgressMonitor.UNKNOWN); + + AsposeMavenProjectManager.initialize(null); + AsposeJavaAPI component = AsposeSlidesJavaAPI.initialize(AsposeMavenProjectManager.getInstance()); + component.checkAndUpdateRepo(); + + monitor.done(); + } + }); + } catch (InvocationTargetException | InterruptedException e) { + e.printStackTrace(); + } + } + + private void initControls() { + + downloadExamplesRepo(); + + IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); + URI path = null; + try { + for (IProject project : projects) { + path = project.getDescription().getLocationURI(); + if (path != null) { + cbProject.add(project.getDescription().getName()); + cbProject.setData(project.getDescription().getName(), project); + } + } + cbProjectDecoration.hide(); + setPageComplete(true); + if (cbProject.getItemCount() == 0) { + cbProject.add(AsposeConstants.API_PROJECT_NOT_FOUND); + cbProjectDecoration.show(); + setPageComplete(false); + } + + cbProject.select(0); + } catch (CoreException e) { + e.printStackTrace(); + } + } + + private void initDecorators() { + FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault() + .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR); + + cbProjectDecoration = new ControlDecoration(cbProject, SWT.TOP | SWT.RIGHT); + cbProjectDecoration.setImage(fieldDecoration.getImage()); + cbProjectDecoration.setDescriptionText("Please first create a Maven project"); + cbProjectDecoration.hide(); + + cbVersionDecoration = new ControlDecoration(cbVersion, SWT.TOP | SWT.RIGHT); + cbVersionDecoration.setImage(fieldDecoration.getImage()); + cbVersionDecoration.setDescriptionText( + "Please first add maven dependency of " + AsposeConstants.API_NAME + " for java API"); + cbVersionDecoration.hide(); + + examplesTreeDecoration = new ControlDecoration(examplesTree, SWT.TOP | SWT.RIGHT); + examplesTreeDecoration.setImage(fieldDecoration.getImage()); + examplesTreeDecoration.setDescriptionText("Please select one example category"); + examplesTreeDecoration.hide(); + } + + private void onProjectModify() { + try { + cbVersion.removeAll(); + IProject selectedProject = (IProject) cbProject.getData(cbProject.getText()); + if (selectedProject != null) { + String versionNo = AsposeMavenProjectManager.getInstance().getDependencyVersionFromPOM( + selectedProject.getDescription().getLocationURI(), AsposeConstants.API_MAVEN_DEPENDENCY); + cbVersionDecoration.hide(); + setPageComplete(true); + if (versionNo == null) { + cbVersionDecoration.show(); + setPageComplete(false); + } + if (versionNo == null) { + versionNo = AsposeConstants.API_DEPENDENCY_NOT_FOUND; + } + cbVersion.add(versionNo); + cbVersion.select(0); + } + } catch (CoreException e) { + e.printStackTrace(); + } + + } + + private void onVersionModify() { + try { + examplesTree.removeAll(); + if (!cbVersion.getText().equals(AsposeConstants.API_DEPENDENCY_NOT_FOUND)) { + IProject selectedProject = (IProject) cbProject.getData(cbProject.getText()); + if (selectedProject != null) { + AsposeMavenProjectManager.initialize(new File(selectedProject.getDescription().getLocationURI())); + AsposeJavaAPI component = AsposeSlidesJavaAPI.initialize(AsposeMavenProjectManager.getInstance()); + populateExamplesTree(component); + examplesTreeDecoration.show(); + setPageComplete(false); + } + } + } catch (CoreException e) { + e.printStackTrace(); + } + } + + private void onTreeSelection() { + examplesTreeDecoration.show(); + setPageComplete(false); + TreeItem[] selectedItems = examplesTree.getSelection(); + if (selectedItems[0].getParentItem() != null && selectedItems[0].getItemCount() > 0) { + examplesTreeDecoration.hide(); + setPageComplete(true); + } + } + + /** + * + * @param asposeComponent + * @param top + * @param panel + */ + public void populateExamplesTree(AsposeJavaAPI asposeComponent) { + String examplesFullPath = asposeComponent.getLocalRepositoryPath() + File.separator + + AsposeConstants.GITHUB_EXAMPLES_SOURCE_LOCATION; + File directory = new File(examplesFullPath); + examplesTree.removeAll(); + Queue queue = new LinkedList<>(); + queue.add(new Object[] { null, directory }); + TreeItem top = new TreeItem(examplesTree, 0); + top.setText("Aspose.Slides"); + + while (!queue.isEmpty()) { + Object[] _entry = queue.remove(); + File childFile = ((File) _entry[1]); + TreeItem parentItem = (TreeItem) _entry[0]; + if (childFile.isDirectory()) { + if (parentItem != null) { + TreeItem child = new TreeItem(parentItem, SWT.NONE); + child.setText(FormatExamples.formatTitle(childFile.getName())); + child.setData(childFile); + parentItem = child; + } else { + parentItem = top; + } + for (File f : childFile.listFiles()) { + queue.add(new Object[] { parentItem, f }); + } + } else if (childFile.isFile()) { + TreeItem child = new TreeItem(parentItem, SWT.NONE); + child.setText(FormatExamples.formatTitle(childFile.getName())); + } + } + } + + /** + * Create contents of the wizard. + * + * @param parent + */ + public void createControl(Composite parent) { + Composite container = new Composite(parent, SWT.NULL); + + setControl(container); + + cbProject = new Combo(container, SWT.READ_ONLY); + cbProject.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + onProjectModify(); + } + }); + cbProject.setBounds(181, 101, 323, 23); + + examplesTree = new Tree(container, SWT.BORDER); + examplesTree.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + onTreeSelection(); + } + }); + examplesTree.setBounds(10, 170, 494, 206); + + Label label = new Label(container, SWT.NONE); + label.setImage(SWTResourceManager.getImage(Activator.getResourceFilePath("long_banner.png"))); + label.setBounds(10, 0, 500, 80); + + Label lblProject = new Label(container, SWT.NONE); + lblProject.setBounds(134, 104, 40, 15); + lblProject.setText("Project:"); + + Label lblAsposeslidesForJava = new Label(container, SWT.NONE); + lblAsposeslidesForJava.setBounds(5, 131, 170, 15); + lblAsposeslidesForJava.setText("Aspose.Slides for Java (version):"); + + cbVersion = new Combo(container, SWT.READ_ONLY); + cbVersion.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + onVersionModify(); + } + }); + cbVersion.setBounds(181, 128, 323, 23); + + initDecorators(); + initControls(); + } +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/AsposeConstants.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/AsposeConstants.java new file mode 100644 index 00000000..3656610b --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/AsposeConstants.java @@ -0,0 +1,146 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.utils; + +/* + * @author Adeel Ilyas + */ +import java.io.File; + +/** + * + * @author Adeel + */ +public class AsposeConstants { + + /** + * + */ + public static final String API_NAME = "Aspose.Slides"; + + /** + * + */ + public static final String API_MAVEN_DEPENDENCY = "aspose-slides"; + + /** + * + */ + public static final String API_EXAMPLES_PACKAGE = "com" + File.separator + API_MAVEN_DEPENDENCY.replace("-", File.separator) + File.separator + "examples"; + + /** + * + */ + public static final String GITHUB_EXAMPLES_SOURCE_LOCATION = "Examples" + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator + API_EXAMPLES_PACKAGE; + + /** + * + */ + public static final String GITHUB_EXAMPLES_RESOURCES_LOCATION = "Examples" + File.separator + "src" + File.separator + "main" + File.separator + "resources" + File.separator + API_EXAMPLES_PACKAGE; + + /** + * + */ + public static final String PROJECT_EXAMPLES_SOURCE_LOCATION = "src" + File.separator + "main" + File.separator + "java" + File.separator + API_EXAMPLES_PACKAGE; + + /** + * + */ + public static final String PROJECT_EXAMPLES_RESOURCES_LOCATION = "src" + File.separator + "main" + File.separator + "resources" + File.separator + API_EXAMPLES_PACKAGE; + + /** + * + */ + public static final String EXAMPLES_UTIL = GITHUB_EXAMPLES_SOURCE_LOCATION + File.separator + "Utils.java"; + + /** + * + */ + public static final String API_DEPENDENCY_NOT_FOUND = "Dependency not found!"; + + public static final String API_PROJECT_NOT_FOUND = "No projects found!"; + + /** + * + */ + public static final String MAVEN_POM_XML = "pom.xml"; + + /** + * + */ + public static final String WIZARD_NAME = "Aspose.Slides Maven Project"; + + /** + * + */ + public static final String ASPOSE_SELECT_EXAMPLE = "Please just select one examples category"; + + /** + * + */ + public static final String INTERNET_CONNNECTIVITY_PING_URL = "java.sun.com"; + + /** + * + */ + public static final String ASPOSE_MAVEN_REPOSITORY = "https://repository.aspose.com"; + + /** + * + */ + public static final String ASPOSE_GROUP_ID = "com.aspose"; + + /** + * + */ + public static final String INTERNET_REQUIRED_MSG = "Internet connectivity is not available!\nInternet connectivity is required to retrieve latest Aspose.Slides Maven Artifact"; + + /** + * + */ + public static final String EXAMPLES_INTERNET_REQUIRED_MSG = "Internet connectivity is required to download examples"; + + /** + * + */ + public static final String MAVEN_ARTIFACTS_RETRIEVE_FAIL = "Unknown Error!\nCould not retrieve latest Aspose.Slides Maven Artifact!"; + + /** + * + */ + public static final String EXAMPLES_DOWNLOAD_FAIL = "Unknown Error!\nCould not download Aspose.Slides for Java API example Source codes!"; + + /** + * + */ + public static final String EXAMPLES_NOT_AVAILABLE_MSG = "This component does not have examples yet, We will add examples soon"; + + /** + * + */ + public static final String EXAMPLES_NOT_AVAILABLE_TITLE = "Examples not available"; + + /** + * + */ + public static boolean printingAllowed = false; + + /** + * + * @param message + */ + public static final void println(String message) { + if (printingAllowed) { + System.out.println(message); + } + } +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/AsposeJavaAPI.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/AsposeJavaAPI.java new file mode 100644 index 00000000..f458b56d --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/AsposeJavaAPI.java @@ -0,0 +1,159 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.utils; + +import javax.swing.*; +import java.io.File; + + +public abstract class AsposeJavaAPI { + + /** + * + * @return + */ + public abstract String get_name(); + + /** + * + * @return + */ + public abstract String get_mavenRepositoryURL(); + + /** + * + * @return + */ + public abstract String get_remoteExamplesRepository(); + + /** + * + * @return + */ + public boolean isExamplesNotAvailable() { + return examplesNotAvailable; + } + + /** + * + */ + public boolean examplesNotAvailable; + + /** + * + * @return + */ + public boolean isExamplesDefinitionAvailable() { + return examplesDefinitionAvailable; + } + + /** + * + */ + public boolean examplesDefinitionAvailable; + + /** + * + */ + public AsposeMavenProjectManager asposeMavenProjectManager; + + /** + * + * @param p + */ + public void checkAndUpdateRepo() { + + if (null == get_remoteExamplesRepository()) { + AsposeMavenProjectManager.showMessage(AsposeConstants.EXAMPLES_NOT_AVAILABLE_TITLE, get_name() + " - " + AsposeConstants.EXAMPLES_NOT_AVAILABLE_MSG, JOptionPane.CLOSED_OPTION, JOptionPane.INFORMATION_MESSAGE); + examplesNotAvailable = true; + examplesDefinitionAvailable = false; + return; + } else { + examplesNotAvailable = false; + } + + if (isExamplesDefinitionsPresent()) { + try { + examplesDefinitionAvailable = true; + syncRepository(); + } catch (Exception e) { + } + } else { + updateRepository(); + if (isExamplesDefinitionsPresent()) { + examplesDefinitionAvailable = true; + + } + } + } + + /** + * + * @param p + * @return + */ + public boolean downloadExamples() { + try { + checkAndUpdateRepo(); + } catch (Exception rex) { + rex.printStackTrace(); + return false; + } + + return true; + + } + + /** + * + * @param p + */ + public void updateRepository() { + AsposeMavenProjectManager.checkAndCreateFolder(getLocalRepositoryPath()); + + try { + GitHelper.updateRepository(getLocalRepositoryPath(), get_remoteExamplesRepository()); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * + * @param p + */ + public void syncRepository() { + try { + GitHelper.syncRepository(getLocalRepositoryPath(), get_remoteExamplesRepository()); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * + * @return boolean + */ + public boolean isExamplesDefinitionsPresent() { + return new File(getLocalRepositoryPath()).exists(); + } + + /** + * + * @return String + */ + public String getLocalRepositoryPath() { + return asposeMavenProjectManager.getAsposeHomePath() + "GitConsRepos" + File.separator + get_name(); + } +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/AsposeMavenProjectManager.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/AsposeMavenProjectManager.java new file mode 100644 index 00000000..434f1ede --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/AsposeMavenProjectManager.java @@ -0,0 +1,506 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.utils; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.net.HttpURLConnection; +import java.net.URI; +import java.net.URL; +import java.net.URLConnection; +import java.util.ArrayList; +import java.util.List; +import javax.swing.JOptionPane; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpression; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import com.aspose.slides.maven.artifacts.Metadata; + +public class AsposeMavenProjectManager { + + private File projectDir = null; + + private static final List asposeProjectMavenDependencies = new ArrayList(); + + /** + * + * @return + */ + public static List getAsposeProjectMavenDependencies() { + return asposeProjectMavenDependencies; + } + + /** + * + */ + public static void clearAsposeProjectMavenDependencies() { + asposeProjectMavenDependencies.clear(); + } + + /** + * + * @return + */ + public File getProjectDir() { + return projectDir; + } + + public String getDependencyVersionFromPOM(URI projectDir, String dependencyName) { + try { + String mavenPomXmlfile = projectDir.getPath() + File.separator + AsposeConstants.MAVEN_POM_XML; + + if (new File(mavenPomXmlfile).exists()) { + Document pomDocument = getXmlDocument(mavenPomXmlfile); + + XPathFactory xPathfactory = XPathFactory.newInstance(); + XPath xpath = xPathfactory.newXPath(); + String expression = "//version[ancestor::dependency/artifactId[text()='" + dependencyName + "']]"; + XPathExpression xPathExpr = xpath.compile(expression); + NodeList nl = (NodeList) xPathExpr.evaluate(pomDocument, XPathConstants.NODESET); + + if (nl != null && nl.getLength() > 0) { + return nl.item(0).getTextContent(); + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } + return null; + } + + private Document getXmlDocument(String mavenPomXmlfile) + throws ParserConfigurationException, SAXException, IOException { + DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); + Document pomDocument = (Document) docBuilder.parse(mavenPomXmlfile); + + return pomDocument; + } + + public String getAsposeHomePath() { + return System.getProperty("user.home") + File.separator + "aspose" + File.separator; + } + + /** + * + * @param folderPath + */ + public static void checkAndCreateFolder(String folderPath) { + File folder = new File(folderPath); + if (!folder.exists()) { + folder.mkdirs(); + } + } + + // Singleton instance + private static AsposeMavenProjectManager asposeMavenProjectManager = new AsposeMavenProjectManager(); + + /** + * + * @return + */ + public static AsposeMavenProjectManager getInstance() { + return asposeMavenProjectManager; + } + + /** + * + * @param mavenPomXmlfile + * @param excludeGroup + * @return + */ + public NodeList getDependenciesFromPOM(String mavenPomXmlfile, String excludeGroup) { + try { + Document pomDocument = getXmlDocument(mavenPomXmlfile); + + XPathFactory xPathfactory = XPathFactory.newInstance(); + XPath xpath = xPathfactory.newXPath(); + String expression = "//dependency[child::groupId[text()!='" + excludeGroup + "']]"; + XPathExpression xPathExpr = xpath.compile(expression); + NodeList nl = (NodeList) xPathExpr.evaluate(pomDocument, XPathConstants.NODESET); + if (nl != null && nl.getLength() > 0) { + return nl; + } + } catch (IOException | ParserConfigurationException | SAXException | XPathExpressionException e) { + e.printStackTrace(); + } + return null; + } + + /** + * + * @param addTheseDependencies + */ + public void addMavenDependenciesInProject(NodeList addTheseDependencies) { + + String mavenPomXmlfile = projectDir.getPath() + File.separator + AsposeConstants.MAVEN_POM_XML; + + try { + Document pomDocument = getXmlDocument(mavenPomXmlfile); + Node dependenciesNode = pomDocument.getElementsByTagName("dependencies").item(0); + + if (addTheseDependencies != null && addTheseDependencies.getLength() > 0) { + for (int n = 0; n < addTheseDependencies.getLength(); n++) { + String artifactId = addTheseDependencies.item(n).getFirstChild().getNextSibling().getNextSibling() + .getNextSibling().getFirstChild().getNodeValue(); + + XPathFactory xPathfactory = XPathFactory.newInstance(); + XPath xpath = xPathfactory.newXPath(); + String expression = "//artifactId[text()='" + artifactId + "']"; + + XPathExpression xPathExpr = xpath.compile(expression); + + Node dependencyAlreadyExist = (Node) xPathExpr.evaluate(pomDocument, XPathConstants.NODE); + + if (dependencyAlreadyExist != null) { + Node dependencies = pomDocument.getElementsByTagName("dependencies").item(0); + dependencies.removeChild(dependencyAlreadyExist.getParentNode()); + } + + Node importedNode = pomDocument.importNode(addTheseDependencies.item(n), true); + dependenciesNode.appendChild(importedNode); + } + } + removeEmptyLinesfromDOM(pomDocument); + writeToPOM(pomDocument); + + } catch (ParserConfigurationException | SAXException | XPathExpressionException | IOException ex) { + ex.printStackTrace(); + } + } + + /** + * + * @return + */ + private boolean retrieveAsposeMavenDependencies() { + try { + getAsposeProjectMavenDependencies().clear(); + AsposeJavaAPI component = AsposeSlidesJavaAPI.getInstance(); + Metadata productMavenDependency = getProductMavenDependency(component.get_mavenRepositoryURL()); + if (productMavenDependency != null) { + getAsposeProjectMavenDependencies().add(productMavenDependency); + } + + } catch (Exception rex) { + rex.printStackTrace(); + return false; + } + return !getAsposeProjectMavenDependencies().isEmpty(); + } + + public void configureProjectMavenPOM(String groupId, String artifactId, String version) throws IOException { + + AsposeSlidesJavaAPI.initialize(asposeMavenProjectManager); + retrieveAsposeMavenDependencies(); + + try { + String mavenPomXmlfile = projectDir.getPath() + File.separator + AsposeConstants.MAVEN_POM_XML; + Document doc = getXmlDocument(mavenPomXmlfile); + + Element root = doc.getDocumentElement(); + Node node = root.getElementsByTagName("groupId").item(0); + node.setTextContent(groupId); + + node = root.getElementsByTagName("artifactId").item(0); + node.setTextContent(artifactId); + + node = root.getElementsByTagName("version").item(0); + node.setTextContent(version); + + updateProjectPom(doc); + writeToPOM(doc); + + } catch (ParserConfigurationException | SAXException e) { + e.printStackTrace(); + } + + } + + private void updateProjectPom(Document pomDocument) { + + // Get the root element + Node projectNode = pomDocument.getFirstChild(); + + // Adding Dependencies here + Element dependenciesTag = pomDocument.createElement("dependencies"); + projectNode.appendChild(dependenciesTag); + + for (Metadata dependency : getAsposeProjectMavenDependencies()) { + addAsposeMavenDependency(pomDocument, dependenciesTag, dependency); + } + } + + private void addAsposeMavenDependency(Document doc, Element dependenciesTag, Metadata dependency) { + Element dependencyTag = doc.createElement("dependency"); + dependenciesTag.appendChild(dependencyTag); + + Element groupIdTag = doc.createElement("groupId"); + groupIdTag.appendChild(doc.createTextNode(dependency.getGroupId())); + dependencyTag.appendChild(groupIdTag); + + Element artifactId = doc.createElement("artifactId"); + artifactId.appendChild(doc.createTextNode(dependency.getArtifactId())); + dependencyTag.appendChild(artifactId); + Element version = doc.createElement("version"); + version.appendChild(doc.createTextNode(dependency.getVersioning().getLatest())); + dependencyTag.appendChild(version); + if (dependency.getClassifier() != null) { + Element classifer = doc.createElement("classifier"); + classifer.appendChild(doc.createTextNode(dependency.getClassifier())); + dependencyTag.appendChild(classifer); + } + } + + /** + * + * @param Url + * @return + * @throws IOException + */ + public String readURLContents(String Url) throws IOException { + URL url = new URL(Url); + URLConnection con = url.openConnection(); + InputStream in = con.getInputStream(); + String encoding = con.getContentEncoding(); + encoding = encoding == null ? "UTF-8" : encoding; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] buf = new byte[8192]; + int len = 0; + while ((len = in.read(buf)) != -1) { + baos.write(buf, 0, len); + } + String body = new String(baos.toByteArray(), encoding); + return body; + } + + /** + * + * @param productMavenRepositoryUrl + * @return + */ + public Metadata getProductMavenDependency(String productMavenRepositoryUrl) { + final String mavenMetaDataFileName = "maven-metadata.xml"; + Metadata data = new Metadata(); + + try { + String productMavenInfo; + productMavenInfo = readURLContents(productMavenRepositoryUrl + mavenMetaDataFileName); + + DocumentBuilder dBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + Document doc = dBuilder.parse(new InputSource(new StringReader(productMavenInfo))); + + String groupId = XPathFactory.newInstance().newXPath().compile("//metadata/groupId").evaluate(doc); + String artifactId = XPathFactory.newInstance().newXPath().compile("//metadata/artifactId").evaluate(doc); + String version = XPathFactory.newInstance().newXPath().compile("//metadata/version").evaluate(doc); + String latest = XPathFactory.newInstance().newXPath().compile("//metadata/versioning/latest").evaluate(doc); + + data.setArtifactId(artifactId); + data.setGroupId(groupId); + data.setVersion(version); + + Metadata.Versioning ver = new Metadata.Versioning(); + ver.setLatest(latest); + data.setVersioning(ver); + + String remoteArtifactFile = productMavenRepositoryUrl + data.getVersioning().getLatest() + "/" + + data.getArtifactId() + "-" + data.getVersioning().getLatest(); + + if (!remoteFileExists(remoteArtifactFile + ".jar")) { + AsposeConstants.println("Not Exists"); + data.setClassifier(getResolveSupportedJDK(remoteArtifactFile)); + } else { + AsposeConstants.println("Exists"); + } + } catch (Exception ex) { + ex.printStackTrace(); + data = null; + } + return data; + } + + /** + * + * @param URLName + * @return + */ + public boolean remoteFileExists(String URLName) { + try { + HttpURLConnection.setFollowRedirects(false); + // note : you may also need + // HttpURLConnection.setInstanceFollowRedirects(false) + HttpURLConnection con = (HttpURLConnection) new URL(URLName).openConnection(); + con.setRequestMethod("HEAD"); + return (con.getResponseCode() == HttpURLConnection.HTTP_OK); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * + * @param ProductURL + * @return + */ + public String getResolveSupportedJDK(String ProductURL) { + String supportedJDKs[] = { "jdk17", "jdk16", "jdk15", "jdk14", "jdk18" }; + String classifier = null; + for (String jdkCheck : supportedJDKs) { + if (remoteFileExists(ProductURL + "-" + jdkCheck + ".jar")) { + AsposeConstants.println("Exists"); + classifier = jdkCheck; + break; + } else { + AsposeConstants.println("Not Exists"); + } + } + return classifier; + } + + /** + * + * @param mavenPomXmlfile + * @param excludeURL + * @return + */ + public NodeList getRepositoriesFromPOM(String mavenPomXmlfile, String excludeURL) { + try { + Document pomDocument = getXmlDocument(mavenPomXmlfile); + XPathFactory xPathfactory = XPathFactory.newInstance(); + XPath xpath = xPathfactory.newXPath(); + String expression = "//repository[child::url[not(starts-with(.,'" + excludeURL + "'))]]"; + XPathExpression xPathExpr = xpath.compile(expression); + NodeList nl = (NodeList) xPathExpr.evaluate(pomDocument, XPathConstants.NODESET); + if (nl != null && nl.getLength() > 0) { + return nl; + } + } catch (IOException | ParserConfigurationException | SAXException | XPathExpressionException e) { + e.printStackTrace(); + } + return null; + } + + /** + * + * @param addTheseRepositories + */ + public void addMavenRepositoriesInProject(NodeList addTheseRepositories) { + String mavenPomXmlfile = projectDir.getPath() + File.separator + AsposeConstants.MAVEN_POM_XML; + try { + Document pomDocument = getXmlDocument(mavenPomXmlfile); + + Node repositoriesNode = pomDocument.getElementsByTagName("repositories").item(0); + + if (addTheseRepositories != null && addTheseRepositories.getLength() > 0) { + for (int n = 0; n < addTheseRepositories.getLength(); n++) { + String repositoryId = addTheseRepositories.item(n).getFirstChild().getNextSibling().getFirstChild() + .getNodeValue(); + + XPathFactory xPathfactory = XPathFactory.newInstance(); + XPath xpath = xPathfactory.newXPath(); + String expression = "//id[text()='" + repositoryId + "']"; + + XPathExpression xPathExpr = xpath.compile(expression); + + Boolean repositoryAlreadyExist = (Boolean) xPathExpr.evaluate(pomDocument, XPathConstants.BOOLEAN); + + if (!repositoryAlreadyExist) { + Node importedNode = pomDocument.importNode(addTheseRepositories.item(n), true); + repositoriesNode.appendChild(importedNode); + } + + } + } + removeEmptyLinesfromDOM(pomDocument); + writeToPOM(pomDocument); + + } catch (XPathExpressionException | SAXException | ParserConfigurationException | IOException ex) { + ex.printStackTrace(); + } + } + + /** + * + * @param pomDocument + * @throws IOException + */ + public void writeToPOM(Document pomDocument) throws IOException { + try { + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer transformer = tFactory.newTransformer(); + DOMSource source = new DOMSource(pomDocument); + + StreamResult result = new StreamResult( + new File(projectDir + File.separator + AsposeConstants.MAVEN_POM_XML)); + transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no"); + transformer.setOutputProperty(OutputKeys.METHOD, "xml"); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); + + transformer.transform(source, result); + } catch (TransformerException e) { + e.printStackTrace(); + } + } + + private void removeEmptyLinesfromDOM(Document doc) throws XPathExpressionException { + XPath xp = XPathFactory.newInstance().newXPath(); + NodeList nl = (NodeList) xp.evaluate("//text()[normalize-space(.)='']", doc, XPathConstants.NODESET); + + for (int i = 0; i < nl.getLength(); ++i) { + Node node = nl.item(i); + node.getParentNode().removeChild(node); + } + } + + /** + * + * @param title + * @param message + * @param buttons + * @param icon + * @return + */ + public static int showMessage(String title, String message, int buttons, int icon) { + int result = JOptionPane.showConfirmDialog(null, message, title, buttons, icon); + return result; + } + + public static AsposeMavenProjectManager initialize(File prjDir) { + asposeMavenProjectManager = new AsposeMavenProjectManager(); + asposeMavenProjectManager.projectDir = prjDir; + return asposeMavenProjectManager; + } + +} \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/AsposeSlidesJavaAPI.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/AsposeSlidesJavaAPI.java new file mode 100644 index 00000000..8ffe39ea --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/AsposeSlidesJavaAPI.java @@ -0,0 +1,78 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.utils; + +/* + * @author Adeel Ilyas + * + */ +// Singleton Class + +/** + * + * @author Adeel + */ +public class AsposeSlidesJavaAPI extends AsposeJavaAPI { + + private final String _name = AsposeConstants.API_NAME; + private final String _mavenRepositoryURL = "https://repository.aspose.com/repo/com/aspose/aspose-slides/"; + private final String _remoteExamplesRepository = "https://github.com/aspose-slides/Aspose.Slides-for-Java"; + + /** + * @return the _name + */ + @Override + public String get_name() { + return _name; + } + + /** + * @return the _mavenRepositoryURL + */ + @Override + public String get_mavenRepositoryURL() { + return _mavenRepositoryURL; + } + + /** + * @return the _remoteExamplesRepository + */ + @Override + public String get_remoteExamplesRepository() { + return _remoteExamplesRepository; + } + + // Singleton instance + private static AsposeJavaAPI asposeSlidesAPI; + + /** + * + * @return + */ + public static AsposeJavaAPI getInstance() { + return asposeSlidesAPI; + } + + /** + * + * @param asposeMavenProjectManager + * @return + */ + public static AsposeJavaAPI initialize(AsposeMavenProjectManager asposeMavenProjectManager) { + asposeSlidesAPI = new AsposeSlidesJavaAPI(); + asposeSlidesAPI.asposeMavenProjectManager = asposeMavenProjectManager; + return asposeSlidesAPI; + } + + private AsposeSlidesJavaAPI() { + } +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/FormatExamples.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/FormatExamples.java new file mode 100644 index 00000000..c4017f8e --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/FormatExamples.java @@ -0,0 +1,30 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.utils; + +import org.apache.commons.lang.WordUtils; + +public class FormatExamples { + + /** + * + * @param inputStr + * @return + */ + public static String formatTitle(String inputStr) { + String title = inputStr.replaceAll("(_|.java|\\.)", " "); + title = title.replaceAll("([A-Z])", " $1"); + title = WordUtils.capitalize(title); + + return title; + } +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/GitHelper.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/GitHelper.java new file mode 100644 index 00000000..69e01882 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/GitHelper.java @@ -0,0 +1,81 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.aspose.slides.maven.utils; + +import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.internal.storage.file.FileRepository; +import org.eclipse.jgit.lib.Repository; + +import java.io.File; + +/** + * @author Adeel Ilyas + * + */ +@SuppressWarnings("restriction") +public class GitHelper { + + /** + * + * @param localPath + * @param remotePath + * @throws Exception + */ + public static void updateRepository(String localPath, String remotePath) throws Exception { + Repository localRepo; + try { + localRepo = new FileRepository(localPath + "/.git"); + + Git git = new Git(localRepo); + + // First try to clone the repository + try { + Git.cloneRepository().setURI(remotePath).setDirectory(new File(localPath)).call(); + } catch (Exception ex) { + // If clone fails, try to pull the changes + try { + git.pull().call(); + } catch (Exception exPull) { + // Pull also failed. Throw this exception to caller + throw exPull; // throw it + } + } finally { + git.close(); + } + } catch (Exception ex) { + throw new Exception("Could not download Repository from Github. Error: " + ex.getMessage()); + } + } + + /** + * + * @param localPath + * @param remotePath + * @throws Exception + */ + public static void syncRepository(String localPath, String remotePath) throws Exception { + Repository localRepo; + try { + localRepo = new FileRepository(localPath + "/.git"); + + Git git = new Git(localRepo); + + // Pull the changes + try { + git.pull().call(); + } catch (Exception exPull) { + // If pull failed. Throw this exception to caller + + throw exPull; // throw it + } finally { + git.close(); + } + + } catch (Exception ex) { + throw new Exception("Could not update Repository from Github. Error: " + ex.getMessage()); + } + } + +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/MavenSettings.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/MavenSettings.java new file mode 100644 index 00000000..4b1f6890 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/com/aspose/slides/maven/utils/MavenSettings.java @@ -0,0 +1,88 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 1998-2016 Aspose Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.aspose.slides.maven.utils; + +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.eclipse.core.runtime.preferences.InstanceScope; + +import com.aspose.slides.Activator; + +/** + * + * @author Adeel + */ +public final class MavenSettings { + + private static final String PROP_LAST_ARCHETYPE_GROUPID = "lastArchetypeGroupId"; + private static final String PROP_LAST_ARCHETYPE_VERSION = "lastArchetypeVersion"; + + private IEclipsePreferences getPreferences() { + return InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); + } + + /** + * + * @return + */ + public String getLastArchetypeGroupId() { + return getPreferences().get(PROP_LAST_ARCHETYPE_GROUPID, "com.mycompany"); + } + + /** + * + * @return + */ + public String getLastArchetypeVersion() { + return getPreferences().get(PROP_LAST_ARCHETYPE_VERSION, "1.0-SNAPSHOT"); + } + + /** + * + * @param version + */ + public void setLastArchetypeVersion(String version) { + putProperty(PROP_LAST_ARCHETYPE_VERSION, version); + } + + /** + * + * @param groupId + */ + public void setLastArchetypeGroupId(String groupId) { + putProperty(PROP_LAST_ARCHETYPE_GROUPID, groupId); + } + + private String putProperty(String key, String value) { + String retval = getProperty(key); + if (value != null) { + getPreferences().put(key, value); + } else { + getPreferences().remove(key); + } + return retval; + } + + private static final MavenSettings INSTANCE = new MavenSettings(); + + /** + * + * @return + */ + public static MavenSettings getDefault() { + return INSTANCE; + } + + private String getProperty(String key) { + return getPreferences().get(key, null); + } + +} diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/org/eclipse/wb/swt/SWTResourceManager.java b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/org/eclipse/wb/swt/SWTResourceManager.java new file mode 100644 index 00000000..d8a28580 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipsePlugin/src/org/eclipse/wb/swt/SWTResourceManager.java @@ -0,0 +1,447 @@ +/******************************************************************************* + * Copyright (c) 2011 Google, Inc. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Google, Inc. - initial API and implementation + *******************************************************************************/ +package org.eclipse.wb.swt; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Cursor; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.ImageData; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.widgets.Display; + +/** + * Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc. + *

+ * !!! IMPORTANT !!! Application code must explicitly invoke the dispose() method to release the + * operating system resources managed by cached objects when those objects and OS resources are no longer + * needed (e.g. on application shutdown) + *

+ * This class may be freely distributed as part of any application or plugin. + *

+ * @author scheglov_ke + * @author Dan Rubel + */ +public class SWTResourceManager { + //////////////////////////////////////////////////////////////////////////// + // + // Color + // + //////////////////////////////////////////////////////////////////////////// + private static Map m_colorMap = new HashMap(); + /** + * Returns the system {@link Color} matching the specific ID. + * + * @param systemColorID + * the ID value for the color + * @return the system {@link Color} matching the specific ID + */ + public static Color getColor(int systemColorID) { + Display display = Display.getCurrent(); + return display.getSystemColor(systemColorID); + } + /** + * Returns a {@link Color} given its red, green and blue component values. + * + * @param r + * the red component of the color + * @param g + * the green component of the color + * @param b + * the blue component of the color + * @return the {@link Color} matching the given red, green and blue component values + */ + public static Color getColor(int r, int g, int b) { + return getColor(new RGB(r, g, b)); + } + /** + * Returns a {@link Color} given its RGB value. + * + * @param rgb + * the {@link RGB} value of the color + * @return the {@link Color} matching the RGB value + */ + public static Color getColor(RGB rgb) { + Color color = m_colorMap.get(rgb); + if (color == null) { + Display display = Display.getCurrent(); + color = new Color(display, rgb); + m_colorMap.put(rgb, color); + } + return color; + } + /** + * Dispose of all the cached {@link Color}'s. + */ + public static void disposeColors() { + for (Color color : m_colorMap.values()) { + color.dispose(); + } + m_colorMap.clear(); + } + //////////////////////////////////////////////////////////////////////////// + // + // Image + // + //////////////////////////////////////////////////////////////////////////// + /** + * Maps image paths to images. + */ + private static Map m_imageMap = new HashMap(); + /** + * Returns an {@link Image} encoded by the specified {@link InputStream}. + * + * @param stream + * the {@link InputStream} encoding the image data + * @return the {@link Image} encoded by the specified input stream + */ + protected static Image getImage(InputStream stream) throws IOException { + try { + Display display = Display.getCurrent(); + ImageData data = new ImageData(stream); + if (data.transparentPixel > 0) { + return new Image(display, data, data.getTransparencyMask()); + } + return new Image(display, data); + } finally { + stream.close(); + } + } + /** + * Returns an {@link Image} stored in the file at the specified path. + * + * @param path + * the path to the image file + * @return the {@link Image} stored in the file at the specified path + */ + public static Image getImage(String path) { + Image image = m_imageMap.get(path); + if (image == null) { + try { + image = getImage(new FileInputStream(path)); + m_imageMap.put(path, image); + } catch (Exception e) { + image = getMissingImage(); + m_imageMap.put(path, image); + } + } + return image; + } + /** + * Returns an {@link Image} stored in the file at the specified path relative to the specified class. + * + * @param clazz + * the {@link Class} relative to which to find the image + * @param path + * the path to the image file, if starts with '/' + * @return the {@link Image} stored in the file at the specified path + */ + public static Image getImage(Class clazz, String path) { + String key = clazz.getName() + '|' + path; + Image image = m_imageMap.get(key); + if (image == null) { + try { + image = getImage(clazz.getResourceAsStream(path)); + m_imageMap.put(key, image); + } catch (Exception e) { + image = getMissingImage(); + m_imageMap.put(key, image); + } + } + return image; + } + private static final int MISSING_IMAGE_SIZE = 10; + /** + * @return the small {@link Image} that can be used as placeholder for missing image. + */ + private static Image getMissingImage() { + Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); + // + GC gc = new GC(image); + gc.setBackground(getColor(SWT.COLOR_RED)); + gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); + gc.dispose(); + // + return image; + } + /** + * Style constant for placing decorator image in top left corner of base image. + */ + public static final int TOP_LEFT = 1; + /** + * Style constant for placing decorator image in top right corner of base image. + */ + public static final int TOP_RIGHT = 2; + /** + * Style constant for placing decorator image in bottom left corner of base image. + */ + public static final int BOTTOM_LEFT = 3; + /** + * Style constant for placing decorator image in bottom right corner of base image. + */ + public static final int BOTTOM_RIGHT = 4; + /** + * Internal value. + */ + protected static final int LAST_CORNER_KEY = 5; + /** + * Maps images to decorated images. + */ + @SuppressWarnings("unchecked") + private static Map>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY]; + /** + * Returns an {@link Image} composed of a base image decorated by another image. + * + * @param baseImage + * the base {@link Image} that should be decorated + * @param decorator + * the {@link Image} to decorate the base image + * @return {@link Image} The resulting decorated image + */ + public static Image decorateImage(Image baseImage, Image decorator) { + return decorateImage(baseImage, decorator, BOTTOM_RIGHT); + } + /** + * Returns an {@link Image} composed of a base image decorated by another image. + * + * @param baseImage + * the base {@link Image} that should be decorated + * @param decorator + * the {@link Image} to decorate the base image + * @param corner + * the corner to place decorator image + * @return the resulting decorated {@link Image} + */ + public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) { + if (corner <= 0 || corner >= LAST_CORNER_KEY) { + throw new IllegalArgumentException("Wrong decorate corner"); + } + Map> cornerDecoratedImageMap = m_decoratedImageMap[corner]; + if (cornerDecoratedImageMap == null) { + cornerDecoratedImageMap = new HashMap>(); + m_decoratedImageMap[corner] = cornerDecoratedImageMap; + } + Map decoratedMap = cornerDecoratedImageMap.get(baseImage); + if (decoratedMap == null) { + decoratedMap = new HashMap(); + cornerDecoratedImageMap.put(baseImage, decoratedMap); + } + // + Image result = decoratedMap.get(decorator); + if (result == null) { + Rectangle bib = baseImage.getBounds(); + Rectangle dib = decorator.getBounds(); + // + result = new Image(Display.getCurrent(), bib.width, bib.height); + // + GC gc = new GC(result); + gc.drawImage(baseImage, 0, 0); + if (corner == TOP_LEFT) { + gc.drawImage(decorator, 0, 0); + } else if (corner == TOP_RIGHT) { + gc.drawImage(decorator, bib.width - dib.width, 0); + } else if (corner == BOTTOM_LEFT) { + gc.drawImage(decorator, 0, bib.height - dib.height); + } else if (corner == BOTTOM_RIGHT) { + gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height); + } + gc.dispose(); + // + decoratedMap.put(decorator, result); + } + return result; + } + /** + * Dispose all of the cached {@link Image}'s. + */ + public static void disposeImages() { + // dispose loaded images + { + for (Image image : m_imageMap.values()) { + image.dispose(); + } + m_imageMap.clear(); + } + // dispose decorated images + for (int i = 0; i < m_decoratedImageMap.length; i++) { + Map> cornerDecoratedImageMap = m_decoratedImageMap[i]; + if (cornerDecoratedImageMap != null) { + for (Map decoratedMap : cornerDecoratedImageMap.values()) { + for (Image image : decoratedMap.values()) { + image.dispose(); + } + decoratedMap.clear(); + } + cornerDecoratedImageMap.clear(); + } + } + } + //////////////////////////////////////////////////////////////////////////// + // + // Font + // + //////////////////////////////////////////////////////////////////////////// + /** + * Maps font names to fonts. + */ + private static Map m_fontMap = new HashMap(); + /** + * Maps fonts to their bold versions. + */ + private static Map m_fontToBoldFontMap = new HashMap(); + /** + * Returns a {@link Font} based on its name, height and style. + * + * @param name + * the name of the font + * @param height + * the height of the font + * @param style + * the style of the font + * @return {@link Font} The font matching the name, height and style + */ + public static Font getFont(String name, int height, int style) { + return getFont(name, height, style, false, false); + } + /** + * Returns a {@link Font} based on its name, height and style. Windows-specific strikeout and underline + * flags are also supported. + * + * @param name + * the name of the font + * @param size + * the size of the font + * @param style + * the style of the font + * @param strikeout + * the strikeout flag (warning: Windows only) + * @param underline + * the underline flag (warning: Windows only) + * @return {@link Font} The font matching the name, height, style, strikeout and underline + */ + public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) { + String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline; + Font font = m_fontMap.get(fontName); + if (font == null) { + FontData fontData = new FontData(name, size, style); + if (strikeout || underline) { + try { + Class logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$ + Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$ + if (logFont != null && logFontClass != null) { + if (strikeout) { + logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ + } + if (underline) { + logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ + } + } + } catch (Throwable e) { + System.err.println("Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + font = new Font(Display.getCurrent(), fontData); + m_fontMap.put(fontName, font); + } + return font; + } + /** + * Returns a bold version of the given {@link Font}. + * + * @param baseFont + * the {@link Font} for which a bold version is desired + * @return the bold version of the given {@link Font} + */ + public static Font getBoldFont(Font baseFont) { + Font font = m_fontToBoldFontMap.get(baseFont); + if (font == null) { + FontData fontDatas[] = baseFont.getFontData(); + FontData data = fontDatas[0]; + font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD); + m_fontToBoldFontMap.put(baseFont, font); + } + return font; + } + /** + * Dispose all of the cached {@link Font}'s. + */ + public static void disposeFonts() { + // clear fonts + for (Font font : m_fontMap.values()) { + font.dispose(); + } + m_fontMap.clear(); + // clear bold fonts + for (Font font : m_fontToBoldFontMap.values()) { + font.dispose(); + } + m_fontToBoldFontMap.clear(); + } + //////////////////////////////////////////////////////////////////////////// + // + // Cursor + // + //////////////////////////////////////////////////////////////////////////// + /** + * Maps IDs to cursors. + */ + private static Map m_idToCursorMap = new HashMap(); + /** + * Returns the system cursor matching the specific ID. + * + * @param id + * int The ID value for the cursor + * @return Cursor The system cursor matching the specific ID + */ + public static Cursor getCursor(int id) { + Integer key = Integer.valueOf(id); + Cursor cursor = m_idToCursorMap.get(key); + if (cursor == null) { + cursor = new Cursor(Display.getDefault(), id); + m_idToCursorMap.put(key, cursor); + } + return cursor; + } + /** + * Dispose all of the cached cursors. + */ + public static void disposeCursors() { + for (Cursor cursor : m_idToCursorMap.values()) { + cursor.dispose(); + } + m_idToCursorMap.clear(); + } + //////////////////////////////////////////////////////////////////////////// + // + // General + // + //////////////////////////////////////////////////////////////////////////// + /** + * Dispose of cached objects and their underlying OS resources. This should only be called when the cached + * objects are no longer needed (e.g. on application shutdown). + */ + public static void dispose() { + disposeColors(); + disposeImages(); + disposeFonts(); + disposeCursors(); + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipseSite/site.xml b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipseSite/site.xml new file mode 100644 index 00000000..5c56e787 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/AsposeSlidesEclipseSite/site.xml @@ -0,0 +1,14 @@ + + + + Aspose.Slides Maven Project wizard creates Maven Project for using Aspose.Slides for Java API within Eclipse IDE. +Aspose.Slides for Java is a unique PowerPoint management component that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint. +Aspose.Slides for Java is the first and only Java component that provides functionality to manage PowerPoint documents within your own applications. +Aspose.Slides Maven Project wizard fetch and configures the latest Maven dependency reference of Aspose.Slides for Java from the Aspose Cloud Maven Repository. +The wizard also gives you option to download the Code Examples to use Aspose.Slides for Java API. + + + + + + diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/LICENSE b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/LICENSE new file mode 100644 index 00000000..6d2e255f --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2001-2020 Aspose Pty Ltd + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/README.md b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/README.md new file mode 100644 index 00000000..04136709 --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/README.md @@ -0,0 +1,43 @@ +## Aspose.Slides Java (Maven) for Eclipse + +This project is **Eclipse IDE plugin** which lets developers use [Aspose.Slides for Java](https://products.aspose.com/slides/java) in their Maven based Java projects. + +## Who is supposed to use this **Plugin?** + +This Plugin is intended for developers using Maven platform for Java developments and want to use [Aspose.Slides for Java](https://products.aspose.com/slides/java) in their projects. + +**NOTE:** [Aspose.Slides for Java](https://products.aspose.com/slides/java) is Java API developed by [Aspose](http://aspose.com) that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint. For the API detailed features list check the [link](https://products.aspose.com/slides/java). + +## **Features** + +The plugin provides following features to work with [Aspose.Slides for Java](https://products.aspose.com/slides/java) API within **Eclipse IDE** comfortably: + +### Aspose.Slides Maven Project (wizard) +![plugin title shot](http://i.imgur.com/ZybtnEL.png) +* By using this wizard plugin creates Maven project for using [Aspose.Slides for Java](https://products.aspose.com/slides/java) from **New -> Project -> Maven-> Aspose.Slides Maven Project** +* The wizard will also give option for downloading latest available Code Examples for using the API. + +### Aspose.Slides Code Example (wizard) +![plugin title shot](http://i.imgur.com/K1LvEO4.png) +* By using this wizard plugin lets you copy the downloaded Code Examples into your project for using [Aspose.Slides for Java](https://products.aspose.com/slides/java) from **New -> Other -> Java -> Aspose.Slides Code Example** +* The wizard will also look for and updates for newly available Code Examples from [Aspose.Slides for Java examples repository.](https://github.com/asposeslides/Aspose_Slides_Java/tree/master/Examples) + **NOTE:** Selected Code Examples (category) source codes will be copied under **"com.aspose.slides.examples"** package. Resources needed for running examples will be copied to the corresponding directory (package) within **"src/main/resources"**. + +### Other Features + +* Supports **Eclipse Mars.1 (4.5.1) and later** versions +* Compatible with **Mac**, **Linux Flavors** and **Windows** +* Native IDE user experience +* Open Source + +## What is Aspose.Slides Java API? + +**Aspose.Slides for Java** is a unique PowerPoint management component that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint. + +**Aspose.Slides for Java** is the first and only Java component that provides functionality to manage PowerPoint documents within your own applications. As with all Aspose Java components, Aspose.Slides for Java is written in pure Java, incredibly priced and lightning fast. + +For more info about the **Aspose.Slides for Java API**, [please check the api documentation - click here](https://apireference.aspose.com/java/slides) + +## Plugin Documentation + +For the most complete documentation, [Please check this WIKI](https://docs.aspose.com/display/slidesjava/Aspose.Slides+Java+(Maven)+for+Eclipse) diff --git a/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/Release Notes.html b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/Release Notes.html new file mode 100644 index 00000000..3f590c9d --- /dev/null +++ b/Plugins/Aspose_Slides_Java_Maven_for_Eclipse/Release Notes.html @@ -0,0 +1,17 @@ + + + +Aspose.Slides Java (Maven) for Eclipse - Release Notes + + + + +Aspose.Slides Java (Maven) for Eclipse - v20.10 +

This is new Plugin for Eclipse IDE by Aspose. The Plugin intended for developers using Maven platform for Java developments and want to use Aspose.Slides for Java in their projects.

+

NOTE: Aspose.Slides for Java is Java API developed by Aspose that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint. For the API detailed features list check the link. +

The plugin provides following features to work with Aspose.Slides for Java API within Eclipse IDE comfortably: +

  • Aspose.Slides Maven Project
    • By using this wizard plugin creates Maven project for using Aspose.Slides for Java from New -> Project -> Maven-> Aspose.Slides Maven Project
    • The wizard will also give option for downloading latest available Code Examples for using the API.
  • +
  • Aspose.Slides Code Example
  • +
  • Other Features
    • Supports Eclipse Mars.1 (4.5.1) and later versions
    • Compatible with Mac, Linux Flavors and Windows
    • Native IDE user experience
    • Open Source
+ + \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/.name b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/.name deleted file mode 100644 index 9d11c84a..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -Aspose.Slides Java for IntelliJ Maven \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/compiler.xml b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/compiler.xml deleted file mode 100644 index 217af471..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/compiler.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/copyright/Aspose_Pty_Ltd.xml b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/copyright/Aspose_Pty_Ltd.xml deleted file mode 100644 index 98df6f8a..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/copyright/Aspose_Pty_Ltd.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/copyright/profiles_settings.xml b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/copyright/profiles_settings.xml deleted file mode 100644 index a776300d..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/dictionaries/Adeel_Ilyas.xml b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/dictionaries/Adeel_Ilyas.xml deleted file mode 100644 index ef47d47b..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/dictionaries/Adeel_Ilyas.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/encodings.xml b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/encodings.xml deleted file mode 100644 index e206d70d..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/misc.xml b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/misc.xml deleted file mode 100644 index 46f985f7..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/misc.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/modules.xml b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/modules.xml deleted file mode 100644 index 8550f68d..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/scopes/scope_settings.xml b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b8..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/uiDesigner.xml b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/uiDesigner.xml deleted file mode 100644 index 2eb9c987..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/uiDesigner.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/vcs.xml b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/vcs.xml deleted file mode 100644 index def6a6a1..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/workspace.xml b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/workspace.xml deleted file mode 100644 index 4a804a62..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/.idea/workspace.xml +++ /dev/null @@ -1,1112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Android Lint - - - General - - - Maven - - - Plugin DevKit - - - XPath - - - - - Abstraction issues - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - localhost - 5050 - - - - - - - - - - - - - 1395416125898 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Aspose Pty Ltd - - - - - - - - Detection - - - - - - - - - - - - - - - IDEA IC-135.690 - - - - - - - - Aspose.Slides Java for IntelliJ - - - - - - - - - - - - - - - org.eclipse.jgit-3.4.1.201406201815-r - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/Aspose.Slides Java for IntelliJ (Maven).iml b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/Aspose.Slides Java for IntelliJ (Maven).iml deleted file mode 100644 index 9654d6cd..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/Aspose.Slides Java for IntelliJ (Maven).iml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/README.md b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/README.md index 86aa2fb9..55c4f696 100644 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/README.md +++ b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/README.md @@ -20,8 +20,8 @@ The plugin contains two wizards: Aspose.Slides for Java is the first and only Java component that provides functionality to manage PowerPoint documents within your own applications. As with all Aspose Java components, Aspose.Slides for Java is written in pure Java, incredibly priced and lightning fast. -For more info about the **Aspose.Slides for Java API**, [please check the api documentation - click here](http://goo.gl/WU9cOL) +For more info about the **Aspose.Slides for Java API**, [please check the api documentation - click here](https://apireference.aspose.com/java/slides) ## Plugin Documentation -For the complete documentation of this Intellij IDEA plugin, [please go through this wiki - click here](http://www.aspose.com/docs/display/slidesjava/4.+Aspose.Slides+Java+for+IntelliJ+IDEA+%28Maven%29) \ No newline at end of file +For the complete documentation of this Intellij IDEA plugin, [please go through this wiki - click here](https://docs.aspose.com/display/slidesjava/Aspose.Slides+Java+for+IntelliJ+IDEA+-+Maven) diff --git a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/src/resources/maven/untitled.iml b/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/src/resources/maven/untitled.iml deleted file mode 100644 index c46d21f8..00000000 --- a/Plugins/Aspose_Slides_Java_for_IntelliJ(Maven)/src/resources/maven/untitled.iml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/Plugins/Aspose_Slides_Java_for_PHP/README.md b/Plugins/Aspose_Slides_Java_for_PHP/README.md index 476772ae..cf18caca 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/README.md +++ b/Plugins/Aspose_Slides_Java_for_PHP/README.md @@ -3,17 +3,13 @@ Aspose Slides Java for PHP is a PHP project that demonstrates / provides the Asp You will need to configure PHP/Java Bridge before using any of the Aspose provided Java APIs in PHP e.g Aspose.Words, Aspose.Cells and Aspose.Slides etc. -For the configuration/setup of PHP/Java Bridge, please see: - -http://php-java-bridge.sourceforge.net/pjb/index.php +For the configuration/setup of PHP/Java Bridge, please see [PHP Configuration](http://php-java-bridge.sourceforge.net/pjb/index.php) To download Aspose.Cells for Java API to be used with these examples through PHP/Java Bridge -Please navigate to: +Please navigate to [download section](http://maven.aspose.com/repository/simple/ext-release-local/com/aspose/aspose-slides/) -http://www.aspose.com/community/files/72/java-components/aspose.slides-for-java/ +For most complete documentation of the project, check [Aspose.Slides Java for PHP](https://docs.aspose.com/display/slidesjava/Aspose.Slides+Java+for+PHP) in confluence wiki. -For most complete documentation of the project, check Aspose.Slides Java for PHP confluence wiki link: -http://www.aspose.com/docs/display/slidesjava/5.+Aspose.Slides+Java+for+PHP diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithActiveXControls/AddActiveX.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithActiveXControls/AddActiveX.php index db59afbe..84dbcc9d 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithActiveXControls/AddActiveX.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithActiveXControls/AddActiveX.php @@ -1,29 +1,29 @@ -getSlides()->get_Item(0)->getControls()->addControl($controlType->WindowsMediaPlayer, 100, 100, 400, 400); - - # Access the Media Player ActiveX control and set the video path - $pres->getSlides()->get_Item(0)->getControls()->get_Item(0)->getProperties()->set_Item("URL" , $dataDir . "Wildlife.mp4"); - - # Write the presentation as a PPTX file - $saveFormat = new SaveFormat(); - $pres->save($dataDir . "AddActiveX.pptx", $saveFormat->Pptx); - - print "Added ActiveX control, please check the output file.".PHP_EOL; - } - +getSlides()->get_Item(0)->getControls()->addControl($controlType->WindowsMediaPlayer, 100, 100, 400, 400); + + # Access the Media Player ActiveX control and set the video path + $pres->getSlides()->get_Item(0)->getControls()->get_Item(0)->getProperties()->set_Item("URL" , $dataDir . "Wildlife.mp4"); + + # Write the presentation as a PPTX file + $saveFormat = new SaveFormat(); + $pres->save($dataDir . "AddActiveX.pptx", $saveFormat->Pptx); + + print "Added ActiveX control, please check the output file.".PHP_EOL; + } + } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartLegend.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartLegend.php index 8d6633d0..088f6b84 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartLegend.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartLegend.php @@ -1,55 +1,55 @@ -getSlides()->get_Item(0); - - # Add a clustered column chart on the slide - - $chartType=new ChartType(); - - $chart = $slide->getShapes()->addChart($chartType->ClusteredColumn, 50, 50, 500, 500); - - # Set Legend Properties - $chart->getLegend()->setX(50 / $chart->getWidth()); - $chart->getLegend()->setY (50 / $chart->getHeight()); - $chart->getLegend()->setWidth(100 / $chart->getWidth()); - $chart->getLegend()->setHeight(100 / $chart->getHeight()); - - # Saving the presentation - $save_format = new SaveFormat(); - $pres->save($dataDir . "Legend.pptx", $save_format->Pptx); - - print "Set custom location and size of chart legend, please check the output file.".PHP_EOL; - } +getSlides()->get_Item(0); + + # Add a clustered column chart on the slide + + $chartType=new ChartType(); + + $chart = $slide->getShapes()->addChart($chartType->ClusteredColumn, 50, 50, 500, 500); + + # Set Legend Properties + $chart->getLegend()->setX(50 / $chart->getWidth()); + $chart->getLegend()->setY (50 / $chart->getHeight()); + $chart->getLegend()->setWidth(100 / $chart->getWidth()); + $chart->getLegend()->setHeight(100 / $chart->getHeight()); + + # Saving the presentation + $save_format = new SaveFormat(); + $pres->save($dataDir . "Legend.pptx", $save_format->Pptx); + + print "Set custom location and size of chart legend, please check the output file.".PHP_EOL; + } } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartProperties.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartProperties.php index 1810d054..a496c1d3 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartProperties.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartProperties.php @@ -1,128 +1,128 @@ -getSlides()->get_Item(0); - - # Add chart with default data - $charType=new ChartType(); - $chart = $sld->getShapes()->addChart($charType->StackedColumn3D, 0, 0, 500, 500); - - # Getting the chart data worksheet - $fact = $chart->getChartData()->getChartDataWorkbook(); - - # Delete default generated series and categories - $chart->getChartData()->getSeries()->clear(); - $chart->getChartData()->getCategories()->clear(); - - # Adding new series - $chart->getChartData()->getSeries()->add($fact->getCell(0, 0, 1, "Series 1"), $chart->getType()); - $chart->getChartData()->getSeries()->add($fact->getCell(0, 0, 2, "Series 2"), $chart->getType()); - - # Adding new categories - $chart->getChartData()->getCategories()->add($fact->getCell(0, 1, 0, "Caetegoty 1")); - $chart->getChartData()->getCategories()->add($fact->getCell(0, 2, 0, "Caetegoty 2")); - $chart->getChartData()->getCategories()->add($fact->getCell(0, 3, 0, "Caetegoty 3")); - - # Set Rotation3D properties - $chart->getRotation3D()->setRightAngleAxes(true); - $chart->getRotation3D()->setRotationX(40); - $chart->getRotation3D()->setRotationY(270); - $chart->getRotation3D()->setDepthPercents(150); - - # Take first chart series - $series = $chart->getChartData()->getSeries()->get_Item(0); - - # Populating series data - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 1, 1, 20)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 2, 1, 50)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 3, 1, 30)); - - # Take second chart series - $series = $chart->getChartData()->getSeries()->get_Item(1); - - # Populating series data - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 1, 2, 30)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 2, 2, 10)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 3, 2, 60)); - - # Saving the presentation - $save_format = new SaveFormat(); - $pres->save($dataDir . "3Drotation.pptx", $save_format->Pptx); - - print "Done with rotation, please check the output file.".PHP_EOL; - } - - public static function set_gapwidth($dataDir=null){ - - $pres = new Presentation(); - - # Access first slide - $sld = $pres->getSlides()->get_Item(0); - - # Add chart with default data - $charType=new ChartType(); - $chart = $sld->getShapes()->addChart($charType->StackedColumn3D, 0, 0, 500, 500); - - # Getting the chart data worksheet - $fact = $chart->getChartData()->getChartDataWorkbook(); - - # Delete default generated series and categories - $chart->getChartData()->getSeries()->clear(); - $chart->getChartData()->getCategories()->clear(); - - # Adding new series - $chart->getChartData()->getSeries()->add($fact->getCell(0, 0, 1, "Series 1"), $chart->getType()); - $chart->getChartData()->getSeries()->add($fact->getCell(0, 0, 2, "Series 2"), $chart->getType()); - - # Adding new categories - $chart->getChartData()->getCategories()->add($fact->getCell(0, 1, 0, "Caetegoty 1")); - $chart->getChartData()->getCategories()->add($fact->getCell(0, 2, 0, "Caetegoty 2")); - $chart->getChartData()->getCategories()->add($fact->getCell(0, 3, 0, "Caetegoty 3")); - - # Take first chart series - $series = $chart->getChartData()->getSeries()->get_Item(0); - - # Populating series data - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 1, 1, 20)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 2, 1, 50)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 3, 1, 30)); - - # Take second chart series - $series = $chart->getChartData()->getSeries()->get_Item(1); - - # Populating series data - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 1, 2, 30)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 2, 2, 10)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 3, 2, 60)); - - # Set GapWidth value - $series->getParentSeriesGroup()->setGapWidth(75); - - # Saving the presentation - $save_format = new SaveFormat(); - $pres->save($dataDir . "SetGapWidth.pptx", $save_format->Pptx); - - print "Set Gapwidth property of chart series, please check the output file.".PHP_EOL; - - } - +getSlides()->get_Item(0); + + # Add chart with default data + $charType=new ChartType(); + $chart = $sld->getShapes()->addChart($charType->StackedColumn3D, 0, 0, 500, 500); + + # Getting the chart data worksheet + $fact = $chart->getChartData()->getChartDataWorkbook(); + + # Delete default generated series and categories + $chart->getChartData()->getSeries()->clear(); + $chart->getChartData()->getCategories()->clear(); + + # Adding new series + $chart->getChartData()->getSeries()->add($fact->getCell(0, 0, 1, "Series 1"), $chart->getType()); + $chart->getChartData()->getSeries()->add($fact->getCell(0, 0, 2, "Series 2"), $chart->getType()); + + # Adding new categories + $chart->getChartData()->getCategories()->add($fact->getCell(0, 1, 0, "Caetegoty 1")); + $chart->getChartData()->getCategories()->add($fact->getCell(0, 2, 0, "Caetegoty 2")); + $chart->getChartData()->getCategories()->add($fact->getCell(0, 3, 0, "Caetegoty 3")); + + # Set Rotation3D properties + $chart->getRotation3D()->setRightAngleAxes(true); + $chart->getRotation3D()->setRotationX(40); + $chart->getRotation3D()->setRotationY(270); + $chart->getRotation3D()->setDepthPercents(150); + + # Take first chart series + $series = $chart->getChartData()->getSeries()->get_Item(0); + + # Populating series data + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 1, 1, 20)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 2, 1, 50)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 3, 1, 30)); + + # Take second chart series + $series = $chart->getChartData()->getSeries()->get_Item(1); + + # Populating series data + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 1, 2, 30)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 2, 2, 10)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 3, 2, 60)); + + # Saving the presentation + $save_format = new SaveFormat(); + $pres->save($dataDir . "3Drotation.pptx", $save_format->Pptx); + + print "Done with rotation, please check the output file.".PHP_EOL; + } + + public static function set_gapwidth($dataDir=null){ + + $pres = new Presentation(); + + # Access first slide + $sld = $pres->getSlides()->get_Item(0); + + # Add chart with default data + $charType=new ChartType(); + $chart = $sld->getShapes()->addChart($charType->StackedColumn3D, 0, 0, 500, 500); + + # Getting the chart data worksheet + $fact = $chart->getChartData()->getChartDataWorkbook(); + + # Delete default generated series and categories + $chart->getChartData()->getSeries()->clear(); + $chart->getChartData()->getCategories()->clear(); + + # Adding new series + $chart->getChartData()->getSeries()->add($fact->getCell(0, 0, 1, "Series 1"), $chart->getType()); + $chart->getChartData()->getSeries()->add($fact->getCell(0, 0, 2, "Series 2"), $chart->getType()); + + # Adding new categories + $chart->getChartData()->getCategories()->add($fact->getCell(0, 1, 0, "Caetegoty 1")); + $chart->getChartData()->getCategories()->add($fact->getCell(0, 2, 0, "Caetegoty 2")); + $chart->getChartData()->getCategories()->add($fact->getCell(0, 3, 0, "Caetegoty 3")); + + # Take first chart series + $series = $chart->getChartData()->getSeries()->get_Item(0); + + # Populating series data + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 1, 1, 20)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 2, 1, 50)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 3, 1, 30)); + + # Take second chart series + $series = $chart->getChartData()->getSeries()->get_Item(1); + + # Populating series data + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 1, 2, 30)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 2, 2, 10)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell(0, 3, 2, 60)); + + # Set GapWidth value + $series->getParentSeriesGroup()->setGapWidth(75); + + # Saving the presentation + $save_format = new SaveFormat(); + $pres->save($dataDir . "SetGapWidth.pptx", $save_format->Pptx); + + print "Set Gapwidth property of chart series, please check the output file.".PHP_EOL; + + } + } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartSeries.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartSeries.php index 19790705..1fb55694 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartSeries.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartSeries.php @@ -1,38 +1,38 @@ -getSlides()->get_Item(0)->getShapes()->addChart($chartType->ClusteredColumn, 50, 50, 600, 400, true); - - $series = $chart->getChartData()->getSeries(); - if ($series->get_Item(0)->getOverlap() == 0) { - # Setting series overlap - $series -> get_Item(0) -> getParentSeriesGroup()->setOverlap(-30); - } - - # Saving the presentation - $save_format = new SaveFormat(); - $pres->save($dataDir . "Overlap.pptx", $save_format->Pptx); - - print "Added chart series overlap for charts, please check the output file.".PHP_EOL; - } - +getSlides()->get_Item(0)->getShapes()->addChart($chartType->ClusteredColumn, 50, 50, 600, 400, true); + + $series = $chart->getChartData()->getSeries(); + if ($series->get_Item(0)->getOverlap() == 0) { + # Setting series overlap + $series -> get_Item(0) -> getParentSeriesGroup()->setOverlap(-30); + } + + # Saving the presentation + $save_format = new SaveFormat(); + $pres->save($dataDir . "Overlap.pptx", $save_format->Pptx); + + print "Added chart series overlap for charts, please check the output file.".PHP_EOL; + } + } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartTrendLines.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartTrendLines.php index df6e4749..0e85269e 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartTrendLines.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ChartTrendLines.php @@ -1,70 +1,70 @@ -getSlides()->get_Item(0)->getShapes()->addChart($chartType->ClusteredColumn, 20, 20, 500, 400); - - # Adding ponential trend line for chart series 1 - $trendlineType=new TrendlineType(); - $tredLinep = $chart->getChartData()->getSeries()->get_Item(0)->getTrendLines()->add($trendlineType->Exponential); - $tredLinep->setDisplayEquation(false); - $tredLinep->setDisplayRSquaredValue(false); - - # Adding Linear trend line for chart series 1 - $fillType=new FillType(); - $color=new Color(); - - $tredLineLin = $chart->getChartData()->getSeries()->get_Item(0)->getTrendLines()->add($trendlineType->Linear); - $tredLineLin->setTrendlineType($trendlineType->Linear); - $tredLineLin->getFormat()->getLine()->getFillFormat()->setFillType($fillType->Solid); - $tredLineLin->getFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->RED); - - - # Adding Logarithmic trend line for chart series 2 - $tredLineLog = $chart->getChartData()->getSeries()->get_Item(1)->getTrendLines()->add($trendlineType->Logarithmic); - $tredLineLog->setTrendlineType($trendlineType->Logarithmic); - $tredLineLog->addTextFrameForOverriding("New log trend line"); - - # Adding MovingAverage trend line for chart series 2 - $tredLineMovAvg = $chart->getChartData()->getSeries()->get_Item(1)->getTrendLines()->add($trendlineType->MovingAverage); - $tredLineMovAvg->setTrendlineType($trendlineType->MovingAverage); - $tredLineMovAvg->setPeriod(3); - $tredLineMovAvg->setTrendlineName("New TrendLine Name"); - - # Adding Polynomial trend line for chart series 3 - $tredLinePol = $chart->getChartData()->getSeries()->get_Item(2)->getTrendLines()->add($trendlineType->Polynomial); - $tredLinePol->setTrendlineType($trendlineType->Polynomial); - $tredLinePol->setForward(1); - $tredLinePol->setOrder(3); - - # Adding Power trend line for chart series 3 - $tredLinePower = $chart->getChartData()->getSeries()->get_Item(1)->getTrendLines()->add($trendlineType->Power); - $tredLinePower->setTrendlineType($trendlineType->Power); - $tredLinePower->setBackward(1); - - # Saving the presentation - $save_format = new SaveFormat(); - $pres->save($dataDir . "ChartTrendLines.pptx", $save_format->Pptx); - - print "Done with chart trend lines, please check the output file.".PHP_EOL; - - } +getSlides()->get_Item(0)->getShapes()->addChart($chartType->ClusteredColumn, 20, 20, 500, 400); + + # Adding ponential trend line for chart series 1 + $trendlineType=new TrendlineType(); + $tredLinep = $chart->getChartData()->getSeries()->get_Item(0)->getTrendLines()->add($trendlineType->Exponential); + $tredLinep->setDisplayEquation(false); + $tredLinep->setDisplayRSquaredValue(false); + + # Adding Linear trend line for chart series 1 + $fillType=new FillType(); + $color=new Color(); + + $tredLineLin = $chart->getChartData()->getSeries()->get_Item(0)->getTrendLines()->add($trendlineType->Linear); + $tredLineLin->setTrendlineType($trendlineType->Linear); + $tredLineLin->getFormat()->getLine()->getFillFormat()->setFillType($fillType->Solid); + $tredLineLin->getFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->RED); + + + # Adding Logarithmic trend line for chart series 2 + $tredLineLog = $chart->getChartData()->getSeries()->get_Item(1)->getTrendLines()->add($trendlineType->Logarithmic); + $tredLineLog->setTrendlineType($trendlineType->Logarithmic); + $tredLineLog->addTextFrameForOverriding("New log trend line"); + + # Adding MovingAverage trend line for chart series 2 + $tredLineMovAvg = $chart->getChartData()->getSeries()->get_Item(1)->getTrendLines()->add($trendlineType->MovingAverage); + $tredLineMovAvg->setTrendlineType($trendlineType->MovingAverage); + $tredLineMovAvg->setPeriod(3); + $tredLineMovAvg->setTrendlineName("New TrendLine Name"); + + # Adding Polynomial trend line for chart series 3 + $tredLinePol = $chart->getChartData()->getSeries()->get_Item(2)->getTrendLines()->add($trendlineType->Polynomial); + $tredLinePol->setTrendlineType($trendlineType->Polynomial); + $tredLinePol->setForward(1); + $tredLinePol->setOrder(3); + + # Adding Power trend line for chart series 3 + $tredLinePower = $chart->getChartData()->getSeries()->get_Item(1)->getTrendLines()->add($trendlineType->Power); + $tredLinePower->setTrendlineType($trendlineType->Power); + $tredLinePower->setBackward(1); + + # Saving the presentation + $save_format = new SaveFormat(); + $pres->save($dataDir . "ChartTrendLines.pptx", $save_format->Pptx); + + print "Done with chart trend lines, please check the output file.".PHP_EOL; + + } } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/CreateChart.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/CreateChart.php index effade87..92ff9ac6 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/CreateChart.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/CreateChart.php @@ -1,197 +1,197 @@ -getSlides()->get_Item(0); - - $chartType=new ChartType(); - # Add chart with default data - $chart = $sld->getShapes()->addChart($chartType->ClusteredColumn, 0, 0, 500, 500); - - $nullableBool=new NullableBool(); - - # Setting chart Title - # chart.ChartTitle.TextFrameForOverriding.Text = "Sample Title"; - $chart->getChartTitle()->addTextFrameForOverriding("Sample Title"); - $chart->getChartTitle()->getTextFrameForOverriding()->getTextFrameFormat()->setCenterText($nullableBool->True); - $chart->getChartTitle()->setHeight (20); - $chart->hasTitle(true); - - # Set first series to Show Values - $chart->getChartData()->getSeries()->get_Item(0)->getLabels()->getDefaultDataLabelFormat()->setShowValue(true); - - # Setting the index of chart data sheet - $defaultWorksheetIndex = 0; - - # Getting the chart data worksheet - $fact = $chart->getChartData()->getChartDataWorkbook(); - - # Delete default generated series and categories - $chart->getChartData()->getSeries()->clear(); - $chart->getChartData()->getCategories()->clear(); - $s = $chart->getChartData()->getSeries()->size(); - $s = $chart->getChartData()->getCategories()->size(); - - # Adding new series - $chart->getChartData()->getSeries()->add($fact->getCell($defaultWorksheetIndex, 0, 1, "Series 1"), $chart->getType()); - $chart->getChartData()->getSeries()->add($fact->getCell($defaultWorksheetIndex, 0, 2, "Series 2"), $chart->getType()); - - # Adding new categories - $chart->getChartData()->getCategories()->add($fact->getCell($defaultWorksheetIndex, 1, 0, "Caetegoty 1")); - $chart->getChartData()->getCategories()->add($fact->getCell($defaultWorksheetIndex, 2, 0, "Caetegoty 2")); - $chart->getChartData()->getCategories()->add($fact->getCell($defaultWorksheetIndex, 3, 0, "Caetegoty 3")); - - # Take first chart series - $series = $chart->getChartData()->getSeries()->get_Item(0); - - # Now populating series data - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 1, 1, 20)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 2, 1, 50)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 3, 1, 30)); - - # Setting fill color for series - $fillType=new FillType(); - $color=new Color(); - - - $series->getFormat()->getFill()->setFillType($fillType->Solid); - $series->getFormat()->getFill()->getSolidFillColor()->setColor($color->RED); - - - # Take second chart series - $series = $chart->getChartData()->getSeries()->get_Item(1); - - # Now populating series data - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 1, 2, 30)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 2, 2, 10)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 3, 2, 60)); - - # Setting fill color for series - - $fillType1=new FillType(); - $color1=new Color(); - - $series->getFormat()->getFill()->setFillType($fillType1->Solid); - $series->getFormat()->getFill()->getSolidFillColor()->setColor($color1->GREEN); - - # create custom labels for each of categories for new series - # first label will be show Category name - $lbl = $series->getDataPoints()->get_Item(0)->getLabel(); - $lbl->getDataLabelFormat()->setShowCategoryName(true); - - $lbl = $series->getDataPoints()->get_Item(1)->getLabel(); - $lbl->getDataLabelFormat()->setShowSeriesName(true); - - # Show value for third label - $lbl = $series->getDataPoints()->get_Item(2)->getLabel(); - $lbl->getDataLabelFormat()->setShowValue(true); - $lbl->getDataLabelFormat()->setShowSeriesName(true); - $lbl->getDataLabelFormat()->setSeparator ("/"); - - # Save presentation with chart - $save_format = new SaveFormat(); - $pres->save($dataDir . "NormalChart.pptx", $save_format->Pptx); - - print "Created normal chart, please check the output file.".PHP_EOL; - } - - public static function create_scatter_chart($dataDir=null){ - $pres = new Presentation(); - - $slide = $pres->getSlides()->get_Item(0); - - $chartType=new ChartType(); - - # Creating the default chart - $chart = $slide->getShapes()->addChart($chartType->ScatterWithSmoothLines, 0, 0, 400, 400); - - # Getting the default chart data worksheet index - $defaultWorksheetIndex = 0; - - # Getting the chart data worksheet - $fact = $chart->getChartData()->getChartDataWorkbook(); - - # Delete demo series - $chart->getChartData()->getSeries()->clear(); - - # Add new series - $chart->getChartData()->getSeries()->add($fact->getCell($defaultWorksheetIndex, 1, 1, "Series 1"), $chart->getType()); - $chart->getChartData()->getSeries()->add($fact->getCell($defaultWorksheetIndex, 1, 3, "Series 2"), $chart->getType()); - - # Take first chart series - $series = $chart->getChartData()->getSeries()->get_Item(0); - - # Add new point (1:3) there. - $series->getDataPoints()->addDataPointForScatterSeries($fact->getCell($defaultWorksheetIndex, 2, 1, 1), $fact->getCell($defaultWorksheetIndex, 2, 2, 3)); - - # Add new point (2:10) - $series->getDataPoints()->addDataPointForScatterSeries($fact->getCell($defaultWorksheetIndex, 3, 1, 2), $fact->getCell($defaultWorksheetIndex, 3, 2, 10)); - - # Edit the type of series - $chartType=new ChartType(); - $series->setType($chartType->ScatterWithStraightLinesAndMarkers); - - # Changing the chart series marker - - $markerStyleType=new MarkerStyleType(); - $series->getMarker()->setSize(10); - $series->getMarker()->setSymbol($markerStyleType->Star); - - # Take second chart series - $series = $chart->getChartData()->getSeries()->get_Item(1); - - # Add new point (5:2) there. - $series->getDataPoints()->addDataPointForScatterSeries($fact->getCell($defaultWorksheetIndex, 2, 3, 5), $fact->getCell($defaultWorksheetIndex, 2, 4, 2)); - - # Add new point (3:1) - $series->getDataPoints()->addDataPointForScatterSeries($fact->getCell($defaultWorksheetIndex, 3, 3, 3), $fact->getCell($defaultWorksheetIndex, 3, 4, 1)); - - # Add new point (2:2) - $series->getDataPoints()->addDataPointForScatterSeries($fact->getCell($defaultWorksheetIndex, 4, 3, 2), $fact->getCell($defaultWorksheetIndex, 4, 4, 2)); - - # Add new point (5:1) - $series->getDataPoints()->addDataPointForScatterSeries($fact->getCell($defaultWorksheetIndex, 5, 3, 5), $fact->getCell($defaultWorksheetIndex, 5, 4, 1)); - - # Changing the chart series marker - - $markerStyleType1=new MarkerStyleType(); - - $series->getMarker()->setSize(10); - $series->getMarker()->setSymbol($markerStyleType1->Circle); - - $save_format = new SaveFormat(); - $pres->save($dataDir . "AsposeScatterChart.pptx", $save_format->Pptx); - - print "Created scatter chart, please check the output file." .PHP_EOL; - } - +getSlides()->get_Item(0); + + $chartType=new ChartType(); + # Add chart with default data + $chart = $sld->getShapes()->addChart($chartType->ClusteredColumn, 0, 0, 500, 500); + + $nullableBool=new NullableBool(); + + # Setting chart Title + # chart.ChartTitle.TextFrameForOverriding.Text = "Sample Title"; + $chart->getChartTitle()->addTextFrameForOverriding("Sample Title"); + $chart->getChartTitle()->getTextFrameForOverriding()->getTextFrameFormat()->setCenterText($nullableBool->True); + $chart->getChartTitle()->setHeight (20); + $chart->hasTitle(true); + + # Set first series to Show Values + $chart->getChartData()->getSeries()->get_Item(0)->getLabels()->getDefaultDataLabelFormat()->setShowValue(true); + + # Setting the index of chart data sheet + $defaultWorksheetIndex = 0; + + # Getting the chart data worksheet + $fact = $chart->getChartData()->getChartDataWorkbook(); + + # Delete default generated series and categories + $chart->getChartData()->getSeries()->clear(); + $chart->getChartData()->getCategories()->clear(); + $s = $chart->getChartData()->getSeries()->size(); + $s = $chart->getChartData()->getCategories()->size(); + + # Adding new series + $chart->getChartData()->getSeries()->add($fact->getCell($defaultWorksheetIndex, 0, 1, "Series 1"), $chart->getType()); + $chart->getChartData()->getSeries()->add($fact->getCell($defaultWorksheetIndex, 0, 2, "Series 2"), $chart->getType()); + + # Adding new categories + $chart->getChartData()->getCategories()->add($fact->getCell($defaultWorksheetIndex, 1, 0, "Caetegoty 1")); + $chart->getChartData()->getCategories()->add($fact->getCell($defaultWorksheetIndex, 2, 0, "Caetegoty 2")); + $chart->getChartData()->getCategories()->add($fact->getCell($defaultWorksheetIndex, 3, 0, "Caetegoty 3")); + + # Take first chart series + $series = $chart->getChartData()->getSeries()->get_Item(0); + + # Now populating series data + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 1, 1, 20)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 2, 1, 50)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 3, 1, 30)); + + # Setting fill color for series + $fillType=new FillType(); + $color=new Color(); + + + $series->getFormat()->getFill()->setFillType($fillType->Solid); + $series->getFormat()->getFill()->getSolidFillColor()->setColor($color->RED); + + + # Take second chart series + $series = $chart->getChartData()->getSeries()->get_Item(1); + + # Now populating series data + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 1, 2, 30)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 2, 2, 10)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 3, 2, 60)); + + # Setting fill color for series + + $fillType1=new FillType(); + $color1=new Color(); + + $series->getFormat()->getFill()->setFillType($fillType1->Solid); + $series->getFormat()->getFill()->getSolidFillColor()->setColor($color1->GREEN); + + # create custom labels for each of categories for new series + # first label will be show Category name + $lbl = $series->getDataPoints()->get_Item(0)->getLabel(); + $lbl->getDataLabelFormat()->setShowCategoryName(true); + + $lbl = $series->getDataPoints()->get_Item(1)->getLabel(); + $lbl->getDataLabelFormat()->setShowSeriesName(true); + + # Show value for third label + $lbl = $series->getDataPoints()->get_Item(2)->getLabel(); + $lbl->getDataLabelFormat()->setShowValue(true); + $lbl->getDataLabelFormat()->setShowSeriesName(true); + $lbl->getDataLabelFormat()->setSeparator ("/"); + + # Save presentation with chart + $save_format = new SaveFormat(); + $pres->save($dataDir . "NormalChart.pptx", $save_format->Pptx); + + print "Created normal chart, please check the output file.".PHP_EOL; + } + + public static function create_scatter_chart($dataDir=null){ + $pres = new Presentation(); + + $slide = $pres->getSlides()->get_Item(0); + + $chartType=new ChartType(); + + # Creating the default chart + $chart = $slide->getShapes()->addChart($chartType->ScatterWithSmoothLines, 0, 0, 400, 400); + + # Getting the default chart data worksheet index + $defaultWorksheetIndex = 0; + + # Getting the chart data worksheet + $fact = $chart->getChartData()->getChartDataWorkbook(); + + # Delete demo series + $chart->getChartData()->getSeries()->clear(); + + # Add new series + $chart->getChartData()->getSeries()->add($fact->getCell($defaultWorksheetIndex, 1, 1, "Series 1"), $chart->getType()); + $chart->getChartData()->getSeries()->add($fact->getCell($defaultWorksheetIndex, 1, 3, "Series 2"), $chart->getType()); + + # Take first chart series + $series = $chart->getChartData()->getSeries()->get_Item(0); + + # Add new point (1:3) there. + $series->getDataPoints()->addDataPointForScatterSeries($fact->getCell($defaultWorksheetIndex, 2, 1, 1), $fact->getCell($defaultWorksheetIndex, 2, 2, 3)); + + # Add new point (2:10) + $series->getDataPoints()->addDataPointForScatterSeries($fact->getCell($defaultWorksheetIndex, 3, 1, 2), $fact->getCell($defaultWorksheetIndex, 3, 2, 10)); + + # Edit the type of series + $chartType=new ChartType(); + $series->setType($chartType->ScatterWithStraightLinesAndMarkers); + + # Changing the chart series marker + + $markerStyleType=new MarkerStyleType(); + $series->getMarker()->setSize(10); + $series->getMarker()->setSymbol($markerStyleType->Star); + + # Take second chart series + $series = $chart->getChartData()->getSeries()->get_Item(1); + + # Add new point (5:2) there. + $series->getDataPoints()->addDataPointForScatterSeries($fact->getCell($defaultWorksheetIndex, 2, 3, 5), $fact->getCell($defaultWorksheetIndex, 2, 4, 2)); + + # Add new point (3:1) + $series->getDataPoints()->addDataPointForScatterSeries($fact->getCell($defaultWorksheetIndex, 3, 3, 3), $fact->getCell($defaultWorksheetIndex, 3, 4, 1)); + + # Add new point (2:2) + $series->getDataPoints()->addDataPointForScatterSeries($fact->getCell($defaultWorksheetIndex, 4, 3, 2), $fact->getCell($defaultWorksheetIndex, 4, 4, 2)); + + # Add new point (5:1) + $series->getDataPoints()->addDataPointForScatterSeries($fact->getCell($defaultWorksheetIndex, 5, 3, 5), $fact->getCell($defaultWorksheetIndex, 5, 4, 1)); + + # Changing the chart series marker + + $markerStyleType1=new MarkerStyleType(); + + $series->getMarker()->setSize(10); + $series->getMarker()->setSymbol($markerStyleType1->Circle); + + $save_format = new SaveFormat(); + $pres->save($dataDir . "AsposeScatterChart.pptx", $save_format->Pptx); + + print "Created scatter chart, please check the output file." .PHP_EOL; + } + } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ErrorBars.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ErrorBars.php index cd6913fe..7072d919 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ErrorBars.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ErrorBars.php @@ -1,108 +1,108 @@ -getSlides()->get_Item(0)->getShapes()->addChart($chartType->Bubble, 50, 50, 400, 300, true); - - # Adding Error bars and setting its format - $error_bar_x = $chart->getChartData()->getSeries()->get_Item(0)->getErrorBarsXFormat(); - $error_bar_y = $chart->getChartData()->getSeries()->get_Item(0)->getErrorBarsYFormat(); - - - - #error_bar_x.isVisible(true) - #error_bar_y.isVisible(true) - - $errorBarValueType = new ErrorBarValueType(); - $errorBarType = new ErrorBarType(); - - $error_bar_x->setValueType($errorBarValueType->Fixed); - - $error_bar_x->setValue(0.1); - - $error_bar_y->setValueType($errorBarValueType->Percentage); - $error_bar_y->setValue(5); - $error_bar_x->setType($errorBarType->Plus); - $error_bar_y->getFormat()->getLine()->setWidth(2.0); - #error_bar_x.hasEndCap(true) - - # Save presentation with chart - $save_format = new SaveFormat(); - $pres->save($dataDir . "ErrorBar.pptx", $save_format->Pptx); - - print "Added fixed error bar value for chart, please check the output file.".PHP_EOL; - - - } - - public static function add_custom_error_bar_value($dataDir = null) - { - $pres = new Presentation(); - - $slide = $pres->getSlides()->get_Item(0); - - # Creating a bubble chart - $chartType = new ChartType(); - $chart = $pres->getSlides()->get_Item(0)->getShapes()->addChart($chartType->Bubble, 50, 50, 400, 300, true); - - # Adding custom Error bars and setting its format - $error_bar_value_type = new ErrorBarValueType(); - $series = $chart->getChartData()->getSeries()->get_Item(0); - $error_bar_x = $series->getErrorBarsXFormat(); - $error_bar_y = $series->getErrorBarsYFormat(); - - #error_bar_x.isVisible(true) - #error_bar_y.isVisible(true) - - $error_bar_x->setValueType($error_bar_value_type->Custom); - $error_bar_y->setValueType($error_bar_value_type->Custom); - - #Accessing chart series data point and setting error bars values for individual point - $data_source_type = new DataSourceType(); - $points = $series->getDataPoints(); - $points->getDataSourceTypeForErrorBarsCustomValues()->setDataSourceTypeForXPlusValues($data_source_type->DoubleLiterals); - $points->getDataSourceTypeForErrorBarsCustomValues()->setDataSourceTypeForXMinusValues($data_source_type->DoubleLiterals); - $points->getDataSourceTypeForErrorBarsCustomValues()->setDataSourceTypeForYPlusValues($data_source_type->DoubleLiterals); - $points->getDataSourceTypeForErrorBarsCustomValues()->setDataSourceTypeForYMinusValues($data_source_type->DoubleLiterals); - - # Setting error bars for chart series points - $i = 0; - while ($i < $points->size()){ - $points->get_Item($i)->getErrorBarsCustomValues()->getXMinus()->setAsLiteralDouble($i + 1); - $points->get_Item($i)->getErrorBarsCustomValues()->getXPlus()->setAsLiteralDouble($i + 1); - $points->get_Item($i)->getErrorBarsCustomValues()->getYMinus()->setAsLiteralDouble($i + 1); - $points->get_Item($i)->getErrorBarsCustomValues()->getYPlus()->setAsLiteralDouble($i + 1); - $i++; - } - - $save_format = new SaveFormat(); - $pres->save($dataDir . "ErrorBarsCustomValues.pptx", $save_format->Pptx); - - print "Added custom error bars values for chart, please check the output file.".PHP_EOL; - } - +getSlides()->get_Item(0)->getShapes()->addChart($chartType->Bubble, 50, 50, 400, 300, true); + + # Adding Error bars and setting its format + $error_bar_x = $chart->getChartData()->getSeries()->get_Item(0)->getErrorBarsXFormat(); + $error_bar_y = $chart->getChartData()->getSeries()->get_Item(0)->getErrorBarsYFormat(); + + + + #error_bar_x.isVisible(true) + #error_bar_y.isVisible(true) + + $errorBarValueType = new ErrorBarValueType(); + $errorBarType = new ErrorBarType(); + + $error_bar_x->setValueType($errorBarValueType->Fixed); + + $error_bar_x->setValue(0.1); + + $error_bar_y->setValueType($errorBarValueType->Percentage); + $error_bar_y->setValue(5); + $error_bar_x->setType($errorBarType->Plus); + $error_bar_y->getFormat()->getLine()->setWidth(2.0); + #error_bar_x.hasEndCap(true) + + # Save presentation with chart + $save_format = new SaveFormat(); + $pres->save($dataDir . "ErrorBar.pptx", $save_format->Pptx); + + print "Added fixed error bar value for chart, please check the output file.".PHP_EOL; + + + } + + public static function add_custom_error_bar_value($dataDir = null) + { + $pres = new Presentation(); + + $slide = $pres->getSlides()->get_Item(0); + + # Creating a bubble chart + $chartType = new ChartType(); + $chart = $pres->getSlides()->get_Item(0)->getShapes()->addChart($chartType->Bubble, 50, 50, 400, 300, true); + + # Adding custom Error bars and setting its format + $error_bar_value_type = new ErrorBarValueType(); + $series = $chart->getChartData()->getSeries()->get_Item(0); + $error_bar_x = $series->getErrorBarsXFormat(); + $error_bar_y = $series->getErrorBarsYFormat(); + + #error_bar_x.isVisible(true) + #error_bar_y.isVisible(true) + + $error_bar_x->setValueType($error_bar_value_type->Custom); + $error_bar_y->setValueType($error_bar_value_type->Custom); + + #Accessing chart series data point and setting error bars values for individual point + $data_source_type = new DataSourceType(); + $points = $series->getDataPoints(); + $points->getDataSourceTypeForErrorBarsCustomValues()->setDataSourceTypeForXPlusValues($data_source_type->DoubleLiterals); + $points->getDataSourceTypeForErrorBarsCustomValues()->setDataSourceTypeForXMinusValues($data_source_type->DoubleLiterals); + $points->getDataSourceTypeForErrorBarsCustomValues()->setDataSourceTypeForYPlusValues($data_source_type->DoubleLiterals); + $points->getDataSourceTypeForErrorBarsCustomValues()->setDataSourceTypeForYMinusValues($data_source_type->DoubleLiterals); + + # Setting error bars for chart series points + $i = 0; + while ($i < $points->size()){ + $points->get_Item($i)->getErrorBarsCustomValues()->getXMinus()->setAsLiteralDouble($i + 1); + $points->get_Item($i)->getErrorBarsCustomValues()->getXPlus()->setAsLiteralDouble($i + 1); + $points->get_Item($i)->getErrorBarsCustomValues()->getYMinus()->setAsLiteralDouble($i + 1); + $points->get_Item($i)->getErrorBarsCustomValues()->getYPlus()->setAsLiteralDouble($i + 1); + $i++; + } + + $save_format = new SaveFormat(); + $pres->save($dataDir . "ErrorBarsCustomValues.pptx", $save_format->Pptx); + + print "Added custom error bars values for chart, please check the output file.".PHP_EOL; + } + } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ExistingChart.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ExistingChart.php index cde95f4d..f970ccac 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ExistingChart.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/ExistingChart.php @@ -1,84 +1,84 @@ -getSlides()->get_Item(0); - - # Add chart with default data - $chart = $sld->getShapes()->get_Item(0); - - # Setting the index of chart data sheet - $defaultWorksheetIndex = 0; - - # Getting the chart data worksheet - $fact = $chart->getChartData()->getChartDataWorkbook(); - - # Changing chart Category Name - $fact->getCell($defaultWorksheetIndex, 1, 0, "Modified Category 1"); - $fact->getCell($defaultWorksheetIndex, 2, 0, "Modified Category 2"); - - - # Take first chart series - $series = $chart->getChartData()->getSeries()->get_Item(0); - - # Now updating series data - $fact->getCell($defaultWorksheetIndex, 0, 1, "New_Series1"); # modifying series name - $series->getDataPoints()->get_Item(0)->getValue()->setData(90); - $series->getDataPoints()->get_Item(1)->getValue()->setData(123); - $series->getDataPoints()->get_Item(2)->getValue()->setData(44); - - # Take Second chart series - $series = $chart->getChartData()->getSeries()->get_Item(1); - - # Now updating series data - $fact->getCell($defaultWorksheetIndex, 0, 2, "New_Series2"); #modifying series name - $series->getDataPoints()->get_Item(0)->getValue()->setData(23); - $series->getDataPoints()->get_Item(1)->getValue()->setData(67); - $series->getDataPoints()->get_Item(2)->getValue()->setData(99); - - - # Now, Adding a new series - $chart->getChartData()->getSeries()->add($fact->getCell($defaultWorksheetIndex, 0, 3, "Series 3"), $chart->getType()); - - # Take 3rd chart series - $series = $chart->getChartData()->getSeries()->get_Item(2); - - # Now populating series data - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 1, 3, 20)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 2, 3, 50)); - $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 3, 3, 30)); - - $chartType=new ChartType(); - $chart->setType($chartType->ClusteredCylinder); - - - # Saving the presentation to HTML format - $save_format = new SaveFormat(); - $pres->save($dataDir . "AsposeChartModified.pptx", $save_format->Pptx); - - print "Updated chart, please check the output file.".PHP_EOL; - - } - +getSlides()->get_Item(0); + + # Add chart with default data + $chart = $sld->getShapes()->get_Item(0); + + # Setting the index of chart data sheet + $defaultWorksheetIndex = 0; + + # Getting the chart data worksheet + $fact = $chart->getChartData()->getChartDataWorkbook(); + + # Changing chart Category Name + $fact->getCell($defaultWorksheetIndex, 1, 0, "Modified Category 1"); + $fact->getCell($defaultWorksheetIndex, 2, 0, "Modified Category 2"); + + + # Take first chart series + $series = $chart->getChartData()->getSeries()->get_Item(0); + + # Now updating series data + $fact->getCell($defaultWorksheetIndex, 0, 1, "New_Series1"); # modifying series name + $series->getDataPoints()->get_Item(0)->getValue()->setData(90); + $series->getDataPoints()->get_Item(1)->getValue()->setData(123); + $series->getDataPoints()->get_Item(2)->getValue()->setData(44); + + # Take Second chart series + $series = $chart->getChartData()->getSeries()->get_Item(1); + + # Now updating series data + $fact->getCell($defaultWorksheetIndex, 0, 2, "New_Series2"); #modifying series name + $series->getDataPoints()->get_Item(0)->getValue()->setData(23); + $series->getDataPoints()->get_Item(1)->getValue()->setData(67); + $series->getDataPoints()->get_Item(2)->getValue()->setData(99); + + + # Now, Adding a new series + $chart->getChartData()->getSeries()->add($fact->getCell($defaultWorksheetIndex, 0, 3, "Series 3"), $chart->getType()); + + # Take 3rd chart series + $series = $chart->getChartData()->getSeries()->get_Item(2); + + # Now populating series data + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 1, 3, 20)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 2, 3, 50)); + $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 3, 3, 30)); + + $chartType=new ChartType(); + $chart->setType($chartType->ClusteredCylinder); + + + # Saving the presentation to HTML format + $save_format = new SaveFormat(); + $pres->save($dataDir . "AsposeChartModified.pptx", $save_format->Pptx); + + print "Updated chart, please check the output file.".PHP_EOL; + + } + } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/FormattingChartEntities.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/FormattingChartEntities.php index e7c3a07c..803525a8 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/FormattingChartEntities.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/FormattingChartEntities.php @@ -1,204 +1,204 @@ -getSlides()->get_Item(0); - - # Adding the sample chart - $chartType=new ChartType(); - $chart = $slide->getShapes()->addChart($chartType->LineWithMarkers, 50, 50, 500, 400); - - # Setting Chart Titile - $chart->hasTitle(true); - $chart->getChartTitle()->addTextFrameForOverriding(""); - $chartTitle = $chart->getChartTitle()->getTextFrameForOverriding()->getParagraphs()->get_Item(0)->getPortions()->get_Item(0); - $chartTitle->setText("Sample Chart"); - - $fillType=new FillType(); - $color=new Color(); - $nullableBool=new NullableBool(); - $lineDashStyle=new LineDashStyle(); - - $chartTitle->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); - $chartTitle->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->GRAY); - $chartTitle->getPortionFormat()->setFontHeight (20); - $chartTitle->getPortionFormat()->setFontBold($nullableBool->True); - $chartTitle->getPortionFormat()->setFontItalic($nullableBool->True); - - # Setting Major grid lines format for value axis - $chart->getAxes()->getVerticalAxis()->getMajorGridLinesFormat()->getLine()->getFillFormat()->setFillType($fillType->Solid); - $chart->getAxes()->getVerticalAxis()->getMajorGridLinesFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->BLUE); - $chart->getAxes()->getVerticalAxis()->getMajorGridLinesFormat()->getLine()->setWidth(5); - $chart->getAxes()->getVerticalAxis()->getMajorGridLinesFormat()->getLine()->setDashStyle($lineDashStyle->DashDot); - - # Setting Minor grid lines format for value axis - $chart->getAxes()->getVerticalAxis()->getMinorGridLinesFormat()->getLine()->getFillFormat()->setFillType($fillType->Solid); - $chart->getAxes()->getVerticalAxis()->getMinorGridLinesFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->RED); - $chart->getAxes()->getVerticalAxis()->getMinorGridLinesFormat()->getLine()->setWidth(3); - - # Setting value axis number format - - $displayUnitType=new DisplayUnitType(); - $chart->getAxes()->getVerticalAxis()->isNumberFormatLinkedToSource(false); - $chart->getAxes()->getVerticalAxis()->setDisplayUnit($displayUnitType->Thousands); - $chart->getAxes()->getVerticalAxis()->setNumberFormat("0.0%"); - - # Setting chart maximum, minimum values - $chart->getAxes()->getVerticalAxis()->isAutomaticMajorUnit(false); - $chart->getAxes()->getVerticalAxis()->isAutomaticMaxValue(false); - $chart->getAxes()->getVerticalAxis()->isAutomaticMinorUnit(false); - $chart->getAxes()->getVerticalAxis()->isAutomaticMinValue(false); - - $chart->getAxes()->getVerticalAxis()->setMaxValue(15); - $chart->getAxes()->getVerticalAxis()->setMinValue(-2); - $chart->getAxes()->getVerticalAxis()->setMinorUnit(0.5); - $chart->getAxes()->getVerticalAxis()->setMajorUnit(2.0); - - # Setting Value Axis Text Properties - - $fontData=new FontData(); - $presetColor=new PresetColor(); - - $txtVal = $chart->getAxes()->getVerticalAxis()->getTextFormat()->getPortionFormat(); - $txtVal->setFontBold($nullableBool->True); - $txtVal->setFontHeight(16); - $txtVal->setFontItalic($nullableBool->True); - $txtVal->getFillFormat()->setFillType($fillType->Solid); - $txtVal->getFillFormat()->getSolidFillColor()->setColor(new Color($presetColor->DarkGreen)); - $txtVal->setLatinFont(new FontData("Times New Roman")); - - # Setting value axis title - $chart->getAxes()->getVerticalAxis()->hasTitle(true); - $chart->getAxes()->getVerticalAxis()->getTitle()->addTextFrameForOverriding(""); - $valtitle = $chart->getAxes()->getVerticalAxis()->getTitle()->getTextFrameForOverriding()->getParagraphs()->get_Item(0)->getPortions()->get_Item(0); - $valtitle->setText("Primary Axis"); - $valtitle->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); - $valtitle->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->GRAY); - $valtitle->getPortionFormat()->setFontHeight(20); - $valtitle->getPortionFormat()->setFontBold($nullableBool->True); - $valtitle->getPortionFormat()->setFontItalic($nullableBool->True); - - # Setting Major grid lines format for Category axis - $chart->getAxes()->getHorizontalAxis()->getMajorGridLinesFormat()->getLine()->getFillFormat()->setFillType($fillType->Solid); - $chart->getAxes()->getHorizontalAxis()->getMajorGridLinesFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->GREEN); - $chart->getAxes()->getHorizontalAxis()->getMajorGridLinesFormat()->getLine()->setWidth(5); - - # Setting Minor grid lines format for Category axis - $chart->getAxes()->getHorizontalAxis()->getMinorGridLinesFormat()->getLine()->getFillFormat()->setFillType($fillType->Solid); - $chart->getAxes()->getHorizontalAxis()->getMinorGridLinesFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->YELLOW); - $chart->getAxes()->getHorizontalAxis()->getMinorGridLinesFormat()->getLine()->setWidth(3); - - #Setting Category Axis Text Properties - $txtCat = $chart->getAxes()->getHorizontalAxis()->getTextFormat()->getPortionFormat(); - $txtCat->setFontBold($nullableBool->True); - $txtCat->setFontHeight(16); - $txtCat->setFontItalic($nullableBool->True); - $txtCat->getFillFormat()->setFillType($fillType->Solid); - $txtCat->getFillFormat()->getSolidFillColor()->setColor($color->BLUE); - $txtCat->setLatinFont(new FontData("Arial")); - - # Setting Category Titile - $chart->getAxes()->getHorizontalAxis()->hasTitle(true); - $chart->getAxes()->getHorizontalAxis()->getTitle()->addTextFrameForOverriding(""); - - $catTitle = $chart->getAxes()->getHorizontalAxis()->getTitle()->getTextFrameForOverriding()->getParagraphs()->get_Item(0)->getPortions()->get_Item(0); - $catTitle->setText("Sample Category"); - $catTitle->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); - $catTitle->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->GRAY); - $catTitle->getPortionFormat()->setFontHeight(20); - $catTitle->getPortionFormat()->setFontBold($nullableBool->True); - $catTitle->getPortionFormat()->setFontItalic($nullableBool->True); - - # Setting category axis lable position - $tickLabelPositionType = new TickLabelPositionType(); - $chart->getAxes()->getHorizontalAxis()->setTickLabelPosition($tickLabelPositionType->Low); - - # Setting category axis lable rotation angle - $chart->getAxes()->getHorizontalAxis()->setTickLabelRotationAngle(45); - - # Setting Legends Text Properties - $txtleg = $chart->getLegend()->getTextFormat()->getPortionFormat(); - $txtleg->setFontBold($nullableBool->True); - $txtleg->setFontHeight(16); - $txtleg->setFontItalic($nullableBool->True); - $txtleg->getFillFormat()->setFillType($fillType->Solid); - $txtleg->getFillFormat()->getSolidFillColor()->setColor(new Color($presetColor->DarkRed)); - - # Set show chart legends without overlapping chart - $chart->getLegend()->setOverlay(true); - #chart.ChartData.Series[0].PlotOnSecondAxis=true; - $chart->getChartData()->getSeries()->get_Item(0)->setPlotOnSecondAxis(true); - - # Setting secondary value axis - $lineStyle = new LineStyle(); - $chart->getAxes()->getSecondaryVerticalAxis()->isVisible(true); - $chart->getAxes()->getSecondaryVerticalAxis()->getFormat()->getLine()->setStyle($lineStyle->ThickBetweenThin); - $chart->getAxes()->getSecondaryVerticalAxis()->getFormat()->getLine()->setWidth(20); - - # Setting secondary value axis Number format - $chart->getAxes()->getSecondaryVerticalAxis()->isNumberFormatLinkedToSource(false); - $displayUnitType=new DisplayUnitType(); - $chart->getAxes()->getSecondaryVerticalAxis()->setDisplayUnit($displayUnitType->Hundreds); - $chart->getAxes()->getSecondaryVerticalAxis()->setNumberFormat ("0.0%"); - - # Setting chart maximum, minimum values - $chart->getAxes()->getSecondaryVerticalAxis()->isAutomaticMajorUnit(false); - $chart->getAxes()->getSecondaryVerticalAxis()->isAutomaticMaxValue(false); - $chart->getAxes()->getSecondaryVerticalAxis()->isAutomaticMinorUnit(false); - $chart->getAxes()->getSecondaryVerticalAxis()->isAutomaticMinValue(false); - - $chart->getAxes()->getSecondaryVerticalAxis()->setMaxValue(20); - $chart->getAxes()->getSecondaryVerticalAxis()->setMinValue(-5); - $chart->getAxes()->getSecondaryVerticalAxis()->setMinorUnit(0.5); - $chart->getAxes()->getSecondaryVerticalAxis()->setMajorUnit(2.0); - - - # Setting chart back wall color - $chart->getBackWall()->setThickness(1); - $chart->getBackWall()->getFormat()->getFill()->setFillType($fillType->Solid); - $chart->getBackWall()->getFormat()->getFill()->getSolidFillColor()->setColor($color->ORANGE); - - $chart->getFloor()->getFormat()->getFill()->setFillType($fillType->Solid); - $chart->getFloor()->getFormat()->getFill()->getSolidFillColor()->setColor($color->RED); - - # Setting Plot area color - $chart->getPlotArea()->getFormat()->getFill()->setFillType($fillType->Solid); - $chart->getPlotArea()->getFormat()->getFill()->getSolidFillColor()->setColor(new Color($presetColor->LightCyan)); - - # Save Presentation - $save_format = new SaveFormat(); - $pres->save($dataDir . "FormattedChart.pptx", $save_format->Pptx); - - print "Formatted chart entities, please check the output file.".PHP_EOL; - - } - +getSlides()->get_Item(0); + + # Adding the sample chart + $chartType=new ChartType(); + $chart = $slide->getShapes()->addChart($chartType->LineWithMarkers, 50, 50, 500, 400); + + # Setting Chart Titile + $chart->hasTitle(true); + $chart->getChartTitle()->addTextFrameForOverriding(""); + $chartTitle = $chart->getChartTitle()->getTextFrameForOverriding()->getParagraphs()->get_Item(0)->getPortions()->get_Item(0); + $chartTitle->setText("Sample Chart"); + + $fillType=new FillType(); + $color=new Color(); + $nullableBool=new NullableBool(); + $lineDashStyle=new LineDashStyle(); + + $chartTitle->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); + $chartTitle->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->GRAY); + $chartTitle->getPortionFormat()->setFontHeight (20); + $chartTitle->getPortionFormat()->setFontBold($nullableBool->True); + $chartTitle->getPortionFormat()->setFontItalic($nullableBool->True); + + # Setting Major grid lines format for value axis + $chart->getAxes()->getVerticalAxis()->getMajorGridLinesFormat()->getLine()->getFillFormat()->setFillType($fillType->Solid); + $chart->getAxes()->getVerticalAxis()->getMajorGridLinesFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->BLUE); + $chart->getAxes()->getVerticalAxis()->getMajorGridLinesFormat()->getLine()->setWidth(5); + $chart->getAxes()->getVerticalAxis()->getMajorGridLinesFormat()->getLine()->setDashStyle($lineDashStyle->DashDot); + + # Setting Minor grid lines format for value axis + $chart->getAxes()->getVerticalAxis()->getMinorGridLinesFormat()->getLine()->getFillFormat()->setFillType($fillType->Solid); + $chart->getAxes()->getVerticalAxis()->getMinorGridLinesFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->RED); + $chart->getAxes()->getVerticalAxis()->getMinorGridLinesFormat()->getLine()->setWidth(3); + + # Setting value axis number format + + $displayUnitType=new DisplayUnitType(); + $chart->getAxes()->getVerticalAxis()->isNumberFormatLinkedToSource(false); + $chart->getAxes()->getVerticalAxis()->setDisplayUnit($displayUnitType->Thousands); + $chart->getAxes()->getVerticalAxis()->setNumberFormat("0.0%"); + + # Setting chart maximum, minimum values + $chart->getAxes()->getVerticalAxis()->isAutomaticMajorUnit(false); + $chart->getAxes()->getVerticalAxis()->isAutomaticMaxValue(false); + $chart->getAxes()->getVerticalAxis()->isAutomaticMinorUnit(false); + $chart->getAxes()->getVerticalAxis()->isAutomaticMinValue(false); + + $chart->getAxes()->getVerticalAxis()->setMaxValue(15); + $chart->getAxes()->getVerticalAxis()->setMinValue(-2); + $chart->getAxes()->getVerticalAxis()->setMinorUnit(0.5); + $chart->getAxes()->getVerticalAxis()->setMajorUnit(2.0); + + # Setting Value Axis Text Properties + + $fontData=new FontData(); + $presetColor=new PresetColor(); + + $txtVal = $chart->getAxes()->getVerticalAxis()->getTextFormat()->getPortionFormat(); + $txtVal->setFontBold($nullableBool->True); + $txtVal->setFontHeight(16); + $txtVal->setFontItalic($nullableBool->True); + $txtVal->getFillFormat()->setFillType($fillType->Solid); + $txtVal->getFillFormat()->getSolidFillColor()->setColor(new Color($presetColor->DarkGreen)); + $txtVal->setLatinFont(new FontData("Times New Roman")); + + # Setting value axis title + $chart->getAxes()->getVerticalAxis()->hasTitle(true); + $chart->getAxes()->getVerticalAxis()->getTitle()->addTextFrameForOverriding(""); + $valtitle = $chart->getAxes()->getVerticalAxis()->getTitle()->getTextFrameForOverriding()->getParagraphs()->get_Item(0)->getPortions()->get_Item(0); + $valtitle->setText("Primary Axis"); + $valtitle->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); + $valtitle->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->GRAY); + $valtitle->getPortionFormat()->setFontHeight(20); + $valtitle->getPortionFormat()->setFontBold($nullableBool->True); + $valtitle->getPortionFormat()->setFontItalic($nullableBool->True); + + # Setting Major grid lines format for Category axis + $chart->getAxes()->getHorizontalAxis()->getMajorGridLinesFormat()->getLine()->getFillFormat()->setFillType($fillType->Solid); + $chart->getAxes()->getHorizontalAxis()->getMajorGridLinesFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->GREEN); + $chart->getAxes()->getHorizontalAxis()->getMajorGridLinesFormat()->getLine()->setWidth(5); + + # Setting Minor grid lines format for Category axis + $chart->getAxes()->getHorizontalAxis()->getMinorGridLinesFormat()->getLine()->getFillFormat()->setFillType($fillType->Solid); + $chart->getAxes()->getHorizontalAxis()->getMinorGridLinesFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->YELLOW); + $chart->getAxes()->getHorizontalAxis()->getMinorGridLinesFormat()->getLine()->setWidth(3); + + #Setting Category Axis Text Properties + $txtCat = $chart->getAxes()->getHorizontalAxis()->getTextFormat()->getPortionFormat(); + $txtCat->setFontBold($nullableBool->True); + $txtCat->setFontHeight(16); + $txtCat->setFontItalic($nullableBool->True); + $txtCat->getFillFormat()->setFillType($fillType->Solid); + $txtCat->getFillFormat()->getSolidFillColor()->setColor($color->BLUE); + $txtCat->setLatinFont(new FontData("Arial")); + + # Setting Category Titile + $chart->getAxes()->getHorizontalAxis()->hasTitle(true); + $chart->getAxes()->getHorizontalAxis()->getTitle()->addTextFrameForOverriding(""); + + $catTitle = $chart->getAxes()->getHorizontalAxis()->getTitle()->getTextFrameForOverriding()->getParagraphs()->get_Item(0)->getPortions()->get_Item(0); + $catTitle->setText("Sample Category"); + $catTitle->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); + $catTitle->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->GRAY); + $catTitle->getPortionFormat()->setFontHeight(20); + $catTitle->getPortionFormat()->setFontBold($nullableBool->True); + $catTitle->getPortionFormat()->setFontItalic($nullableBool->True); + + # Setting category axis lable position + $tickLabelPositionType = new TickLabelPositionType(); + $chart->getAxes()->getHorizontalAxis()->setTickLabelPosition($tickLabelPositionType->Low); + + # Setting category axis lable rotation angle + $chart->getAxes()->getHorizontalAxis()->setTickLabelRotationAngle(45); + + # Setting Legends Text Properties + $txtleg = $chart->getLegend()->getTextFormat()->getPortionFormat(); + $txtleg->setFontBold($nullableBool->True); + $txtleg->setFontHeight(16); + $txtleg->setFontItalic($nullableBool->True); + $txtleg->getFillFormat()->setFillType($fillType->Solid); + $txtleg->getFillFormat()->getSolidFillColor()->setColor(new Color($presetColor->DarkRed)); + + # Set show chart legends without overlapping chart + $chart->getLegend()->setOverlay(true); + #chart.ChartData.Series[0].PlotOnSecondAxis=true; + $chart->getChartData()->getSeries()->get_Item(0)->setPlotOnSecondAxis(true); + + # Setting secondary value axis + $lineStyle = new LineStyle(); + $chart->getAxes()->getSecondaryVerticalAxis()->isVisible(true); + $chart->getAxes()->getSecondaryVerticalAxis()->getFormat()->getLine()->setStyle($lineStyle->ThickBetweenThin); + $chart->getAxes()->getSecondaryVerticalAxis()->getFormat()->getLine()->setWidth(20); + + # Setting secondary value axis Number format + $chart->getAxes()->getSecondaryVerticalAxis()->isNumberFormatLinkedToSource(false); + $displayUnitType=new DisplayUnitType(); + $chart->getAxes()->getSecondaryVerticalAxis()->setDisplayUnit($displayUnitType->Hundreds); + $chart->getAxes()->getSecondaryVerticalAxis()->setNumberFormat ("0.0%"); + + # Setting chart maximum, minimum values + $chart->getAxes()->getSecondaryVerticalAxis()->isAutomaticMajorUnit(false); + $chart->getAxes()->getSecondaryVerticalAxis()->isAutomaticMaxValue(false); + $chart->getAxes()->getSecondaryVerticalAxis()->isAutomaticMinorUnit(false); + $chart->getAxes()->getSecondaryVerticalAxis()->isAutomaticMinValue(false); + + $chart->getAxes()->getSecondaryVerticalAxis()->setMaxValue(20); + $chart->getAxes()->getSecondaryVerticalAxis()->setMinValue(-5); + $chart->getAxes()->getSecondaryVerticalAxis()->setMinorUnit(0.5); + $chart->getAxes()->getSecondaryVerticalAxis()->setMajorUnit(2.0); + + + # Setting chart back wall color + $chart->getBackWall()->setThickness(1); + $chart->getBackWall()->getFormat()->getFill()->setFillType($fillType->Solid); + $chart->getBackWall()->getFormat()->getFill()->getSolidFillColor()->setColor($color->ORANGE); + + $chart->getFloor()->getFormat()->getFill()->setFillType($fillType->Solid); + $chart->getFloor()->getFormat()->getFill()->getSolidFillColor()->setColor($color->RED); + + # Setting Plot area color + $chart->getPlotArea()->getFormat()->getFill()->setFillType($fillType->Solid); + $chart->getPlotArea()->getFormat()->getFill()->getSolidFillColor()->setColor(new Color($presetColor->LightCyan)); + + # Save Presentation + $save_format = new SaveFormat(); + $pres->save($dataDir . "FormattedChart.pptx", $save_format->Pptx); + + print "Formatted chart entities, please check the output file.".PHP_EOL; + + } + } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/SetLabelDistance.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/SetLabelDistance.php index 8a19c68d..e3a36344 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/SetLabelDistance.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/SetLabelDistance.php @@ -1,31 +1,31 @@ -getSlides()->get_Item(0); - - # Adding a chart on slide - $chartType=new ChartType(); - $ch = $sld->getShapes()->addChart($chartType->ClusteredColumn, 20, 20, 500, 300); - - # Setting the position of label from axis - $ch->getAxes()->getHorizontalAxis()->setLabelOffset(500); - - # Saving the presentation - $save_format = new SaveFormat(); - $pres->save($dataDir . "Position.pptx", $save_format->Pptx); - - print "Set label distance, please check the output file.".PHP_EOL; - - } +getSlides()->get_Item(0); + + # Adding a chart on slide + $chartType=new ChartType(); + $ch = $sld->getShapes()->addChart($chartType->ClusteredColumn, 20, 20, 500, 300); + + # Setting the position of label from axis + $ch->getAxes()->getHorizontalAxis()->setLabelOffset(500); + + # Saving the presentation + $save_format = new SaveFormat(); + $pres->save($dataDir . "Position.pptx", $save_format->Pptx); + + print "Set label distance, please check the output file.".PHP_EOL; + + } } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/SetPieChartColors.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/SetPieChartColors.php index 61d2a88f..6c24c98c 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/SetPieChartColors.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithCharts/SetPieChartColors.php @@ -1,137 +1,137 @@ -getSlides()->get_Item(0); - - # Add chart with default data - $chart_type = new ChartType(); - $chart = $sld->getShapes()->addChart($chart_type->Pie, 100, 100, 400, 400); - - $nullableBool=new NullableBool(); - - # Setting chart Title - $chart->getChartTitle()->addTextFrameForOverriding("Sample Title"); - $chart->getChartTitle()->getTextFrameForOverriding()->getTextFrameFormat()->setCenterText($nullableBool->True); - $chart->getChartTitle()->setHeight(20); - $chart->hasTitle(true); - - # Set first series to Show Values - $chart->getChartData()->getSeries()->get_Item(0)->getLabels()->getDefaultDataLabelFormat()->setShowValue(true); - - # Setting the index of chart data sheet - $defaultWorksheetIndex = 0; - - # Getting the chart data worksheet - $fact = $chart->getChartData()->getChartDataWorkbook(); - - # Delete default generated series and categories - $chart->getChartData()->getSeries()->clear(); - $chart->getChartData()->getCategories()->clear(); - - # Adding new categories - $chart->getChartData()->getCategories()->add($fact->getCell(0, 1, 0, "First Qtr")); - $chart->getChartData()->getCategories()->add($fact->getCell(0, 2, 0, "2nd Qtr")); - $chart->getChartData()->getCategories()->add($fact->getCell(0, 3, 0, "3rd Qtr")); - - # Adding new series - $series = $chart->getChartData()->getSeries()->add($fact->getCell(0, 0, 1, "Series 1"), $chart->getType()); - - # Now populating series data - $series->getDataPoints()->addDataPointForPieSeries($fact->getCell($defaultWorksheetIndex, 1, 1, 20)); - $series->getDataPoints()->addDataPointForPieSeries($fact->getCell($defaultWorksheetIndex, 2, 1, 50)); - $series->getDataPoints()->addDataPointForPieSeries($fact->getCell($defaultWorksheetIndex, 3, 1, 30)); - - # Not working in new version - # Adding new points and setting sector color - $chart->getChartData()->getSeriesGroups()->get_Item(0)->isColorVaried(true); - - $fill_type = new FillType(); - $line_style = new LineStyle(); - $color = new Color(); - $line_dash_style = new LineDashStyle(); - $preset_color = new PresetColor(); - - $point = $series->getDataPoints()->get_Item(0); - $point->getFormat()->getFill()->setFillType($fill_type->Solid); - $point->getFormat()->getFill()->getSolidFillColor()->setColor($color->CYAN); - - # Setting Sector border - $point->getFormat()->getLine()->getFillFormat()->setFillType($fill_type->Solid); - $point->getFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->GRAY); - $point->getFormat()->getLine()->setWidth(3.0); - $point->getFormat()->getLine()->setStyle($line_style->ThinThick); - $point->getFormat()->getLine()->setDashStyle($line_dash_style->DashDot); - - - $point1 = $series->getDataPoints()->get_Item(1); - $point1->getFormat()->getFill()->setFillType($fill_type->Solid); - $point1->getFormat()->getFill()->getSolidFillColor()->setColor(new Color($preset_color->Brown)); - - # Setting Sector border - $point1->getFormat()->getLine()->getFillFormat()->setFillType($fill_type->Solid); - $point1->getFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->BLUE); - $point1->getFormat()->getLine()->setWidth(3.0); - $point1->getFormat()->getLine()->setStyle($line_style->Single); - $point1->getFormat()->getLine()->setDashStyle($line_dash_style->LargeDashDot); - - $point2 = $series->getDataPoints()->get_Item(2); - $point2->getFormat()->getFill()->setFillType($fill_type->Solid); - $point2->getFormat()->getFill()->getSolidFillColor()->setColor(new Color($preset_color->Coral)); - - # Setting Sector border - $point2->getFormat()->getLine()->getFillFormat()->setFillType($fill_type->Solid); - $point2->getFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->RED); - $point2->getFormat()->getLine()->setWidth(2.0); - $point2->getFormat()->getLine()->setStyle($line_style->ThinThin); - $point2->getFormat()->getLine()->setDashStyle($line_dash_style->LargeDashDotDot); - - # Create custom labels for each of categories for new series - $lbl1 = $series->getDataPoints()->get_Item(0)->getLabel(); - - $lbl1->getDataLabelFormat()->setShowValue(true); - - $lbl2 = $series->getDataPoints()->get_Item(1)->getLabel(); - $lbl2->getDataLabelFormat()->setShowValue (true); - $lbl2->getDataLabelFormat()->setShowLegendKey(true); - $lbl2->getDataLabelFormat()->setShowPercentage(true); - - $lbl3 = $series->getDataPoints()->get_Item(2)->getLabel(); - $lbl3->getDataLabelFormat()->setShowSeriesName(true); - $lbl3->getDataLabelFormat()->setShowPercentage (true); - - # Showing Leader Lines for Chart - $series->getLabels()->getDefaultDataLabelFormat()->setShowLeaderLines(true); - - # Setting Rotation Angle for Pie Chart Sectors - $chart->getChartData()->getSeriesGroups()->get_Item(0)->setFirstSliceAngle(180); - - # Save presentation with chart - $save_format = new SaveFormat(); - $pres->save($dataDir . "AsposePieChart.pptx", $save_format->Pptx); - - print "Set pie chart sector colors, please check the output file.".PHP_EOL; - } +getSlides()->get_Item(0); + + # Add chart with default data + $chart_type = new ChartType(); + $chart = $sld->getShapes()->addChart($chart_type->Pie, 100, 100, 400, 400); + + $nullableBool=new NullableBool(); + + # Setting chart Title + $chart->getChartTitle()->addTextFrameForOverriding("Sample Title"); + $chart->getChartTitle()->getTextFrameForOverriding()->getTextFrameFormat()->setCenterText($nullableBool->True); + $chart->getChartTitle()->setHeight(20); + $chart->hasTitle(true); + + # Set first series to Show Values + $chart->getChartData()->getSeries()->get_Item(0)->getLabels()->getDefaultDataLabelFormat()->setShowValue(true); + + # Setting the index of chart data sheet + $defaultWorksheetIndex = 0; + + # Getting the chart data worksheet + $fact = $chart->getChartData()->getChartDataWorkbook(); + + # Delete default generated series and categories + $chart->getChartData()->getSeries()->clear(); + $chart->getChartData()->getCategories()->clear(); + + # Adding new categories + $chart->getChartData()->getCategories()->add($fact->getCell(0, 1, 0, "First Qtr")); + $chart->getChartData()->getCategories()->add($fact->getCell(0, 2, 0, "2nd Qtr")); + $chart->getChartData()->getCategories()->add($fact->getCell(0, 3, 0, "3rd Qtr")); + + # Adding new series + $series = $chart->getChartData()->getSeries()->add($fact->getCell(0, 0, 1, "Series 1"), $chart->getType()); + + # Now populating series data + $series->getDataPoints()->addDataPointForPieSeries($fact->getCell($defaultWorksheetIndex, 1, 1, 20)); + $series->getDataPoints()->addDataPointForPieSeries($fact->getCell($defaultWorksheetIndex, 2, 1, 50)); + $series->getDataPoints()->addDataPointForPieSeries($fact->getCell($defaultWorksheetIndex, 3, 1, 30)); + + # Not working in new version + # Adding new points and setting sector color + $chart->getChartData()->getSeriesGroups()->get_Item(0)->isColorVaried(true); + + $fill_type = new FillType(); + $line_style = new LineStyle(); + $color = new Color(); + $line_dash_style = new LineDashStyle(); + $preset_color = new PresetColor(); + + $point = $series->getDataPoints()->get_Item(0); + $point->getFormat()->getFill()->setFillType($fill_type->Solid); + $point->getFormat()->getFill()->getSolidFillColor()->setColor($color->CYAN); + + # Setting Sector border + $point->getFormat()->getLine()->getFillFormat()->setFillType($fill_type->Solid); + $point->getFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->GRAY); + $point->getFormat()->getLine()->setWidth(3.0); + $point->getFormat()->getLine()->setStyle($line_style->ThinThick); + $point->getFormat()->getLine()->setDashStyle($line_dash_style->DashDot); + + + $point1 = $series->getDataPoints()->get_Item(1); + $point1->getFormat()->getFill()->setFillType($fill_type->Solid); + $point1->getFormat()->getFill()->getSolidFillColor()->setColor(new Color($preset_color->Brown)); + + # Setting Sector border + $point1->getFormat()->getLine()->getFillFormat()->setFillType($fill_type->Solid); + $point1->getFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->BLUE); + $point1->getFormat()->getLine()->setWidth(3.0); + $point1->getFormat()->getLine()->setStyle($line_style->Single); + $point1->getFormat()->getLine()->setDashStyle($line_dash_style->LargeDashDot); + + $point2 = $series->getDataPoints()->get_Item(2); + $point2->getFormat()->getFill()->setFillType($fill_type->Solid); + $point2->getFormat()->getFill()->getSolidFillColor()->setColor(new Color($preset_color->Coral)); + + # Setting Sector border + $point2->getFormat()->getLine()->getFillFormat()->setFillType($fill_type->Solid); + $point2->getFormat()->getLine()->getFillFormat()->getSolidFillColor()->setColor($color->RED); + $point2->getFormat()->getLine()->setWidth(2.0); + $point2->getFormat()->getLine()->setStyle($line_style->ThinThin); + $point2->getFormat()->getLine()->setDashStyle($line_dash_style->LargeDashDotDot); + + # Create custom labels for each of categories for new series + $lbl1 = $series->getDataPoints()->get_Item(0)->getLabel(); + + $lbl1->getDataLabelFormat()->setShowValue(true); + + $lbl2 = $series->getDataPoints()->get_Item(1)->getLabel(); + $lbl2->getDataLabelFormat()->setShowValue (true); + $lbl2->getDataLabelFormat()->setShowLegendKey(true); + $lbl2->getDataLabelFormat()->setShowPercentage(true); + + $lbl3 = $series->getDataPoints()->get_Item(2)->getLabel(); + $lbl3->getDataLabelFormat()->setShowSeriesName(true); + $lbl3->getDataLabelFormat()->setShowPercentage (true); + + # Showing Leader Lines for Chart + $series->getLabels()->getDefaultDataLabelFormat()->setShowLeaderLines(true); + + # Setting Rotation Angle for Pie Chart Sectors + $chart->getChartData()->getSeriesGroups()->get_Item(0)->setFirstSliceAngle(180); + + # Save presentation with chart + $save_format = new SaveFormat(); + $pres->save($dataDir . "AsposePieChart.pptx", $save_format->Pptx); + + print "Set pie chart sector colors, please check the output file.".PHP_EOL; + } } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithSmartArt/AddSmartArt.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithSmartArt/AddSmartArt.php index 816e1814..09271480 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithSmartArt/AddSmartArt.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithSmartArt/AddSmartArt.php @@ -1,32 +1,32 @@ -getSlides()->get_Item(0); - - # Add Smart Art Shape - $smartArtLayoutType=new SmartArtLayoutType(); - $smart = $slide->getShapes()->addSmartArt(0, 0, 400, 400, $smartArtLayoutType->BasicBlockList); - - # Write the presentation as a PPTX file - $saveFormat=new SaveFormat(); - $pres->save($dataDir . "SimpleSmartArt.pptx", $saveFormat->Pptx); - - print "Created smartart shape, please check the output file.".PHP_EOL; - } +getSlides()->get_Item(0); + + # Add Smart Art Shape + $smartArtLayoutType=new SmartArtLayoutType(); + $smart = $slide->getShapes()->addSmartArt(0, 0, 400, 400, $smartArtLayoutType->BasicBlockList); + + # Write the presentation as a PPTX file + $saveFormat=new SaveFormat(); + $pres->save($dataDir . "SimpleSmartArt.pptx", $saveFormat->Pptx); + + print "Created smartart shape, please check the output file.".PHP_EOL; + } } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithSmartArt/FillFormat.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithSmartArt/FillFormat.php index 2b6e7493..296eefb6 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithSmartArt/FillFormat.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithSmartArt/FillFormat.php @@ -1,39 +1,39 @@ -getSlides()->get_Item(0); - - # Adding SmartArt shape and nodes - $smartArtLayoutType=new SmartArtLayoutType(); - $chevron = $slide->getShapes()->addSmartArt(10, 10, 800, 60, $smartArtLayoutType->ClosedChevronProcess); - $node = $chevron->getAllNodes()->addNode(); - $node->getTextFrame()->setText("Some text"); - - # Setting node fill color - $color=new Color(); - $fillType=new FillType(); - $item = $node->getShapes()->get_Item(0); - $item->getFillFormat()->setFillType($fillType->Solid); - $item->getFillFormat()->getSolidFillColor()->setColor($color->RED); - - # Write the presentation as a PPTX file - $saveFormat=new SaveFormat(); - $pres->save($dataDir . "FillFormat.pptx", $saveFormat->Pptx); - - print "Set fill format for smartart node, please check the output file.".PHP_EOL; - } - +getSlides()->get_Item(0); + + # Adding SmartArt shape and nodes + $smartArtLayoutType=new SmartArtLayoutType(); + $chevron = $slide->getShapes()->addSmartArt(10, 10, 800, 60, $smartArtLayoutType->ClosedChevronProcess); + $node = $chevron->getAllNodes()->addNode(); + $node->getTextFrame()->setText("Some text"); + + # Setting node fill color + $color=new Color(); + $fillType=new FillType(); + $item = $node->getShapes()->get_Item(0); + $item->getFillFormat()->setFillType($fillType->Solid); + $item->getFillFormat()->getSolidFillColor()->setColor($color->RED); + + # Write the presentation as a PPTX file + $saveFormat=new SaveFormat(); + $pres->save($dataDir . "FillFormat.pptx", $saveFormat->Pptx); + + print "Set fill format for smartart node, please check the output file.".PHP_EOL; + } + } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/AddImage.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/AddImage.php index c3c78e63..e05c823d 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/AddImage.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/AddImage.php @@ -1,46 +1,46 @@ -getSlides()->get_Item(0); - - # Define co lumns with widths and rows with heights - $dbl_cols = [150,150,150,150]; - $dbl_rows = [100,100,100,100,90]; - - # Add table shape to slide - $tbl = $sld->getShapes()->addTable(50, 50, $dbl_cols, $dbl_rows); - - # Creating a Buffered Image object to hold the image file - $imageIO = new ImageIO(); - $image = $imageIO->read(new File($dataDir . "aspose-logo.jpg")); - $imgx1 = $pres->getImages()->addImage($image); - - $fillType=new FillType(); - $pictureFillMode=new PictureFillMode(); - $tbl->get_Item(0,0)->getFillFormat()->setFillType($fillType->Picture); - $tbl->get_Item(0,0)->getFillFormat()->getPictureFillFormat()->setPictureFillMode($pictureFillMode->Stretch); - $tbl->get_Item(0,0)->getFillFormat()->getPictureFillFormat()->getPicture()->setImage($imgx1); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "AddImage.pptx", $save_format->Pptx); - - print "Added image, please check the output file.".PHP_EOL; - } - -} - +getSlides()->get_Item(0); + + # Define co lumns with widths and rows with heights + $dbl_cols = [150,150,150,150]; + $dbl_rows = [100,100,100,100,90]; + + # Add table shape to slide + $tbl = $sld->getShapes()->addTable(50, 50, $dbl_cols, $dbl_rows); + + # Creating a Buffered Image object to hold the image file + $imageIO = new ImageIO(); + $image = $imageIO->read(new File($dataDir . "aspose-logo.jpg")); + $imgx1 = $pres->getImages()->addImage($image); + + $fillType=new FillType(); + $pictureFillMode=new PictureFillMode(); + $tbl->get_Item(0,0)->getFillFormat()->setFillType($fillType->Picture); + $tbl->get_Item(0,0)->getFillFormat()->getPictureFillFormat()->setPictureFillMode($pictureFillMode->Stretch); + $tbl->get_Item(0,0)->getFillFormat()->getPictureFillFormat()->getPicture()->setImage($imgx1); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "AddImage.pptx", $save_format->Pptx); + + print "Added image, please check the output file.".PHP_EOL; + } + +} + ?> \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/AlignText.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/AlignText.php index 0cd215ec..808340a7 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/AlignText.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/AlignText.php @@ -1,62 +1,62 @@ -getSlides()->get_Item(0); - - # Define columns with widths and rows with heights - $dbl_cols = [120, 120, 120, 120]; - $dbl_rows = [100, 100, 100, 100]; - - # Add table shape to slide - $tbl = $slide->getShapes()->addTable(100, 50, $dbl_cols, $dbl_rows); - - # Add text to the merged cell - $tbl->getRows()->get_Item(0)->get_Item(1)->getTextFrame()->setText("10"); - $tbl->getRows()->get_Item(0)->get_Item(2)->getTextFrame()->setText("20"); - $tbl->getRows()->get_Item(0)->get_Item(3)->getTextFrame()->setText("30"); - - # Accessing the text frame - $txt_frame = $tbl->getRows()->get_Item(0)->get_Item(0)->getTextFrame(); - - # Create the Paragraph object for text frame - $para = $txt_frame->getParagraphs()->get_Item(0); - - # Create Portion object for paragraph - - $fillType=new FillType(); - $color=new Color(); - - $portion = $para->getPortions()->get_Item(0); - $portion->setText("Text here"); - $portion->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); - $portion->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLACK); - - # Aligning the text vertically - $textVerticalType=new TextVerticalType(); - $cell = $tbl->getRows()->get_Item(0)->get_Item(0); - $textAnchorType=new TextAnchorType(); - $cell->setTextAnchorType($textAnchorType->Center); - $cell->setTextVerticalType($textVerticalType->Vertical270); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "AlignText.pptx", $save_format->Pptx); - - print "Aligned Text, please check the output file.".PHP_EOL; - } -} - +getSlides()->get_Item(0); + + # Define columns with widths and rows with heights + $dbl_cols = [120, 120, 120, 120]; + $dbl_rows = [100, 100, 100, 100]; + + # Add table shape to slide + $tbl = $slide->getShapes()->addTable(100, 50, $dbl_cols, $dbl_rows); + + # Add text to the merged cell + $tbl->getRows()->get_Item(0)->get_Item(1)->getTextFrame()->setText("10"); + $tbl->getRows()->get_Item(0)->get_Item(2)->getTextFrame()->setText("20"); + $tbl->getRows()->get_Item(0)->get_Item(3)->getTextFrame()->setText("30"); + + # Accessing the text frame + $txt_frame = $tbl->getRows()->get_Item(0)->get_Item(0)->getTextFrame(); + + # Create the Paragraph object for text frame + $para = $txt_frame->getParagraphs()->get_Item(0); + + # Create Portion object for paragraph + + $fillType=new FillType(); + $color=new Color(); + + $portion = $para->getPortions()->get_Item(0); + $portion->setText("Text here"); + $portion->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); + $portion->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLACK); + + # Aligning the text vertically + $textVerticalType=new TextVerticalType(); + $cell = $tbl->getRows()->get_Item(0)->get_Item(0); + $textAnchorType=new TextAnchorType(); + $cell->setTextAnchorType($textAnchorType->Center); + $cell->setTextVerticalType($textVerticalType->Vertical270); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "AlignText.pptx", $save_format->Pptx); + + print "Aligned Text, please check the output file.".PHP_EOL; + } +} + ?> \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/CloneRowColumn.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/CloneRowColumn.php index 0cf509c6..b4d511f6 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/CloneRowColumn.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/CloneRowColumn.php @@ -1,81 +1,81 @@ -getSlides()->get_Item(0); - - # Define columns with widths and rows with heights - $dbl_cols = [50, 50, 50]; - $dbl_rows = [50, 30, 30, 30]; - - # Add table shape to slide - $tbl = $sld->getShapes()->addTable(100, 50, $dbl_cols, $dbl_rows); - - $fill_type = new FillType(); - $color = new Color(); - - # Set border format for each cell - $row = 0; - while ($row < java_values($tbl->getRows()->size())) { - $cell = 0; - while ($cell < $tbl->getRows()->get_Item($row)->size()) { - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->getFillFormat()->setFillType($fill_type->Solid); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->getFillFormat()->getSolidFillColor()->setColor($color->RED); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->setWidth(5); - - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->getFillFormat()->setFillType($fill_type->Solid); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->getFillFormat()->getSolidFillColor()->setColor($color->RED); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->setWidth(5); - - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->getFillFormat()->setFillType($fill_type->Solid); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->getFillFormat()->getSolidFillColor()->setColor($color->RED); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->setWidth(5); - - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->getFillFormat()->setFillType($fill_type->Solid); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->getFillFormat()->getSolidFillColor()->setColor($color->RED); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->setWidth(5); - - $cell += 1; - } - $row += 1; - } - - $tbl->getColumns()->get_Item(0)->get_Item(0)->getTextFrame()->setText("00"); - $tbl->getColumns()->get_Item(0)->get_Item(1)->getTextFrame()->setText("01"); - $tbl->getColumns()->get_Item(0)->get_Item(2)->getTextFrame()->setText("02"); - $tbl->getColumns()->get_Item(0)->get_Item(3)->getTextFrame()->setText("03"); - $tbl->getColumns()->get_Item(1)->get_Item(0)->getTextFrame()->setText("10"); - $tbl->getColumns()->get_Item(2)->get_Item(0)->getTextFrame()->setText("20"); - $tbl->getColumns()->get_Item(1)->get_Item(1)->getTextFrame()->setText("11"); - $tbl->getColumns()->get_Item(2)->get_Item(1)->getTextFrame()->setText("21"); - - # AddClone adds a row in the end of the table - $tbl->getRows()->addClone($tbl->getRows()->get_Item(0) , false); - - # AddClone adds a column in the end of the table - $tbl->getColumns()->addClone($tbl->getColumns()->get_Item(0), false); - - # InsertClone adds a row at specific position in a table - $tbl->getRows()->insertClone(2, $tbl->getRows()->get_Item(0), false); - - # InsertClone adds a row at specific position in a table - $tbl->getColumns()->insertClone(2, $tbl->getColumns()->get_Item(0), false); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "CloneRowColumn.pptx", $save_format->Pptx); - - print "Cloned Row & Column from table, please check the output file."; PHP_EOL; - } - - +getSlides()->get_Item(0); + + # Define columns with widths and rows with heights + $dbl_cols = [50, 50, 50]; + $dbl_rows = [50, 30, 30, 30]; + + # Add table shape to slide + $tbl = $sld->getShapes()->addTable(100, 50, $dbl_cols, $dbl_rows); + + $fill_type = new FillType(); + $color = new Color(); + + # Set border format for each cell + $row = 0; + while ($row < java_values($tbl->getRows()->size())) { + $cell = 0; + while ($cell < $tbl->getRows()->get_Item($row)->size()) { + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->getFillFormat()->setFillType($fill_type->Solid); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->getFillFormat()->getSolidFillColor()->setColor($color->RED); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->setWidth(5); + + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->getFillFormat()->setFillType($fill_type->Solid); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->getFillFormat()->getSolidFillColor()->setColor($color->RED); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->setWidth(5); + + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->getFillFormat()->setFillType($fill_type->Solid); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->getFillFormat()->getSolidFillColor()->setColor($color->RED); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->setWidth(5); + + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->getFillFormat()->setFillType($fill_type->Solid); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->getFillFormat()->getSolidFillColor()->setColor($color->RED); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->setWidth(5); + + $cell += 1; + } + $row += 1; + } + + $tbl->getColumns()->get_Item(0)->get_Item(0)->getTextFrame()->setText("00"); + $tbl->getColumns()->get_Item(0)->get_Item(1)->getTextFrame()->setText("01"); + $tbl->getColumns()->get_Item(0)->get_Item(2)->getTextFrame()->setText("02"); + $tbl->getColumns()->get_Item(0)->get_Item(3)->getTextFrame()->setText("03"); + $tbl->getColumns()->get_Item(1)->get_Item(0)->getTextFrame()->setText("10"); + $tbl->getColumns()->get_Item(2)->get_Item(0)->getTextFrame()->setText("20"); + $tbl->getColumns()->get_Item(1)->get_Item(1)->getTextFrame()->setText("11"); + $tbl->getColumns()->get_Item(2)->get_Item(1)->getTextFrame()->setText("21"); + + # AddClone adds a row in the end of the table + $tbl->getRows()->addClone($tbl->getRows()->get_Item(0) , false); + + # AddClone adds a column in the end of the table + $tbl->getColumns()->addClone($tbl->getColumns()->get_Item(0), false); + + # InsertClone adds a row at specific position in a table + $tbl->getRows()->insertClone(2, $tbl->getRows()->get_Item(0), false); + + # InsertClone adds a row at specific position in a table + $tbl->getColumns()->insertClone(2, $tbl->getColumns()->get_Item(0), false); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "CloneRowColumn.pptx", $save_format->Pptx); + + print "Cloned Row & Column from table, please check the output file."; PHP_EOL; + } + + } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/CreateTable.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/CreateTable.php index 58ae253f..e033df9f 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/CreateTable.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/CreateTable.php @@ -1,67 +1,67 @@ -getSlides()->get_Item(0); - - # Define columns with widths and rows with heights - $dblCols = [50, 50, 50]; - $dblRows = [50, 30, 30, 30, 30]; - - # Add table shape to slide - $tbl = $sld->getShapes()->addTable(100, 50, $dblCols, $dblRows); - - $fill_type = new FillType(); - $color = new Color(); - - # Set border format for each cell - $row = 0; - while ($row < java_values($tbl->getRows()->size())) { - $cell = 0; - while ($cell < $tbl->getRows()->get_Item($row)->size()) { - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->getFillFormat()->setFillType($fill_type->Solid); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->getFillFormat()->getSolidFillColor()->setColor($color->RED); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->setWidth(5); - - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->getFillFormat()->setFillType($fill_type->Solid); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->getFillFormat()->getSolidFillColor()->setColor($color->RED); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->setWidth(5); - - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->getFillFormat()->setFillType($fill_type->Solid); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->getFillFormat()->getSolidFillColor()->setColor($color->RED); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->setWidth(5); - - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->getFillFormat()->setFillType($fill_type->Solid); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->getFillFormat()->getSolidFillColor()->setColor($color->RED); - $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->setWidth(5); - - $cell++; - } - $row++; - } - - # Merge cells 1 & 2 of row 1 - $tbl->mergeCells($tbl->getRows()->get_Item(0)->get_Item(0), $tbl->getRows()->get_Item(1)->get_Item(0), false); - - # Add text to the merged cell - $tbl->getRows()->get_Item(0)->get_Item(0)->getTextFrame()->setText("Merged Cells"); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "CreateTable.pptx", $save_format->Pptx); - - print "Created table, please check the output file.".PHP_EOL; - - } -} +getSlides()->get_Item(0); + + # Define columns with widths and rows with heights + $dblCols = [50, 50, 50]; + $dblRows = [50, 30, 30, 30, 30]; + + # Add table shape to slide + $tbl = $sld->getShapes()->addTable(100, 50, $dblCols, $dblRows); + + $fill_type = new FillType(); + $color = new Color(); + + # Set border format for each cell + $row = 0; + while ($row < java_values($tbl->getRows()->size())) { + $cell = 0; + while ($cell < $tbl->getRows()->get_Item($row)->size()) { + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->getFillFormat()->setFillType($fill_type->Solid); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->getFillFormat()->getSolidFillColor()->setColor($color->RED); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->setWidth(5); + + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->getFillFormat()->setFillType($fill_type->Solid); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->getFillFormat()->getSolidFillColor()->setColor($color->RED); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->setWidth(5); + + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->getFillFormat()->setFillType($fill_type->Solid); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->getFillFormat()->getSolidFillColor()->setColor($color->RED); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->setWidth(5); + + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->getFillFormat()->setFillType($fill_type->Solid); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->getFillFormat()->getSolidFillColor()->setColor($color->RED); + $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->setWidth(5); + + $cell++; + } + $row++; + } + + # Merge cells 1 & 2 of row 1 + $tbl->mergeCells($tbl->getRows()->get_Item(0)->get_Item(0), $tbl->getRows()->get_Item(1)->get_Item(0), false); + + # Add text to the merged cell + $tbl->getRows()->get_Item(0)->get_Item(0)->getTextFrame()->setText("Merged Cells"); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "CreateTable.pptx", $save_format->Pptx); + + print "Created table, please check the output file.".PHP_EOL; + + } +} ?> \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/RemoveRowColumn.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/RemoveRowColumn.php index 882149f1..9dd21cb0 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/RemoveRowColumn.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithTables/RemoveRowColumn.php @@ -1,30 +1,30 @@ -getSlides()->get_Item(0); - - $col_width = [100, 50, 30]; - $row_height = [30, 50, 30]; - - $table = $slide->getShapes()->addTable(100, 100, $col_width, $row_height); - - $table->getRows()->removeAt(1, false); - $table->getColumns()->removeAt(1, false); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "RemoveRowColumn.pptx", $save_format->Pptx); - - print "Removed Row & Column from table, please check the output file.".PHP_EOL; - } -} +getSlides()->get_Item(0); + + $col_width = [100, 50, 30]; + $row_height = [30, 50, 30]; + + $table = $slide->getShapes()->addTable(100, 100, $col_width, $row_height); + + $table->getRows()->removeAt(1, false); + $table->getColumns()->removeAt(1, false); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "RemoveRowColumn.pptx", $save_format->Pptx); + + print "Removed Row & Column from table, please check the output file.".PHP_EOL; + } +} ?> \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/CreateTextBox.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/CreateTextBox.php index 1a6a966f..c1a1484a 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/CreateTextBox.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/CreateTextBox.php @@ -1,88 +1,88 @@ -getSlides()->get_Item(0); - - # Add autoshape of rectangle type - $shapeType=new ShapeType(); - $shp = $sld->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 150, 50); - - # Add TextFrame to the Rectangle - $shp->addTextFrame(" "); - - # Accessing the text frame - $txt_frame = $shp->getTextFrame(); - - # Create the Paragraph object for text frame - $para = $txt_frame->getParagraphs()->get_Item(0); - - # Create Portion object for paragraph - $portion = $para->getPortions()->get_Item(0); - - # Set Text - $portion->setText("Aspose TextBox"); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "TextBox.pptx", $save_format->Pptx); - - print "Created TextBox, please check the output file.".PHP_EOL; - } - - - public static function create_textbox_with_hyperlink(){ - - $pres = new Presentation(); - - # Get the first slide - $sld = $pres->getSlides()->get_Item(0); - - # Add autoshape of rectangle type - $shapeType=new ShapeType(); - $pptxShape = $sld->getShapes()->addAutoShape($shapeType->Rectangle, 150, 150, 150, 50); - - # Cast the shape to AutoShape - $pptxAutoShape = $pptxShape; - - # Access ITextFrame associated with the AutoShape - $pptxAutoShape->addTextFrame(""); - - $text_frame = $pptxAutoShape->getTextFrame(); - - # Add some text to the frame - $text_frame->getParagraphs()->get_Item(0)->getPortions()->get_Item(0)->setText("Aspose.Slides"); - - #Set Hyperlink for the portion text - $hypman = $text_frame->getParagraphs()->get_Item(0)->getPortions()->get_Item(0)->getPortionFormat()->getHyperlinkManager(); - $hypman->setExternalHyperlinkClick("http://www.aspose.com"); - - # Write the presentation as a PPTX file - $save_format =new SaveFormat(); - $pres->save(data_dir + "hLinkPPTX.pptx", $save_format->Pptx); - - print "Created TextBox with Hyperlink, please check the output file.".PHP_EOL; - - } - +getSlides()->get_Item(0); + + # Add autoshape of rectangle type + $shapeType=new ShapeType(); + $shp = $sld->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 150, 50); + + # Add TextFrame to the Rectangle + $shp->addTextFrame(" "); + + # Accessing the text frame + $txt_frame = $shp->getTextFrame(); + + # Create the Paragraph object for text frame + $para = $txt_frame->getParagraphs()->get_Item(0); + + # Create Portion object for paragraph + $portion = $para->getPortions()->get_Item(0); + + # Set Text + $portion->setText("Aspose TextBox"); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "TextBox.pptx", $save_format->Pptx); + + print "Created TextBox, please check the output file.".PHP_EOL; + } + + + public static function create_textbox_with_hyperlink(){ + + $pres = new Presentation(); + + # Get the first slide + $sld = $pres->getSlides()->get_Item(0); + + # Add autoshape of rectangle type + $shapeType=new ShapeType(); + $pptxShape = $sld->getShapes()->addAutoShape($shapeType->Rectangle, 150, 150, 150, 50); + + # Cast the shape to AutoShape + $pptxAutoShape = $pptxShape; + + # Access ITextFrame associated with the AutoShape + $pptxAutoShape->addTextFrame(""); + + $text_frame = $pptxAutoShape->getTextFrame(); + + # Add some text to the frame + $text_frame->getParagraphs()->get_Item(0)->getPortions()->get_Item(0)->setText("Aspose.Slides"); + + #Set Hyperlink for the portion text + $hypman = $text_frame->getParagraphs()->get_Item(0)->getPortions()->get_Item(0)->getPortionFormat()->getHyperlinkManager(); + $hypman->setExternalHyperlinkClick("http://www.aspose.com"); + + # Write the presentation as a PPTX file + $save_format =new SaveFormat(); + $pres->save(data_dir + "hLinkPPTX.pptx", $save_format->Pptx); + + print "Created TextBox with Hyperlink, please check the output file.".PHP_EOL; + + } + } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/ManageText.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/ManageText.php index e39c3da5..2b058f47 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/ManageText.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/ManageText.php @@ -1,148 +1,148 @@ -getSlides()->get_Item(0); - - # Add an AutoShape of Rectangle type - $shapeType=new ShapeType(); - $ashp = $slide->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 350, 350); - - # Add TextFrame to the Rectangle - $fillType=new FillType(); - $ashp->addTextFrame(" "); - $ashp->getFillFormat()->setFillType($fillType->NoFill); - - # Accessing the text frame - $txt_frame = $ashp->getTextFrame(); - - # Setting text autofit type - $textAutofitType=new TextAutofitType(); - $txt_frame->getTextFrameFormat()->setAutofitType($textAutofitType->Shape); - - # Create the Paragraph object for text frame - $para = $txt_frame->getParagraphs()->get_Item(0); - - # Create Portion object for paragraph - $color=new Color(); - $portion = $para->getPortions()->get_Item(0); - $portion->setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog."); - $portion->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); - $portion->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLACK); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "formatText.pptx", $save_format->Pptx); - - print "Set autofittype of text, please check the output file.".PHP_EOL; - } - - public static function set_anchor_of_text($dataDir=null){ - - # Create an instance of Presentation class - $pres = new Presentation(); - - # Get the first slide - $slide = $pres->getSlides()->get_Item(0); - - # Add an AutoShape of Rectangle type - $shapeType=new ShapeType(); - $ashp = $slide->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 350, 350); - - # Add TextFrame to the Rectangle - $fillType=new FillType(); - $ashp->addTextFrame(" "); - $ashp->getFillFormat()->setFillType($fillType->NoFill); - - # Accessing the text frame - $txt_frame = $ashp->getTextFrame(); - - # Setting text anchoring to bottom - $textAnchorType=new TextAnchorType(); - $txt_frame->getTextFrameFormat()->setAnchoringType($textAnchorType->Bottom); - - # Create the Paragraph object for text frame - $para = $txt_frame->getParagraphs()->get_Item(0); - - # Create Portion object for paragraph - $color=new Color(); - $portion = $para->getPortions()->get_Item(0); - $portion->setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog."); - $portion->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); - $portion->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLACK); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "AnchorText.pptx", $save_format->Pptx); - - print "Set anchor of text, please check the output file.".PHP_EOL; - } - - public static function rotate_text($dataDir=null){ - - # Create an instance of Presentation class - $pres = new Presentation(); - - # Get the first slide - $slide = $pres->getSlides()->get_Item(0); - - # Add an AutoShape of Rectangle type - $shapeType=new ShapeType(); - $ashp = $slide->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 350, 350); - - # Add TextFrame to the Rectangle - $fillType=new FillType(); - $ashp->addTextFrame(" "); - $ashp->getFillFormat()->setFillType($fillType->NoFill); - - # Accessing the text frame - $txt_frame = $ashp->getTextFrame(); - - # Setting text Vertical type - $textVerticalType=new TextVerticalType(); - $txt_frame->getTextFrameFormat()->setTextVerticalType($textVerticalType->Vertical270); - - # Create the Paragraph object for text frame - $para = $txt_frame->getParagraphs()->get_Item(0); - - # Create Portion object for paragraph - $portion = $para->getPortions()->get_Item(0); - $color=new Color(); - $portion->setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog."); - $portion->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); - $portion->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLACK); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "VerticleText.pptx", $save_format->Pptx); - - print "Done with text rotation, please check the output file.".PHP_EOL; - } +getSlides()->get_Item(0); + + # Add an AutoShape of Rectangle type + $shapeType=new ShapeType(); + $ashp = $slide->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 350, 350); + + # Add TextFrame to the Rectangle + $fillType=new FillType(); + $ashp->addTextFrame(" "); + $ashp->getFillFormat()->setFillType($fillType->NoFill); + + # Accessing the text frame + $txt_frame = $ashp->getTextFrame(); + + # Setting text autofit type + $textAutofitType=new TextAutofitType(); + $txt_frame->getTextFrameFormat()->setAutofitType($textAutofitType->Shape); + + # Create the Paragraph object for text frame + $para = $txt_frame->getParagraphs()->get_Item(0); + + # Create Portion object for paragraph + $color=new Color(); + $portion = $para->getPortions()->get_Item(0); + $portion->setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog."); + $portion->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); + $portion->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLACK); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "formatText.pptx", $save_format->Pptx); + + print "Set autofittype of text, please check the output file.".PHP_EOL; + } + + public static function set_anchor_of_text($dataDir=null){ + + # Create an instance of Presentation class + $pres = new Presentation(); + + # Get the first slide + $slide = $pres->getSlides()->get_Item(0); + + # Add an AutoShape of Rectangle type + $shapeType=new ShapeType(); + $ashp = $slide->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 350, 350); + + # Add TextFrame to the Rectangle + $fillType=new FillType(); + $ashp->addTextFrame(" "); + $ashp->getFillFormat()->setFillType($fillType->NoFill); + + # Accessing the text frame + $txt_frame = $ashp->getTextFrame(); + + # Setting text anchoring to bottom + $textAnchorType=new TextAnchorType(); + $txt_frame->getTextFrameFormat()->setAnchoringType($textAnchorType->Bottom); + + # Create the Paragraph object for text frame + $para = $txt_frame->getParagraphs()->get_Item(0); + + # Create Portion object for paragraph + $color=new Color(); + $portion = $para->getPortions()->get_Item(0); + $portion->setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog."); + $portion->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); + $portion->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLACK); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "AnchorText.pptx", $save_format->Pptx); + + print "Set anchor of text, please check the output file.".PHP_EOL; + } + + public static function rotate_text($dataDir=null){ + + # Create an instance of Presentation class + $pres = new Presentation(); + + # Get the first slide + $slide = $pres->getSlides()->get_Item(0); + + # Add an AutoShape of Rectangle type + $shapeType=new ShapeType(); + $ashp = $slide->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 350, 350); + + # Add TextFrame to the Rectangle + $fillType=new FillType(); + $ashp->addTextFrame(" "); + $ashp->getFillFormat()->setFillType($fillType->NoFill); + + # Accessing the text frame + $txt_frame = $ashp->getTextFrame(); + + # Setting text Vertical type + $textVerticalType=new TextVerticalType(); + $txt_frame->getTextFrameFormat()->setTextVerticalType($textVerticalType->Vertical270); + + # Create the Paragraph object for text frame + $para = $txt_frame->getParagraphs()->get_Item(0); + + # Create Portion object for paragraph + $portion = $para->getPortions()->get_Item(0); + $color=new Color(); + $portion->setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog."); + $portion->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); + $portion->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLACK); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "VerticleText.pptx", $save_format->Pptx); + + print "Done with text rotation, please check the output file.".PHP_EOL; + } } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/ReplaceText.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/ReplaceText.php index f1125944..234c4868 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/ReplaceText.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/ReplaceText.php @@ -1,27 +1,27 @@ -getSlides()->get_Item(0); - - # Change the text of each placeholder - $shp = $sld->getShapes()->get_Item(0); - $shp->getTextFrame()->setText("This is Placeholder"); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "Welcome_PH.pptx", $save_format->Pptx); - - print "Replaced text, please check the output file.".PHP_EOL; - } - - +getSlides()->get_Item(0); + + # Change the text of each placeholder + $shp = $sld->getShapes()->get_Item(0); + $shp->getTextFrame()->setText("This is Placeholder"); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "Welcome_PH.pptx", $save_format->Pptx); + + print "Replaced text, please check the output file.".PHP_EOL; + } + + } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/ShadowEffects.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/ShadowEffects.php index 924e0902..f312d707 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/ShadowEffects.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/ShadowEffects.php @@ -1,52 +1,52 @@ -getSlides()->get_Item(0); - - # Add an AutoShape of Rectangle type - $shapeType=new ShapeType(); - $shp = $slide->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 150, 50); - - # Add TextFrame to the Rectangle - $shp->addTextFrame("Aspose TextBox"); - - # Disable shape fill in case we want to get shadow of text - $fillType=new FillType(); - $shp->getFillFormat()->setFillType($fillType->NoFill); - - # Add outer shadow and set all necessary parameters - $shp->getEffectFormat()->enableOuterShadowEffect(); - $shadow = $shp->getEffectFormat()->getOuterShadowEffect(); - $shadow->setBlurRadius(4.0); - $shadow->setDirection(45); - $shadow->setDistance(3); - - $rectangleAlignment=new RectangleAlignment(); - - $color=new Color(); - - $shadow->setRectangleAlign($rectangleAlignment->TopLeft); - $shadow->getShadowColor()->setColor($color->black); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "OutShadow.pptx", $save_format->Pptx); - - print "Applied shadow effects on text, please check the output file.".PHP_EOL; - } - +getSlides()->get_Item(0); + + # Add an AutoShape of Rectangle type + $shapeType=new ShapeType(); + $shp = $slide->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 150, 50); + + # Add TextFrame to the Rectangle + $shp->addTextFrame("Aspose TextBox"); + + # Disable shape fill in case we want to get shadow of text + $fillType=new FillType(); + $shp->getFillFormat()->setFillType($fillType->NoFill); + + # Add outer shadow and set all necessary parameters + $shp->getEffectFormat()->enableOuterShadowEffect(); + $shadow = $shp->getEffectFormat()->getOuterShadowEffect(); + $shadow->setBlurRadius(4.0); + $shadow->setDirection(45); + $shadow->setDistance(3); + + $rectangleAlignment=new RectangleAlignment(); + + $color=new Color(); + + $shadow->setRectangleAlign($rectangleAlignment->TopLeft); + $shadow->getShadowColor()->setColor($color->black); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "OutShadow.pptx", $save_format->Pptx); + + print "Applied shadow effects on text, please check the output file.".PHP_EOL; + } + } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/TextFont.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/TextFont.php index 4120cbb4..6d14df3c 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/TextFont.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/TextFont.php @@ -1,154 +1,154 @@ -getSlides()->get_Item(0); - - # Accessing the first and second placeholder in the slide and typecasting it as AutoShape - $tf1 = $slide->getShapes()->get_Item(0)->getTextFrame(); - $tf2 = $slide->getShapes()->get_Item(1)->getTextFrame(); - - # Accessing the first Paragraph - $para1 = $tf1->getParagraphs()->get_Item(0); - $para2 = $tf2->getParagraphs()->get_Item(0); - - # Accessing the first portion - $port1 = $para1->getPortions()->get_Item(0); - $port2 = $para2->getPortions()->get_Item(0); - - # Define new fonts - $fd1 = new FontData("Elephant"); - $fd2 = new FontData("Castellar"); - - # Assign new fonts to portion - $port1->getPortionFormat()->setLatinFont($fd1); - $port2->getPortionFormat()->setLatinFont($fd2); - - # Set font to Bold - $nullableBool=new NullableBool(); - $port1->getPortionFormat()->setFontBold($nullableBool->True); - $port2->getPortionFormat()->setFontBold($nullableBool->True); - - # Set font to Italic - $port1->getPortionFormat()->setFontItalic($nullableBool->True); - $port2->getPortionFormat()->setFontItalic($nullableBool->True); - - # Set font color - $fillType=new FillType(); - $color=new Color(); - $port1->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); - $port1->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLUE); - $port2->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); - $port2->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->GREEN); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "WelcomeFont.pptx", $save_format->Pptx); - - print "Done with font properties, please check the output file.".PHP_EOL; - - } - - public static function font_family_of_text($dataDir=null){ - - - # Create an instance of Presentation class - $pres = new Presentation(); - - # Get the first slide - $sld = $pres->getSlides()->get_Item(0); - - # Add an AutoShape of Rectangle type - $shapeType=new ShapeType(); - $ashp = $sld->getShapes()->addAutoShape($shapeType->Rectangle, 50, 50, 200, 50); - - # Remove any fill style associated with the AutoShape - $fillType=new FillType(); - $ashp->getFillFormat()->setFillType($fillType->NoFill); - - # Access the TextFrame associated with the AutoShape - $tf = $ashp->getTextFrame(); - $tf->setText("Aspose TextBox"); - - # Access the Portion associated with the TextFrame - $port = $tf->getParagraphs()->get_Item(0)->getPortions()->get_Item(0); - - # Set the Font for the Portion - $port->getPortionFormat()->setLatinFont(new FontData("Times New Roman")); - - # Set Bold property of the Font - $nullableBool=new NullableBool(); - $port->getPortionFormat()->setFontBold($nullableBool->True); - - # Set Italic property of the Font - $port->getPortionFormat()->setFontItalic($nullableBool->True); - - # Set Underline property of the Font - $textUnderlineType=new TextUnderlineType(); - $port->getPortionFormat()->setFontUnderline($textUnderlineType->Single); - - # Set the Height of the Font - $port->getPortionFormat()->setFontHeight(25); - - # Set the color of the Font - $color=new Color(); - $port->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); - $port->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLUE); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "FontFamilyOfText.pptx", $save_format->Pptx); - - print "Done with font family for text, please check the output file.".PHP_EOL; - } - - public static function set_default_font_for_rendering($dataDir=null){ - - # Use load options to define the default regualr and asian fonts - - $loadFormat = new LoadFormat(); - $lo = new LoadOptions($loadFormat->Auto); - $lo->setDefaultRegularFont("Wingdings"); - $lo->setDefaultAsianFont("Wingdings"); - - # Create an instance of Presentation class - $pres = new Presentation($dataDir . 'input.pptx'); - - # Generate PDF - $save_format = new SaveFormat(); - $pres->save($dataDir . "output.pdf", $save_format->Pdf); - - print "Done with font family for text, please check the output file.".PHP_EOL; - - } +getSlides()->get_Item(0); + + # Accessing the first and second placeholder in the slide and typecasting it as AutoShape + $tf1 = $slide->getShapes()->get_Item(0)->getTextFrame(); + $tf2 = $slide->getShapes()->get_Item(1)->getTextFrame(); + + # Accessing the first Paragraph + $para1 = $tf1->getParagraphs()->get_Item(0); + $para2 = $tf2->getParagraphs()->get_Item(0); + + # Accessing the first portion + $port1 = $para1->getPortions()->get_Item(0); + $port2 = $para2->getPortions()->get_Item(0); + + # Define new fonts + $fd1 = new FontData("Elephant"); + $fd2 = new FontData("Castellar"); + + # Assign new fonts to portion + $port1->getPortionFormat()->setLatinFont($fd1); + $port2->getPortionFormat()->setLatinFont($fd2); + + # Set font to Bold + $nullableBool=new NullableBool(); + $port1->getPortionFormat()->setFontBold($nullableBool->True); + $port2->getPortionFormat()->setFontBold($nullableBool->True); + + # Set font to Italic + $port1->getPortionFormat()->setFontItalic($nullableBool->True); + $port2->getPortionFormat()->setFontItalic($nullableBool->True); + + # Set font color + $fillType=new FillType(); + $color=new Color(); + $port1->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); + $port1->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLUE); + $port2->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); + $port2->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->GREEN); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "WelcomeFont.pptx", $save_format->Pptx); + + print "Done with font properties, please check the output file.".PHP_EOL; + + } + + public static function font_family_of_text($dataDir=null){ + + + # Create an instance of Presentation class + $pres = new Presentation(); + + # Get the first slide + $sld = $pres->getSlides()->get_Item(0); + + # Add an AutoShape of Rectangle type + $shapeType=new ShapeType(); + $ashp = $sld->getShapes()->addAutoShape($shapeType->Rectangle, 50, 50, 200, 50); + + # Remove any fill style associated with the AutoShape + $fillType=new FillType(); + $ashp->getFillFormat()->setFillType($fillType->NoFill); + + # Access the TextFrame associated with the AutoShape + $tf = $ashp->getTextFrame(); + $tf->setText("Aspose TextBox"); + + # Access the Portion associated with the TextFrame + $port = $tf->getParagraphs()->get_Item(0)->getPortions()->get_Item(0); + + # Set the Font for the Portion + $port->getPortionFormat()->setLatinFont(new FontData("Times New Roman")); + + # Set Bold property of the Font + $nullableBool=new NullableBool(); + $port->getPortionFormat()->setFontBold($nullableBool->True); + + # Set Italic property of the Font + $port->getPortionFormat()->setFontItalic($nullableBool->True); + + # Set Underline property of the Font + $textUnderlineType=new TextUnderlineType(); + $port->getPortionFormat()->setFontUnderline($textUnderlineType->Single); + + # Set the Height of the Font + $port->getPortionFormat()->setFontHeight(25); + + # Set the color of the Font + $color=new Color(); + $port->getPortionFormat()->getFillFormat()->setFillType($fillType->Solid); + $port->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLUE); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "FontFamilyOfText.pptx", $save_format->Pptx); + + print "Done with font family for text, please check the output file.".PHP_EOL; + } + + public static function set_default_font_for_rendering($dataDir=null){ + + # Use load options to define the default regualr and asian fonts + + $loadFormat = new LoadFormat(); + $lo = new LoadOptions($loadFormat->Auto); + $lo->setDefaultRegularFont("Wingdings"); + $lo->setDefaultAsianFont("Wingdings"); + + # Create an instance of Presentation class + $pres = new Presentation($dataDir . 'input.pptx'); + + # Generate PDF + $save_format = new SaveFormat(); + $pres->save($dataDir . "output.pdf", $save_format->Pdf); + + print "Done with font family for text, please check the output file.".PHP_EOL; + + } } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/WordArt.php b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/WordArt.php index 356def5a..1f76dacc 100644 --- a/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/WordArt.php +++ b/Plugins/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithText/WordArt.php @@ -1,57 +1,57 @@ -getSlides()->get_Item(0); - - # Add an AutoShape of Rectangle type - $shapeType=new ShapeType(); - $fillType=new FillType(); - $ashp = $slide->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 400, 300); - $ashp->getFillFormat()->setFillType($fillType->NoFill); - - # Add TextFrame to the Rectangle - $ashp->addTextFrame("Aspose TextBox"); - $port = $ashp->getTextFrame()->getParagraphs()->get_Item(0)->getPortions()->get_Item(0); - $pf = $port->getPortionFormat(); - $pf->setFontHeight(50); - - # Enable InnerShadowEffect - $ef = $pf->getEffectFormat(); - $ef->enableInnerShadowEffect(); - - # Set all necessary parameters - $ef->getInnerShadowEffect()->setBlurRadius(8.0); - $ef->getInnerShadowEffect()->setDirection(90); - $ef->getInnerShadowEffect()->setDistance(6.0); - $ef->getInnerShadowEffect()->getShadowColor()->setB(189); - - # Set ColorType as Scheme - $colorType=new ColorType(); - $ef->getInnerShadowEffect()->getShadowColor()->setColorType($colorType->Scheme); - - # Set Scheme Color - $schemeColor=new SchemeColor(); - $ef->getInnerShadowEffect()->getShadowColor()->setSchemeColor($schemeColor->Accent1); - - # Write the presentation as a PPTX file - $save_format = new SaveFormat(); - $pres->save($dataDir . "WordArt.pptx", $save_format->Pptx); - - print "Done with word art, please check the output file.".PHP_EOL; - } - +getSlides()->get_Item(0); + + # Add an AutoShape of Rectangle type + $shapeType=new ShapeType(); + $fillType=new FillType(); + $ashp = $slide->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 400, 300); + $ashp->getFillFormat()->setFillType($fillType->NoFill); + + # Add TextFrame to the Rectangle + $ashp->addTextFrame("Aspose TextBox"); + $port = $ashp->getTextFrame()->getParagraphs()->get_Item(0)->getPortions()->get_Item(0); + $pf = $port->getPortionFormat(); + $pf->setFontHeight(50); + + # Enable InnerShadowEffect + $ef = $pf->getEffectFormat(); + $ef->enableInnerShadowEffect(); + + # Set all necessary parameters + $ef->getInnerShadowEffect()->setBlurRadius(8.0); + $ef->getInnerShadowEffect()->setDirection(90); + $ef->getInnerShadowEffect()->setDistance(6.0); + $ef->getInnerShadowEffect()->getShadowColor()->setB(189); + + # Set ColorType as Scheme + $colorType=new ColorType(); + $ef->getInnerShadowEffect()->getShadowColor()->setColorType($colorType->Scheme); + + # Set Scheme Color + $schemeColor=new SchemeColor(); + $ef->getInnerShadowEffect()->getShadowColor()->setSchemeColor($schemeColor->Accent1); + + # Write the presentation as a PPTX file + $save_format = new SaveFormat(); + $pres->save($dataDir . "WordArt.pptx", $save_format->Pptx); + + print "Done with word art, please check the output file.".PHP_EOL; + } + } \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/LICENSE b/Plugins/Aspose_Slides_Java_for_Pptx4j/LICENSE deleted file mode 100644 index 211c97ae..00000000 --- a/Plugins/Aspose_Slides_Java_for_Pptx4j/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2001-2015 Aspose Pty Ltd - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/Plugins/Aspose_Slides_Java_for_Pptx4j/README.md b/Plugins/Aspose_Slides_Java_for_Pptx4j/README.md deleted file mode 100644 index 03819d4a..00000000 --- a/Plugins/Aspose_Slides_Java_for_Pptx4j/README.md +++ /dev/null @@ -1,67 +0,0 @@ -## Aspose.Slides Java for Pptx4j - -Aspose.Slides Java for Pptx4j is a project to provide comparative source code examples to do the same file processing tasks using Aspose.Slides for Java API and Pptx4j. Additionally, this project provides source code examples for advanced features offered by Aspose.Slides for Java which are missing in Pptx4j. - -Below are some code comparisons and features of Aspose.Slides for Java that are not available in Pptx4j. - -* [Code Comparison for common features in **Aspose.Slides** and **Pptx4j**](http://www.aspose.com/docs/display/slidesjava/2.2+Code+Comparison+for+Common+Features+in+Aspose.Slides+and+pptx4j) -* [Missing Features of **Pptx4j** available in **Aspose.Slides**](http://www.aspose.com/docs/display/slidesjava/2.3+Missing+Features+of+pptx4j+in+Aspose.Slides) - -These examples are helpful for developers who want to compare Pptx4j with Aspose.Slides OR migrate from Pptx4j to Aspose. - -### Feedback and Suggestions - -* Many more examples are yet to come. [Keep visiting us](http://www.aspose.com/java/total-component.aspx). -* Raise your queries and suggest more examples via [Aspose Forums](http://www.aspose.com/community/forums/default.aspx) or via this social coding site. - -## Why Aspose for Pptx4j ? - -The developers looking for file format libraries may need to walk through the features provided by the libraries available on the market. Mainly, two factors are considered when choosing an option: - -* Features -* Efforts required to use the library - -If you are a Java developer looking to choose a file format library to process files, you may want to compare Pptx4j library with Aspose. In this case, this project will help you to compare features and code in both libraries. Please visit project documentation for a comprehensive comparison. - -## What is Doc4j ? - -docx4j is an open source (ASLv2) Java library for creating and manipulating Microsoft Open XML (Word docx, Powerpoint pptx, and Excel xlsx) files. - -It is similar to Microsoft's OpenXML SDK, but for Java. docx4j uses JAXB to create the in-memory object representation. - -Its emphasis is on power: if the file format supports it, you can do it with docx4j. But first, you'll need to take the time to understand JAXB, and the Open XML file structure - -docx4j was created by Plutext Pty Ltd in 2008 - using OpenXML4J for the OPC piece. Plutext still drives the project, but since then docx4j has benefited from contributions from many individuals. The contributors are listed in docx4j's pom.xml. - -Read More at [docx4java.org](http://www.docx4java.org/) - -## What is the use of Aspose Java Products? - -Aspose are file format experts and provide APIs and components for various file formats including MS Office, OpenOffice, PDF and Image formats. - -These APIs are available on a number of development platforms including Java. If you are a Java developer, you can use Aspose native Java APIs in your Java applications to process various file formats in just a few lines of codes. - -All the Aspose APIs don’t have any dependency over any other engine. For example, you don’t need to have MS Office installed on the server to process MS Office files. Below you can read mor about Aspose.Slides for Java: - -### Aspose.Slides for Java - -[![Aspose.Slides for Java](http://www.aspose.com/App_Themes/V2/images/productLogos/JAVA/aspose_slides-for-java.jpg)](http://www.aspose.com/java/powerpoint-component.aspx) - -Aspose.Slides for Java is a unique PowerPoint management component that enables Java based applications to read, write and manipulate PowerPoint documents without using Microsoft PowerPoint. - -One can generate, modify, copy, convert, render and print presentations without installing Microsoft PowerPoint. - -Aspose.Slides for Java supports presentation file formats including PPT, PPS, POT, PresentationML (OOXML, PPTX) and Open Document Presentations (ODP). - -[Learn More](http://www.aspose.com/java/powerpoint-component.aspx) - -## Download Latest Versions? - -* [Latest Releases on Codeplex](https://asposeslidesjavapptx4j.codeplex.com/releases/view/618978) - -## Clone Plugin SourceCodes? - -This project is also hosted and maintained at CodePlex. To clone navigate to: - -* [Aspose.Slides Java for Pptx4j on CodePlex - click here](https://asposeslidesjavapptx4j.codeplex.com/SourceControl/latest) - diff --git a/Plugins/Aspose_Slides_Java_for_Ruby/README.md b/Plugins/Aspose_Slides_Java_for_Ruby/README.md index 5dae6715..9600754a 100644 --- a/Plugins/Aspose_Slides_Java_for_Ruby/README.md +++ b/Plugins/Aspose_Slides_Java_for_Ruby/README.md @@ -1,4 +1,4 @@ -# Aspose_Slides_Java_for_Ruby +# Aspose.Slides Java for Ruby Aspose.Slides Java for Ruby is a gem that demonstrates / provides the Aspose.Slides for Java API usage examples in Ruby by using Rjb - Ruby Java Bridge. ## Installation @@ -7,15 +7,13 @@ Execute following command. $ gem install asposeslidesjava -To download Aspose.Slides for Java API to be used with these examples through RJB, Please navigate to: - -http://www.aspose.com/community/files/72/java-components/aspose.slides-for-java/ +To download Aspose.Slides for Java API to be used with these examples through RJB, Please navigate to [download section](http://maven.aspose.com/repository/simple/ext-release-local/com/aspose/aspose-slides/). Note: Create jars folder at root of the gem folder and copy downloaded Aspose.Slides for java component into it. -For most complete documentation of the project, check Aspose.Slides Java for Ruby confluence wiki link: +For most complete documentation of the project, check [Aspose.Slides Java for Ruby](https://docs.aspose.com/display/slidesjava/Aspose.Slides+Java+For+Ruby) in confluence wiki. + -http://www.aspose.com/docs/display/slidesjava/3.+Aspose.Slides+Java+For+Ruby ## Usage @@ -28,4 +26,4 @@ initialize_aspose_slides Lets understand the above code * The first line makes sure that the aspose slides is loaded and available * Include the files that are required to access the aspose slides -* Initialize the libraries. The aspose JAVA classes are loaded from the path provided in the aspose.yml file \ No newline at end of file +* Initialize the libraries. The aspose JAVA classes are loaded from the path provided in the aspose.yml file diff --git a/Plugins/Aspose_Slides_for_Apache_POI/README.md b/Plugins/Aspose_Slides_for_Apache_POI/README.md index f72d750f..46e54f0d 100644 --- a/Plugins/Aspose_Slides_for_Apache_POI/README.md +++ b/Plugins/Aspose_Slides_for_Apache_POI/README.md @@ -4,15 +4,15 @@ Aspose.Slides Java for Apache POI SL is a project to provide comparative source Below are some code comparisons and features of Aspose.Slides for Java that are not available in Apache POI -* [Code Comparison for common features in **Aspose.Slides** and **Apache POI SL**](http://www.aspose.com/docs/display/slidesjava/1.2+Code+Comparison+for+Common+Features+in+Aspose.Slides+and+Apache+POI+-+HSLF+and+XSLF) -* [Missing Features of Apache POI SL available in Aspose.Slides](http://www.aspose.com/docs/display/slidesjava/1.3+Missing+Features+in+Apache+POI+SL+-+HSLF+and+XSLF) +* [Code Comparison for common features in **Aspose.Slides** and **Apache POI SL**](https://docs.aspose.com/display/slidesjava/1.2+Code+Comparison+for+Common+Features+in+Aspose.Slides+and+Apache+POI+-+HSLF+and+XSLF) +* [Missing Features of Apache POI SL available in Aspose.Slides](https://docs.aspose.com/display/slidesjava/1.3+Missing+Features+in+Apache+POI+SL+-+HSLF+and+XSLF) These examples are helpful for developers who want to compare Apache POI with Aspose.Slides OR migrate from Apache POI to Aspose. ### Feedback and Suggestions -* Many more examples are yet to come. [Keep visiting us](http://www.aspose.com/java/excel-component.aspx). -* Raise your queries and suggest more examples via [Aspose Forums](http://www.aspose.com/community/forums/default.aspx) or via this social coding site. +* Many more examples are yet to come. [Keep visiting us](https://products.aspose.com/slides/java). +* Raise your queries and suggest more examples via [Aspose Forums](https://www.aspose.com/community/forums/default.aspx) or via this social coding site. ## Why Aspose for Apache POI ? @@ -45,7 +45,7 @@ All the Aspose APIs don’t have any dependency over any other engine. For examp ### Aspose.Slides for Java -[![Aspose.Slides for Java](http://www.aspose.com/App_Themes/V2/images/productLogos/JAVA/aspose_slides-for-java.jpg)](http://www.aspose.com/java/powerpoint-component.aspx) +[![Aspose.Slides for Java](http://www.aspose.com/App_Themes/V2/images/productLogos/JAVA/aspose_slides-for-java.jpg)](https://products.aspose.com/slides/java) Aspose.Slides for Java is a unique PowerPoint management component that enables Java based applications to read, write and manipulate PowerPoint documents without using Microsoft PowerPoint. @@ -53,16 +53,6 @@ One can generate, modify, copy, convert, render and print presentations without Aspose.Slides for Java supports presentation file formats including PPT, PPS, POT, PresentationML (OOXML, PPTX) and Open Document Presentations (ODP). -[Learn More](http://www.aspose.com/java/powerpoint-component.aspx) - -## Download Latest Versions? - -* [Latest Releases on Codeplex](https://asposeslidesjavaapachepoi.codeplex.com/releases/view/618722) - -## Clone Plugin SourceCodes? - -This project is also hosted and maintained at CodePlex. To clone navigate to: - -* [Aspose.Slides Java for Apache POI SL on CodePlex - click here](https://asposeslidesjavaapachepoi.codeplex.com/SourceControl/latest) +[Learn More](https://products.aspose.com/slides/java) diff --git a/Plugins/Aspose_Slides_for_Apache_POI/src/main/resources/com/aspose/slides/examples/asposefeatures/presentationsecurity/accesspropertiesofprotectedpresentation/AsposeAccessPropertiesOfProtectedFile/AsposeProtection.pptx b/Plugins/Aspose_Slides_for_Apache_POI/src/main/resources/com/aspose/slides/examples/asposefeatures/presentationsecurity/accesspropertiesofprotectedpresentation/AsposeAccessPropertiesOfProtectedFile/AsposeProtection.pptx deleted file mode 100644 index e25398e5..00000000 Binary files a/Plugins/Aspose_Slides_for_Apache_POI/src/main/resources/com/aspose/slides/examples/asposefeatures/presentationsecurity/accesspropertiesofprotectedpresentation/AsposeAccessPropertiesOfProtectedFile/AsposeProtection.pptx and /dev/null differ diff --git a/README.md b/README.md index 9a919119..6714c959 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ -##Aspose.Slides for Java +![GitHub all releases](https://img.shields.io/github/downloads/aspose-slides/Aspose.slides-for-Java/total) ![GitHub](https://img.shields.io/github/license/aspose-slides/Aspose.slides-for-java) +# Java PowerPoint API -This package contains [Examples](https://github.com/asposeslides/Aspose_Slides_Java/tree/master/Examples) and Showcase projects for [Aspose.Slides for Java](http://www.aspose.com/categories/java-components/aspose.Slides-for-java/default.aspx) and will help you write your own applications. +[Aspose.Slides](https://products.aspose.com/slides/java) a Java PowerPoint API for presentation manipulation and management. It allows developers to read, write, convert and manipulate PowerPoint presentations in Java applications with the ability to manipulate all document elements such as slides, tables, text, charts, shapes, images and SmartArt diagrams and more. -Aspose.Slides for Java is a unique PowerPoint management component that enables Java based applications to read, write and manipulate PowerPoint documents without using Microsoft PowerPoint.

- @@ -12,13 +11,87 @@ Aspose.Slides for Java is a unique PowerPoint management component that enables Directory | Description --------- | ----------- -[Examples](https://github.com/asposeslides/Aspose_Slides_Java/tree/master/Examples) | A collection of Java examples that help you learn how to use product features. +[Examples](https://github.com/aspose-slides/Aspose.Slides-for-Java/tree/master/Examples) | A collection of Java examples that help you learn how to use product features. +[Plugins](https://github.com/aspose-slides/Aspose.Slides-for-Java/tree/master/Plugins) | Plugins to help integrate Aspose.Slides for Java in different environments. + + +## PowerPoint File Manipulation via Java + +Checkout the [product overview](https://docs.aspose.com/slides/java/product-overview/) to know all about Aspose.Slides for Java. + +- Load & convert presentations to other formats. +- Create presentations from scratch. +- Manipulate all of presentation elements via intuitive object model. +- Create or embed charts. +- Create or manipulate shapes. + +## Read & Write Presentations + +**Microsoft PowerPoint:** PPT, PPTX, PPS, POT, PPSX, PPTM, PPSM, POTX, POTM\ +**OpenOffice:** ODP, OTP + +## Save Presentations As + +**Fixed Layout:** PDF, PDF/A, XPS +**Image:** JPEG, PNG, BMP, TIFF, GIF, SVG +**Web:** HTML, SWF + +## Supported Environments + +- **Microsoft Windows:** Windows Desktop & Server (x86, x64) +- **macOS:** Mac OS X +- **Linux:** Ubuntu, OpenSUSE, CentOS, and others +- **Java Versions:** `J2SE 6.0 (1.6)` or above + +## Get Started with Aspose.Slides for Java + +Aspose hosts all Java APIs at the [Aspose Repository](https://repository.aspose.com/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-slides). You can easily use Aspose.Slides for Java API directly in your Maven projects with simple configurations. For the detailed instructions please visit [Installing Aspose.Slides for Java from Maven Repository](https://docs.aspose.com/slides/java/installation/) documentation page. + +## Convert Presentation to PDF + +```java +// instantiate a Presentation object that represents a presentation file +Presentation pres = new Presentation("demo.pptx"); +try { + // save the presentation to PDF with default options + pres.save("output.pdf", SaveFormat.Pdf); +} finally { + if (pres != null) pres.dispose(); +} +``` + +## Create Presentation from Scratch -## Resources +```java +// instantiate Presentation +Presentation pres = new Presentation(); +try { + // get the first slide + ISlide sld = (ISlide) pres.getSlides().get_Item(0); + + // add an AutoShape of Rectangle type + IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 150, 50); + + // add ITextFrame to the Rectangle + ashp.addTextFrame("Hello World"); + + // change the text color to Black (which is White by default) + ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat() + .setFillType(FillType.Solid); + ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat() + .getSolidFillColor().setColor(java.awt.Color.BLACK); + + // change the line color of the rectangle to White + ashp.getShapeStyle().getLineColor().setColor(java.awt.Color.WHITE); + + // remove any fill formatting in the shape + ashp.getFillFormat().setFillType(FillType.NoFill); + + // save the presentation to disk + pres.save("output.pptx", SaveFormat.Pptx); +} finally { + if (pres != null) pres.dispose(); +} +``` -+ **Website:** [www.aspose.com](http://www.aspose.com) -+ **Product Home:** [Aspose.Slides for Java](http://www.aspose.com/java/powerpoint-component.aspx) -+ **Download:** [Download Aspose.Slides for Java](http://www.aspose.com/community/files/72/java-components/aspose.slides-for-java/default.aspx) -+ **Documentation:** [Aspose.Slides for Java Documentation](http://www.aspose.com/docs/display/slidesjava/Home) -+ **Forum:** [Aspose.Slides for Java Forum](http://www.aspose.com/community/forums/aspose.slides-product-family/75/showforum.aspx) -+ **Blog:** [Aspose.Slides for Java Blog](http://www.aspose.com/blogs/aspose-products/aspose-slides-product-family.html) +[Home](https://www.aspose.com/) | [Product Page](https://products.aspose.com/slides/java) | [Docs](https://docs.aspose.com/slides/java/) | [Demos](https://products.aspose.app/slides/family) | [API Reference](https://apireference.aspose.com/slides/java) | [Examples](https://github.com/aspose-slides/Aspose.Slides-for-Java) | [Blog](https://blog.aspose.com/category/slides/) | [Search](https://search.aspose.com/) | [Free Support](https://forum.aspose.com/c/slides) | [Temporary License](https://purchase.aspose.com/temporary-license)