Java aracılığıyla XSLFO’yi JPEG2000’ye dönüştürün

XSLFO dosyasını Adobe® Acrobat Reader kullanmadan herhangi bir Java J2SE, J2EE, J2ME uygulamasından JPEG2000’ye aktarın

 

Java’da xslfo dosyasını JPEG2000 görüntüsüne iki basit adımda dönüştürebilirsiniz. İlk olarak, Aspose.PDF for Java kullanarak XSLFO’yi JPEG’e aktarabilirsiniz. Bundan sonra, Aspose.Imaging for Java Görüntü İşleme API’sini kullanarak JPEG’i JPEG2000’ye dönüştürebilirsiniz. Her iki API de Aspose.Total for Java paketi kapsamında gelir.

XSLFO'yi Java aracılığıyla JPEG2000'ye aktarın

  1. Document sınıfını kullanarak XSLFO dosyasını açın
  2. sınıf nesnesini başlatın ve Process kullanarak XSLFO’yi JPEG’e dönüştürün. aspose.pdf.Page-java.io.OutputStream-) yöntemi
  3. Image sınıfını kullanarak JPEG dosyasını yükleyin
  4. Belgeyi save kullanarak JPEG2000 formatına kaydedin-) yöntem

Dönüşüm Gereksinimleri

Aspose.Total for Java’yı doğrudan Maven tabanlı bir projeden kolayca kullanabilirsiniz. ve pom.xml’inize kitaplıkları dahil edin.

Alternatif olarak, indirilenler adresinden bir ZIP dosyası alabilirsiniz.

// supports PDF, CGM, EPUB, TeX, PCL, PS, XPS, MD, MHTML, XSLFO, HTML file formats
// load PDF with an instance of Document
Document document = new Document("input.pdf");
// create an object of JpegDevice
JpegDevice renderer = new JpegDevice();
// convert first of a particular PDF page to JPEG format
renderer.process(document.getPages().get_Item(1), "output.jpeg");
// load JPEG file
Image image = Image.Load("output.jpeg");
// supports Dicom, Jpeg2000, Apng, Psd, Dxf, Wmf, Emz, Wmz, Tga, Svgz file formats
// save JPEG to PSD file format
image.save("output.psd", new PsdOptions());

Java ile Tek Bir Dosyada XSLFO'yi JPEG2000'ye Dönüştürün

API ayrıca XSLFO dosyasını JPEG2000’ye tek bir dosyaya aktarmanıza olanak tanır. Tüm sayfaları dönüştürmek için önce XSLFO belgenizi bir TIFF dosyasına dönüştürebilir, ardından TIFF dosyasını JPEG2000’ye aktarabilirsiniz. Giriş dosyasını Document sınıfını kullanarak açabilir ve Resolution, TiffSettings ve TIFF aygıt nesneleri oluşturabilirsiniz. process kullanarak tek bir TIFF görüntüsü alabilirsiniz. TiffDevice sınıfının java.io.OutputStream-) yöntemi. Son olarak, Image sınıfını kullanarak TIFF dosyasını yükleyebilir ve save kullanarak JPEG2000 formatına kaydedebilirsiniz. apireference.aspose.com/imaging/java/com.aspose.imaging/Image#save-java.lang.String-com.aspose.imaging.ImageOptionsBase-) yöntemi.

// supports PDF, CGM, EPUB, TeX, PCL, PS, XPS, MD, MHTML, XSLFO, HTML file formats
// load PDF with an instance of Document
Document pdfDocument = new Document("input.pdf");
// Create Resolution object
Resolution resolution = new Resolution(300);
// Create TiffSettings object
TiffSettings tiffSettings = new TiffSettings();
tiffSettings.setCompression(CompressionType.None);
tiffSettings.setDepth(ColorDepth.Default);
tiffSettings.setShape(ShapeType.Landscape);
// Create TIFF device
TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings);
// Convert a particular page and save the image to stream
tiffDevice.process(pdfDocument, 1, 1, "output.tif");
// load TIFF file
Image image = Image.Load("output.tif");
// supports Dicom, Jpeg2000, Apng, Psd, Dxf, Wmf, Emz, Wmz, Tga, Svgz file formats
// save TIFF to PSD file format
image.save("output.psd", new PsdOptions());

