How to make test file for Pdfium

33 views
Skip to first unread message

Justin Pierce

unread,
May 27, 2024, 7:57:37 AMMay 27
to pdfium
Hello all,

Can I get some guidance regarding creation of test documents for Pdfium unit tests?

I'm using this already existing test document as a reference: (see jpx_lzw.pdf)

but I want to change the page content stream to just draw a grayscale rectangle instead. It's important that it is drawn in grayscale.

Something like this for the content stream:

q
1 i
27.18 790.5 557.58 -210.201 re
W
n
1 g
/GS1 gs
27.18 580.299 557.58 210.201 re
f
.70588 g
27.18 580.299 557.58 153.567 re
f
Q

Cheers,
JD
jpx_lzw.pdf

Alan Screen

unread,
May 28, 2024, 12:26:07 PMMay 28
to Justin Pierce, pdfium
The PDFium test data includes many .in template files, which get converted into PDF files using the python script at //testing/tools/fixup_pdf_template.py.  That script has a comment at the top describing its usage.

There is a template file jpx_lzw.in, so try making a modification to a copy of that to get a grayscale rectangle.


--
You received this message because you are subscribed to the Google Groups "pdfium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/8149de37-8fbc-49ba-836b-7760225c6234n%40googlegroups.com.

DJRecipe

unread,
Jun 2, 2024, 9:37:32 AMJun 2
to Alan Screen, pdfium
Alan,
Thanks, I'll give the script a shot.

Cheers,
JD
Reply all
Reply to author
Forward
0 new messages