GroupDocs.Viewer Java ile cdr’yi html, jpg, png, pdf’ye dönüştür
If you need to convert cdr to html (or to JPG, PNG, and PDF) quickly and reliably, you’ve landed on the right tutorial. In this guide we’ll walk through everything you need—from installing GroupDocs.Viewer for Java to rendering CorelDRAW (CDR) files into web‑friendly HTML pages, high‑quality images, and universally readable PDFs. By the end, you’ll be able to integrate these conversions into any Java application with just a few lines of code.

GroupDocs.Viewer for Java ile CDR Dosyalarını Render Et
Hızlı cevaplar
- CDR’yi HTML’ye dönüştüren kütüphane nedir? GroupDocs.Viewer for Java.
- CDR’yi JPG, PNG ve PDF’ye de dönüştürebilir miyim? Evet—farklı görünüm seçenekleriyle aynı Viewer API’sını kullanın.
- Lisans gerekiyor mu? Test için ücretsiz deneme veya geçici lisans çalışır; üretim için tam lisans gereklidir.
- Hangi Java sürümü gerekiyor? JDK 8 veya daha yeni.
- Toplu dönüşüm destekleniyor mu? Kesinlikle—aynı Viewer örneğiyle dosyalar üzerinde döngü yapın.
“convert cdr to html” nedir?
Converting cdr to html means transforming a CorelDRAW vector file into standard HTML markup, optionally embedding images and styles so the design can be viewed directly in a web browser without needing the original design software. The process preserves the original layout, colors, and vector shapes by converting them into scalable SVG elements or raster images embedded in the HTML, enabling accurate visual representation across browsers while keeping file size low.
Neden cdr’yi html, jpg, png veya pdf’ye dönüştürülür?
You can render a single CDR source into four widely supported formats, each serving a distinct purpose: HTML for instant web preview, JPG/PNG for raster images, and PDF for printable, archivable documents. This flexibility lets you serve the optimal file type to any client, reduce storage duplication, and future‑proof your assets.
Önkoşullar
Before we start, make sure you have:
- Kütüphaneler ve bağımlılıklar – GroupDocs.Viewer added to your Maven project.
- Java Development Kit (JDK) – version 8 or newer installed.
- Temel Java bilgisi – to understand the code snippets.
Gerekli kütüphaneler, sürümler ve bağımlılıklar
Add the following Maven configuration to your pom.xml (unchanged from the original tutorial):
<repositories>
<repository>
<id>repository.groupdocs.com</id>
<name>GroupDocs Repository</name>
<url>https://releases.groupdocs.com/viewer/java/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-viewer</artifactId>
<version>25.2</version>
</dependency>
</dependencies>
Lisans edinme adımları
GroupDocs.Viewer offers a free trial, temporary licenses for testing, or full‑purchase options:
- Ücretsiz deneme – Download from the GroupDocs Release Page.
- Geçici lisans – Request one at the GroupDocs Temporary License Page.
- Satın alma – Obtain a permanent license via the GroupDocs Purchase Page.
GroupDocs.Viewer for Java’ı Kurma
Viewer is the core class that loads a document and provides rendering methods for all supported output formats.
Maven ile Kurulum
The Maven snippet above will pull in all required JARs automatically. Just run mvn clean install after saving the file.
Lisans başlatma
Viewer is the core class that loads a document and provides rendering methods for all supported output formats. Initialize your license before rendering any documents:
import com.groupdocs.viewer.License;
License lic = new License();
lic.setLicense("path/to/your/license/file.lic");
Uygulama rehberi
Below you’ll find step‑by‑step examples for each output format. The code blocks are identical to the original tutorial; we only added explanatory text around them.
GroupDocs.Viewer ile cdr’yi html’ye nasıl dönüştürürsünüz
Load a CDR file and call the HTML rendering API – that’s all you need to generate web‑ready markup. The process requires setting up file paths, creating an HtmlViewOptions instance, and invoking viewer.view(). This two‑step pattern works for any document size and preserves vector fidelity.
CDR belgesini HTML’ye render etme
Overview: Convert your CDR files into web‑friendly HTML for easy sharing.
Step 1 – set up file paths
import java.nio.file.Path;
Path outputDirectory = TestFiles.getOutputDirectoryPath("RenderingCdr");
Path pageFilePathFormat = outputDirectory.resolve("cdr_result_{0}.html");
Step 2 – initialize viewer and render
HtmlViewOptions configures HTML rendering, allowing you to embed resources or save them separately. The following code renders each page to a separate HTML file while embedding images as Base64 strings.
import com.groupdocs.viewer.Viewer;
try (Viewer viewer = new Viewer(TestFiles.SAMPLE_CDR)) {
HtmlViewOptions options = HtmlViewOptions.forEmbeddedResources(pageFilePathFormat);
viewer.view(options); // Render the document into HTML format
}
GroupDocs.Viewer ile cdr’yi jpg’ye nasıl dönüştürürsünüz
You can produce high‑quality JPEG images from a CDR source in just two lines of code. First, configure JpgViewOptions with the desired quality, then call viewer.view(). This approach is ideal for thumbnails, email attachments, or any scenario where a compact raster image is needed.
CDR belgesini JPG’ye render etme
Overview: Produce high‑quality JPEG images from your CDR source.
Step 1 – set up file paths
Path pageFilePathFormat = outputDirectory.resolve("cdr_result_{0}.jpg");
Step 2 – initialize viewer and render
JpgViewOptions defines JPEG rendering settings, such as compression quality and output naming. The example below saves each page as a separate JPEG file.
import com.groupdocs.viewer.options.JpgViewOptions;
try (Viewer viewer = new Viewer(TestFiles.SAMPLE_CDR)) {
JpgViewOptions options = new JpgViewOptions(pageFilePathFormat);
viewer.view(options); // Render the document into JPG format
}
GroupDocs.Viewer ile cdr’yi png’ye nasıl dönüştürürsünüz
PNG output gives you lossless raster images, perfect for archival or further graphic processing. Use PngViewOptions to keep every pixel intact, then render the document page by page.
CDR belgesini PNG’ye render etme
Overview: Generate lossless PNG images for archival or design purposes.
Step 1 – set up file paths
Path pageFilePathFormat = outputDirectory.resolve("cdr_result_{0}.png");
Step 2 – initialize viewer and render
PngViewOptions specifies PNG rendering parameters, including support for transparent backgrounds. The code creates a PNG per page automatically.
import com.groupdocs.viewer.options.PngViewOptions;
try (Viewer viewer = new Viewer(TestFiles.SAMPLE_CDR)) {
PngViewOptions options = new PngViewOptions(pageFilePathFormat);
viewer.view(options); // Render the document into PNG format
}
GroupDocs.Viewer ile cdr’yi pdf’ye nasıl dönüştürürsünüz
Turning a CDR file into PDF gives you a universally readable, print‑ready document. PdfViewOptions handles vector to raster conversion internally, preserving layout and fonts without requiring Adobe Illustrator.
CDR belgesini PDF’ye render etme
Overview: Turn your CDR files into universally readable PDFs.
Step 1 – set up file paths
Path pageFilePathFormat = outputDirectory.resolve("cdr_result.pdf");
Step 2 – initialize viewer and render
PdfViewOptions controls PDF generation, enabling font embedding and page layout customization. The snippet creates a single PDF containing all pages.
import com.groupdocs.viewer.options.PdfViewOptions;
try (Viewer viewer = new Viewer(TestFiles.SAMPLE_CDR)) {
PdfViewOptions options = new PdfViewOptions(pageFilePathFormat);
viewer.view(options); // Render the document into PDF format
}
Pratik uygulamalar
- Web portalları: HTML dönüşümünü kullanarak CDR tasarımlarını doğrudan sitenize gömün.
- Görsel galeriler: Hızlı yüklenen galeriler veya ürün katalogları için JPG/PNG çıktıları dağıtın.
- Doküman paylaşımı: Yazdırılabilir, sadece okunabilir bir sürüm ihtiyacı olan müşteriler için PDF sağlayın.
- Arşivleme: Yazılım değişikliklerinden bağımsız gelecekteki erişilebilirliği garanti etmek için birden fazla formatta saklayın.
- Çapraz platform entegrasyonu: Oluşturulan dosyaları OCR, analiz veya dijital varlık yönetim sistemleri gibi sonraki hizmetlere besleyin.
Performans değerlendirmeleri
- Viewer örneklerini hızlıca serbest bırakın (try‑with‑resources ile gösterildiği gibi) bellek boşaltmak için.
- Toplu işleme: Aynı Viewer yapılandırmasıyla bir CDR dosyaları koleksiyonu üzerinde döngü yaparak yükü azaltın.
- Kaynak tahsisi: GroupDocs.Viewer, tüm dosyayı belleğe yüklemeden 500 sayfaya kadar belge render edebilir, ancak çok karmaşık çizimler daha büyük heap boyutundan faydalanabilir. Büyük ölçekli dönüşümler sırasında CPU ve RAM kullanımını izleyin.
Yaygın tuzaklar ve sorun giderme ipuçları
- Eksik yazı tipleri: Çıktı farklı görünüyorsa, gerekli yazı tiplerinin sunucuda mevcut olduğundan emin olun veya
PdfViewOptionsile gömün. - Büyük dosyalar: 200 MB’yi aşan CDR dosyaları için
OutOfMemoryErrorönlemek amacıyla sayfa sayfa işlemeyi düşünün. - Yanlış görüntü kalitesi: JPEG’ler çok sıkıştırılmış görünüyorsa
JpgViewOptionsiçindekisetQualitydeğerini ayarlayın. - Lisans hataları: Lisans dosyası yolunun doğru olduğundan ve lisans sürümünün Viewer kütüphane sürümünüzle eşleştiğinden emin olun.
Sonuç
We’ve shown you how to convert cdr to html, as well as to JPG, PNG, and PDF, using GroupDocs.Viewer for Java. By following the concise code snippets and best‑practice tips, you can embed these conversions into any Java‑based workflow, delivering flexible, high‑quality outputs to your users.
Sonraki adımlar
- Özel sayfa boyutları veya filigranlar gibi gelişmiş render seçenekleriyle deney yapın.
- Dönüşüm hattını bir REST API ile birleştirerek isteğe bağlı dosya dönüşümü sunun.
- Topluluğa katılın ve GroupDocs Forum adresinde sorular sorun.
Sıkça sorulan sorular
Q: Şifre korumalı CDR dosyalarını dönüştürebilir miyim?
A: Evet. Şifre parametresi kabul eden bir Viewer örneğiyle dosyayı yükleyin (API belgelerine bakın).
Q: Aynı anda dönüştürülebilecek sayfa sayısında bir limit var mı?
A: Katı bir limit yok, ancak çok büyük dosyalar daha fazla bellek gerektirebilir; sayfa sayfa işlemeyi düşünün.
Q: HTML çıktısı gömülü yazı tiplerini içeriyor mu?
A: HtmlViewOptions.forEmbeddedResources kullanıldığında, yazı tipleri Base64 olarak gömülür ve tarayıcılar arasında tutarlı render sağlar.
Q: JPEG kalitesini nasıl kontrol ederim?
A: JpgViewOptions 1‑100 arasında bir değer belirtebileceğiniz setQuality(int) metodunu sunar.
Q: Linux sunucusunda CDR dosyalarını dönüştürebilir miyim?
A: Kesinlikle—JDK yüklü olduğu sürece GroupDocs.Viewer platform bağımsızdır.
Son Güncelleme: 2026-08-19
Test Edilen Versiyon: GroupDocs.Viewer 25.2 for Java
Yazar: GroupDocs