Java ile Filigranlı XSLFO'yi JPEG2000'ye Dönüştürün

API’yi kullanarak, JPEG2000 belgenizde filigran bulunan XSLFO dosyasını JPEG2000’ye de aktarabilirsiniz. Filigran eklemek için önce XSLFO’yi JPEG’e dönüştürebilir ve içine bir filigran ekleyebilirsiniz. Filigran eklemek için Image sınıfını kullanarak bir görüntü dosyası yükleyin, Graphics nesnesini oluşturun ://apireference.aspose.com/imaging/java/com.aspose.imaging/Graphics) sınıfını seçin ve Image nesnesiyle başlatın, yeni bir Matrix oluşturun com.aspose.imaging/Matrix) nesnesini seçin ve çeviri ile dönüştürmeyi istediğiniz açıya ayarlayın ve Graphics.drawString kullanarak filigran ekleyin drawString-java.lang.String-com.aspose.imaging.Font-com.aspose.imaging.Brush-float-float-) yöntemi. Resminize filigranı ekledikten sonra JPEG’i JPEG2000 formatında kaydedebilirsiniz.

// supports PDF, CGM, EPUB, TeX, PCL, PS, XPS, MD, MHTML, XSLFO, HTML file formats
// load PDF with an instance of Document
Document document = new Document("input.pdf");
// create an object of JpegDevice
JpegDevice renderer = new JpegDevice();
// convert first of a particular PDF page to JPEG format
renderer.process(document.getPages().get_Item(1), "output.jpeg");
// load JPEG
Image image = Image.load("output.jpeg");
// create and initialize an instance of Graphics class
Graphics graphics= new Graphics(image);
// create an instance of Font
Font font = new Font("Times New Roman", 16, FontStyle.Bold);
// create an instance of SolidBrush and set its properties
SolidBrush brush = new SolidBrush();
brush.setColor(Color.getBlack());
brush.setOpacity(100);
Size sz = graphics.getImage().getSize();
// create an object of Matrix class for transformation
Matrix matrix = new Matrix();
// first a translation then a rotation
matrix.translate(sz.getWidth() / 2, sz.getHeight() / 2);
matrix.rotate(-45.0f);
// set the Transformation through Matrix
graphics.setTransform(matrix);
// draw a string using the SolidBrush and Font objects at specific point
graphics.drawString("Watermark by Aspose.Imaging for Java", font, brush, 0, 0);
// supports Dicom, Jpeg2000, Apng, Psd, Dxf, Wmf, Emz, Wmz, Tga, Svgz file formats
// save JPEG to PSD file format
image.save("output.psd", new PsdOptions());

Java ile XSLFO'yi JPEG2000 Dosyasına Dönüştür ve Döndür

API’yi kullanarak, çıktı JPEG2000 görüntüsünü ihtiyaçlarınıza göre de döndürebilirsiniz. Image.rotateFlip yöntemi, görüntüyü 90/180/270 derece döndürmek ve görüntüyü yatay veya dikey olarak çevirmek için kullanılabilir. Kütüphane, tüm çirkin detayları kapsarken karmaşık işlemleri gerçekleştirmek için basit yöntemler sağlar. Görüntüye uygulamak için döndürme ve çevirme türünü belirtebilirsiniz. Görüntüyü döndürmek ve çevirmek için dönüştürülen JPEG görüntüsünü Image sınıfını kullanarak yükleyebilir ve Görüntüyü çağırabilirsiniz. uygun RotateFlipType belirtilirken rotaryFlip yöntemi.

