PDF Dosya Sürümleri

This article was translated from English: Does it need improvement?
Translated
View the article in English

PDF sürümünü nasıl değiştiririm?

PDF sürüm etiketi, bir PDF oluştururken kullanılan özelliklere göre ayarlanır.

Örneğin:

  • Hiçbir ileri düzey özellik kullanılmayan basit bir PDF muhtemelen 1.4 olacaktır
  • Katmanlar gibi ileri düzey bir özellik eklemek, sürüm etiketini 1.7'ye günceller
  • PDF'den katmanları kaldırmak, sürüm etiketini yeniden 1.4'e değiştirir

PDF oluşturma araçları, her zaman uyumluluk nedenleriyle en düşük PDF sürümünü kullanmaya çalışacaklardır.

Bununla birlikte, IronPDF ile bir PDF dosyası sürümünü 1.4'ten 1.7'ye değiştirmek için kullanılabilecek bir hile, PdfDocument.Merge() statik metodu ve PdfDocument.RemovePage() metodu kombinasyonunu kullanmaktır. Aşağıdaki kod snippet'i bunun nasıl yapılabileceğini göstermektedir:

using IronPdf;

var renderer = new ChromePdfRenderer();

// Render the initial PDF that needs its version changed.
var pdf1 = renderer.RenderHtmlAsPdf("<h1>Hello, this is the required PDF</h1>");

// Render a mock PDF to use with the Merge() method.
var pdf2 = renderer.RenderHtmlAsPdf("<h1>This is a mock PDF</h1>");

// Merge the two PDFs. This will update the version to 1.7 if new features from pdf2 are used.
var pdf3 = PdfDocument.Merge(pdf1, pdf2);

// Remove the page from the mock PDF, keeping only the original content.
var pdf4 = pdf3.RemovePage(1);

// Save the resulting PDF document. It should have a version updated to 1.7.
pdf4.SaveAs("anothermerged.pdf");
using IronPdf;

var renderer = new ChromePdfRenderer();

// Render the initial PDF that needs its version changed.
var pdf1 = renderer.RenderHtmlAsPdf("<h1>Hello, this is the required PDF</h1>");

// Render a mock PDF to use with the Merge() method.
var pdf2 = renderer.RenderHtmlAsPdf("<h1>This is a mock PDF</h1>");

// Merge the two PDFs. This will update the version to 1.7 if new features from pdf2 are used.
var pdf3 = PdfDocument.Merge(pdf1, pdf2);

// Remove the page from the mock PDF, keeping only the original content.
var pdf4 = pdf3.RemovePage(1);

// Save the resulting PDF document. It should have a version updated to 1.7.
pdf4.SaveAs("anothermerged.pdf");
Imports IronPdf

Private renderer = New ChromePdfRenderer()

' Render the initial PDF that needs its version changed.
Private pdf1 = renderer.RenderHtmlAsPdf("<h1>Hello, this is the required PDF</h1>")

' Render a mock PDF to use with the Merge() method.
Private pdf2 = renderer.RenderHtmlAsPdf("<h1>This is a mock PDF</h1>")

' Merge the two PDFs. This will update the version to 1.7 if new features from pdf2 are used.
Private pdf3 = PdfDocument.Merge(pdf1, pdf2)

' Remove the page from the mock PDF, keeping only the original content.
Private pdf4 = pdf3.RemovePage(1)

' Save the resulting PDF document. It should have a version updated to 1.7.
pdf4.SaveAs("anothermerged.pdf")
$vbLabelText   $csharpLabel

Ortaya çıkan PDF çıktısının PDF sürümünü kontrol edebilirsiniz.

Öte yandan, bir PDF'de, örneğin 1.4'ten 2.0'ye PDF sürüm etiketini manuel olarak değiştirebilirsiniz, ancak bu sadece bir etiket olup bu yöntemle PDF'nin kendisini anlamlı bir şekilde değiştirmeyecektir.

Curtis Chau
Teknik Yazar

Curtis Chau, Bilgisayar Bilimleri alanında lisans derecesine sahiptir (Carleton Üniversitesi) ve Node.js, TypeScript, JavaScript ve React konularında uzmanlaşmış ön uç geliştirme üzerine uzmanlaşmıştır. Kullanıcı dostu ve estetik açıdan hoş arayüzler tasarlamaya tutkuyla bağlı olan Curtis, modern çerç...

Daha Fazlasını Oku
Başlamaya Hazır mısınız?
Nuget Indirmeler 18,332,619 | Sürüm: 2026.4 yeni yayınlandı
Still Scrolling Icon

Hala Kaydiriyor musunuz?

Hızlı bir kanit mi istiyorsunuz? PM > Install-Package IronPdf
bir örnek çalıştır HTML'nizin PDF olduğunu izleyin.