PDF Dosya Sürümleri
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 ile bir PDF dosya sürümünü 1.4'ten 1.7'ye değiştirmek için kullanılabilecek bir yöntem, PdfDocument.Merge() statik metodu ile PdfDocument.RemovePage() metodunun kombinasyonunu kullanmaktı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.
pdf3.RemovePage(1);
// Save the resulting PDF document. It should have a version updated to 1.7.
pdf3.SaveAs("anothermerged.pdf");Imports IronPdf
Dim renderer = New ChromePdfRenderer()
' Render the initial PDF that needs its version changed.
Dim pdf1 = renderer.RenderHtmlAsPdf("<h1>Hello, this is the required PDF</h1>")
' Render a mock PDF to use with the Merge() method.
Dim 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.
Dim pdf3 = PdfDocument.Merge(pdf1, pdf2)
' Remove the page from the mock PDF, keeping only the original content.
pdf3.RemovePage(1)
' Save the resulting PDF document. It should have a version updated to 1.7.
pdf3.SaveAs("anothermerged.pdf")Imports IronPdf
Dim renderer = New ChromePdfRenderer()
' Render the initial PDF that needs its version changed.
Dim pdf1 = renderer.RenderHtmlAsPdf("<h1>Hello, this is the required PDF</h1>")
' Render a mock PDF to use with the Merge() method.
Dim 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.
Dim pdf3 = PdfDocument.Merge(pdf1, pdf2)
' Remove the page from the mock PDF, keeping only the original content.
pdf3.RemovePage(1)
' Save the resulting PDF document. It should have a version updated to 1.7.
pdf3.SaveAs("anothermerged.pdf")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, 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ılandırılmış, görsel olarak çekici kılavuzlar oluşturmayı seviyor.