// supports PDF, CGM, EPUB, TeX, PCL, PS, XPS, MD, MHTML, XSLFO, HTML file formats
// load PDF with an instance of Document
Document document = new Document("input.pdf");
// create an object of JpegDevice
JpegDevice renderer = new JpegDevice();
// convert first of a particular PDF page to JPEG format
renderer.process(document.getPages().get_Item(1), "output.jpeg");
// load JPEG file
Image image = Image.Load("output.jpeg");
// roate image
image.RotateFlip(RotateFlipType.Rotate270FlipNone);
// supports Dicom, Jpeg2000, Apng, Psd, Dxf, Wmf, Emz, Wmz, Tga, Svgz file formats
// save JPEG to PSD file format
image.save("output.psd", new PsdOptions());

Java ile XSLFO Dönüşüm Seçeneklerini Keşfedin

XSLFO s'yi ODP 'ye dönüştürün (OpenDocument Sunum Formatı)
XSLFO s'yi OTP 'ye dönüştürün (OpenDocument Standart Biçimi)
XSLFO s'yi POT 'ye dönüştürün (Microsoft PowerPoint Şablon Dosyaları)
XSLFO s'yi POTM 'ye dönüştürün (Microsoft PowerPoint Şablon Dosyası)
XSLFO s'yi POTX 'ye dönüştürün (Microsoft PowerPoint Şablon Sunumu)
XSLFO s'yi PPS 'ye dönüştürün (PowerPoint Slayt Gösterisi)
XSLFO s'yi PPSM 'ye dönüştürün (Makro özellikli Slayt Gösterisi)
XSLFO s'yi PPSX 'ye dönüştürün (PowerPoint Slayt Gösterisi)
XSLFO s'yi PPTM 'ye dönüştürün (Makro özellikli Sunum Dosyası)
XSLFO s'yi SWF 'ye dönüştürün (Şok Dalgası Flaş Filmi)
XSLFO s'yi APNG 'ye dönüştürün (Animasyonlu Taşınabilir Ağ Grafikleri)
XSLFO s'yi DICOM 'ye dönüştürün (Tıpta Dijital Görüntüleme ve İletişim)
XSLFO s'yi DXF 'ye dönüştürün (Autodesk Çizim Değişim Formatı)
XSLFO s'yi EMZ 'ye dönüştürün (Windows Sıkıştırılmış Gelişmiş Meta Dosyası)
XSLFO s'yi IMAGE 'ye dönüştürün (Görüntü Dosyaları)
XSLFO s'yi SVGZ 'ye dönüştürün (Sıkıştırılmış Ölçeklenebilir Vektör Grafikleri)
XSLFO s'yi TGA 'ye dönüştürün (Truevision Grafik Adaptörü)
XSLFO s'yi WMF 'ye dönüştürün (Windows Meta Dosyası)
XSLFO s'yi WMZ 'ye dönüştürün (Sıkıştırılmış Windows Meta Dosyası)
XSLFO s'yi CSV 'ye dönüştürün (Virgülle Ayrılmış Değerler)
XSLFO s'yi DIF 'ye dönüştürün (Veri Değişim Formatı)
XSLFO s'yi EXCEL 'ye dönüştürün (Elektronik Tablo Dosya Biçimleri)
XSLFO s'yi FODS 'ye dönüştürün (OpenDocument Düz XML Elektronik Tablosu)
XSLFO s'yi ODS 'ye dönüştürün (OpenDocument Elektronik Tablosu)
XSLFO s'yi SXC 'ye dönüştürün (StarOffice Hesap Tablosu)
XSLFO s'yi TSV 'ye dönüştürün (Sekmeyle Ayrılmış Değerler)
XSLFO s'yi XLAM 'ye dönüştürün (Excel Makro Etkin Eklenti)
XSLFO s'yi XLSB 'ye dönüştürün (Excel İkili Çalışma Kitabı)
XSLFO s'yi XLSM 'ye dönüştürün (Makro özellikli Hesap Tablosu)
XSLFO s'yi XLT 'ye dönüştürün (Excel 97 - 2003 Şablonu)
XSLFO s'yi XLTM 'ye dönüştürün (Makro Etkin Excel Şablonu)