Skip to content

Commit 99518a6

Browse files
committed
Upgrade to 3.1
1 parent b4e4d3f commit 99518a6

File tree

3 files changed

+75
-2
lines changed

3 files changed

+75
-2
lines changed

Examples/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
<dependency>
1515
<groupId>com.aspose</groupId>
1616
<artifactId>aspose-imaging</artifactId>
17-
<version>3.0.2</version>
18-
<classifier>jdk16</classifier>
17+
<version>3.1</version>
1918
</dependency>
2019
</dependencies>
2120
<repositories>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 2001-2015 Aspose Pty Ltd. All Rights Reserved.
3+
*
4+
* This file is part of Aspose.Imaging. The source code in this file
5+
* is only intended as a supplement to the documentation, and is provided
6+
* "as is", without warranty of any kind, either expressed or implied.
7+
*/
8+
9+
package com.aspose.imaging.examples.export;
10+
11+
import com.aspose.imaging.Image;
12+
import com.aspose.imaging.examples.Utils;
13+
import com.aspose.imaging.fileformats.cad.CadImage;
14+
import com.aspose.imaging.imageoptions.CadRasterizationOptions;
15+
import com.aspose.imaging.imageoptions.PdfOptions;
16+
import com.aspose.imaging.imageoptions.TypeOfEntities;
17+
18+
public class ExportDxfToPdf {
19+
public static void main(String[] args) throws Exception {
20+
String dataDir = Utils.getDataDir(ExportDxfToPdf.class);
21+
String inputPath = dataDir + "conic_pyramid.dxf";
22+
String outputPath = dataDir + "Output.pdf";
23+
24+
CadImage cadImage = (CadImage) Image.load(dataDir + "conic_pyramid.dxf");
25+
26+
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
27+
rasterizationOptions.setPageWidth(500);
28+
rasterizationOptions.setPageHeight(500);
29+
rasterizationOptions.setTypeOfEntities(TypeOfEntities.Entities3D);
30+
rasterizationOptions.setLayouts(new String[]{"Model"});
31+
32+
PdfOptions pdfOptions = new PdfOptions();
33+
pdfOptions.setVectorRasterizationOptions(rasterizationOptions);
34+
cadImage.save(outputPath, pdfOptions);
35+
36+
System.out.println("File saved " + outputPath);
37+
}
38+
}
39+
40+
41+
42+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright 2001-2015 Aspose Pty Ltd. All Rights Reserved.
3+
*
4+
* This file is part of Aspose.Imaging. The source code in this file
5+
* is only intended as a supplement to the documentation, and is provided
6+
* "as is", without warranty of any kind, either expressed or implied.
7+
*/
8+
9+
package com.aspose.imaging.examples.export;
10+
11+
import com.aspose.imaging.Image;
12+
import com.aspose.imaging.examples.Utils;
13+
import com.aspose.imaging.fileformats.png.PngColorType;
14+
import com.aspose.imaging.fileformats.psd.PsdImage;
15+
import com.aspose.imaging.imageoptions.PngOptions;
16+
17+
public class ExportPsdLayersToImages {
18+
public static void main(String[] args) throws Exception {
19+
String dataDir = Utils.getDataDir(ExportPsdLayersToImages.class);
20+
String inputPath = dataDir + "conic_pyramid.dxf";
21+
String outputPath = dataDir + "Output.pdf";
22+
23+
Image image = Image.load(dataDir + "sample.psd");
24+
PsdImage psdImage = (PsdImage) image;
25+
PngOptions pngOptions = new PngOptions();
26+
pngOptions.setColorType(PngColorType.TruecolorWithAlpha);
27+
28+
for (int i = 0; i < psdImage.getLayers().length; i++) {
29+
psdImage.getLayers()[i].save(dataDir + "Output-" + i + ".png", pngOptions);
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)