Hi.
I got problem with converting pdf to pdf/a - tried all types of pdf/a, b ut all my results are blank pages.
merge_wm.pdf (521.2 KB)
This is pdf that has watermark and when converted to pdf/a, pages are just blank.
This is result pdf
result408.pdf (1.0 MB)
When I get same pdf without watermarks it works fine, but with them it is dead.
this is code I use to convert
var msLog = new MemoryStream();
doc.Convert(msLog, PdfFormat.PDF_A_3U, ConvertErrorAction.Delete);
msLog.Dispose();
in log I don’t see problems that are error with false that it can’t be converted.
- size of that pdf is 2x of what it should be.
tried newest aspose pdf drawing and even 24.3.0 and still same problem.
my code is running on .net 8 c# linux docker.
When I try it convert in random online tools it get converted to pdf/a-3u, but not in aspose pdf.
@mvesely
It seems you are experiencing issues with converting a PDF that contains watermarks to PDF/A format, resulting in blank pages. This can happen due to various reasons, especially when the content of the PDF is not compatible with the PDF/A standards.
Here are a few suggestions to troubleshoot and potentially resolve the issue:
-
Check Watermark Compatibility: Ensure that the watermark you are using is compatible with PDF/A standards. Some types of watermarks or their properties might not be supported in PDF/A, leading to blank pages upon conversion.
-
Use Different PDF/A Versions: You mentioned trying different types of PDF/A. It might be worth experimenting with other versions, such as PDF/A-1b or PDF/A-2b, as they may handle certain content types differently.
-
Validation Before Conversion: Before converting, validate the PDF document to check for any issues that might prevent successful conversion. You can use the Validate
method to generate a log of any problems that need to be addressed.
-
MemoryStream Usage: In your code, you are using a MemoryStream
for logging. Ensure that you are properly handling the stream and that it is not causing any issues during the conversion process. You might want to save the log to a file instead to check for any hidden errors.
-
Update Aspose.PDF Library: Ensure you are using the latest version of the Aspose.PDF library, as updates often include bug fixes and improvements that could resolve your issue.
-
Sample Code for Conversion: Here’s a sample code snippet that demonstrates how to convert a PDF to PDF/A format, including validation:
using System;
using System.IO;
using Aspose.Pdf;
namespace PdfConversionExample
{
class Program
{
static void Main(string[] args)
{
// Load the PDF document
Document pdfDocument = new Document("path/to/your/input.pdf");
// Validate the document
pdfDocument.Validate("validation-log.xml", PdfFormat.PDF_A_1B);
// Convert to PDF/A-1b
pdfDocument.Convert("conversion-log.xml", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
// Save the converted document
pdfDocument.Save("path/to/your/output.pdf");
}
}
}
By following these steps, you should be able to identify the cause of the blank pages and successfully convert your PDF with watermarks to PDF/A format. If the problem persists, consider reaching out to Aspose support with detailed logs for further assistance.
Sources:
[1]: Create PDF A1 With Aspose Pdf
[2]: PDFToPDFA
[3]: PDFToPDFA3b
this is my convert output log
1.0
Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
01/04/2025 09:50:55
Width information for glyphs is inconsistent in embedded font ‘ETKBDN+Helvetica’
Width information for glyphs is inconsistent in embedded font ‘SZIQSU+Helvetica’
Width information for glyphs is inconsistent in embedded font ‘JSHCJL+Helvetica’
Width information for glyphs is inconsistent in embedded font ‘JFTCJA+Helvetica’
Document information entry ‘Creator’ not synchronized with metadata property ‘xmp:CreatorTool’
Document information entry ‘Producer’ not synchronized with metadata property ‘pdf:Producer’
Document information entry ‘CreationDate’ not synchronized with metadata property ‘xmp:CreateDate’
Document information entry ‘ModDate’ not synchronized with metadata property ‘xmp:ModifyDate’
Required property ‘pdfaid:part’ for schema ‘pdfaid’ missing
Required property ‘pdfaid:conformance’ for schema ‘pdfaid’ missing
Device specific color space is used, but no corresponding OutputIntent is present
Device specific color space is used, but no corresponding OutputIntent is present
Device specific color space is used, but no corresponding OutputIntent is present
Device specific color space is used, but no corresponding OutputIntent is present
all errors are Convertable=“True” so they should not be problem.
2a,2b,2u,3a,3b,3u logs are same and log for 1a and 1b are same
1.0
Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
01/04/2025 09:50:48
Object is compressed
Object is compressed
The xref stream is prohibited
The transparency is prohibited ('Group' key)
The transparency is prohibited ('Group' key)
The transparency is prohibited ('Group' key)
The transparency is prohibited ('Group' key)
The transparency is prohibited ('Group' key)
Width information for glyphs is inconsistent in embedded font 'ETKBDN+Helvetica'
Width information for glyphs is inconsistent in embedded font 'SZIQSU+Helvetica'
Width information for glyphs is inconsistent in embedded font 'JSHCJL+Helvetica'
Width information for glyphs is inconsistent in embedded font 'JFTCJA+Helvetica'
Document information entry 'Creator' not synchronized with metadata property 'xmp:CreatorTool'
Document information entry 'Producer' not synchronized with metadata property 'pdf:Producer'
Document information entry 'CreationDate' not synchronized with metadata property 'xmp:CreateDate'
Document information entry 'ModDate' not synchronized with metadata property 'xmp:ModifyDate'
@mvesely
Attached is the output PDF that we obtained in our environment with 24.12 version of the API. It does not have any blank pages.
_out.pdf (2.7 MB)
Can you please try with 24.12 version and share the output with us that is obtained in your environment?
pdf you attached is not pdf/a-3u, that was problem.
When I converted merge_wm.pdf to pdf/a-3u.
@mvesely
pdf you attached is not pdf/a-3u, that was problem.
When I converted merge_wm.pdf to pdf/a-3u.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PDFNET-58957
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.