PDF Dosya Sürümleri

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

PDF versiyonunu nasıl değiştiririm?

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

Örneğin:

  • Gelişmiş özellikler kullanılmadan oluşturulan temel bir PDF muhtemelen 1.4 olacaktır.
  • Katmanlar gibi gelişmiş bir özellik eklemek, sürüm etiketinin 1.7'ye güncellenmesi anlamına gelir
  • PDF'den katmanları kaldırmak, sürüm etiketini tekrar 1.4'e değiştirecektir

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

Bununla birlikte, IronPDF aracılığıyla bir PDF dosyasının sürümünü 1.4'ten 1.7'ye değiştirmek için kullanılabilecek bir yöntem, PdfDocument.Merge() statik yöntemi ile PdfDocument.RemovePage() yönteminin bir arada kullanılmasıdır. Aşağıdaki kod parçası 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

Oluşturulan PDF çıktısının PDF sürümünü kontrol edebilirsiniz.

Öte yandan, bir PDF içerisinde PDF sürüm etiketini elle değiştirebilirsiniz, örneğin 1.4'ten 2.0'a, ancak bu sadece bir etikettir ve bu yöntemle PDF'nin kendisini anlamlı bir şekilde değiştirmez.

Curtis Chau
Teknik Yazar

Curtis Chau, Bilgisayar Bilimleri alanında Lisans Derecesine (Carleton Üniversitesi) sahip ve Node.js, TypeScript, JavaScript ve React konularında uzmanlaşmış ön uç geliştirmeyle ilgileniyor. Sezgisel ve estetik açıdan hoş kullanıcı arayüzleri oluşturma tutkunu, Curtis modern çerçevelerle çalışmayı ve iyi yapı...

Daha Fazla Oku
Başlamaya Hazır mısınız?
Nuget İndirmeler 19,014,616 | Sürüm: 2026.5 just released
Still Scrolling Icon

Hâlâ Kaydırıyor Musunuz?

Hızlıca kanıt ister misiniz? PM > Install-Package IronPdf
bir örnek çalıştır HTML'nizi bir PDF'ye dönüştüğünü izleyin.