Fix two compilation errors at lines 584 and 658 where code was calling .code on &String diagnostics. Replaced d.code.to_string() with direct Vec<String> clone since diagnostics is already Vec<String>. Accepts criteria: - cargo check -p pdftract-cli emits no 'no field code' errors - serve.rs compiles cleanly
19 lines
691 B
Python
19 lines
691 B
Python
#!/usr/bin/env python3
|
|
import pikepdf
|
|
|
|
# Dump the trailer for both files
|
|
print("=== v1 trailer ===")
|
|
with pikepdf.open("tests/fingerprint/fixtures/linearization_toggle/v1.pdf") as pdf:
|
|
print(f"Trailer: {dict(pdf.trailer)}")
|
|
print(f"/Root: {pdf.trailer.get('/Root')}")
|
|
|
|
print("\n=== v2 trailer ===")
|
|
with pikepdf.open("tests/fingerprint/fixtures/linearization_toggle/v2.pdf") as pdf:
|
|
print(f"Trailer: {dict(pdf.trailer)}")
|
|
print(f"/Root: {pdf.trailer.get('/Root')}")
|
|
|
|
# Read raw bytes to find the trailer
|
|
print("\n=== Raw v2 trailer (last 200 bytes) ===")
|
|
with open("tests/fingerprint/fixtures/linearization_toggle/v2.pdf", "rb") as f:
|
|
f.seek(-200, 2)
|
|
print(f.read())
|