{"id":44538892,"url":"https://github.com/embedpdf/pdfium","last_synced_at":"2026-02-13T18:54:41.791Z","repository":{"id":303787715,"uuid":"1016021423","full_name":"embedpdf/pdfium","owner":"embedpdf","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-22T13:20:54.000Z","size":219591,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":0,"default_branch":"embedpdf/main","last_synced_at":"2026-01-23T05:44:39.390Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/embedpdf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-08T11:22:51.000Z","updated_at":"2026-01-22T13:21:07.000Z","dependencies_parsed_at":"2025-07-30T12:28:23.142Z","dependency_job_id":"d3b7bc09-2ed5-4984-8a02-b98f6dfe816a","html_url":"https://github.com/embedpdf/pdfium","commit_stats":null,"previous_names":["embedpdf/pdfium"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/embedpdf/pdfium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedpdf%2Fpdfium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedpdf%2Fpdfium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedpdf%2Fpdfium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedpdf%2Fpdfium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/embedpdf","download_url":"https://codeload.github.com/embedpdf/pdfium/tar.gz/refs/heads/embedpdf/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedpdf%2Fpdfium/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29414285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-13T18:54:41.297Z","updated_at":"2026-02-13T18:54:41.787Z","avatar_url":"https://github.com/embedpdf.png","language":"C++","readme":"# PDFium\n\n## Prerequisites\n\nPDFium uses the same build tooling as Chromium. See the platform-specific\nChromium build instructions to get started, but replace Chromium's\n\"Get the code\" instructions with [PDFium's](#get-the-code).\n\n*   [Chromium Linux build instructions](https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md)\n*   [Chromium Mac build instructions](https://chromium.googlesource.com/chromium/src/+/main/docs/mac_build_instructions.md)\n*   [Chromium Windows build instructions](https://chromium.googlesource.com/chromium/src/+/main/docs/windows_build_instructions.md)\n\n### CPU Architectures supported\n\nThe default architecture for Windows, Linux, and Mac is \"`x64`\". On Windows,\n\"`x86`\" is also supported. GN parameter \"`target_cpu = \"x86\"`\" can be used to\noverride the default value. If you specify Android build, the default CPU\narchitecture will be \"`arm`\".\n\nIt is expected that there are still some places lurking in the code which will\nnot function properly on big-endian architectures. Bugs and/or patches are\nwelcome, however providing this support is **not** a priority at this time.\n\n### Compilers supported\n\nPDFium aims to be compliant with the [Chromium policy](https://chromium.googlesource.com/chromium/src/+/main/docs/toolchain_support.md#existing-toolchain-support).\n\nCurrently this means Clang. Former MSVC users should consider using clang-cl\nif needed. Community-contributed patches for gcc will be allowed. No MSVC\npatches will be taken.\n\n#### Google employees\n\nRun: `download_from_google_storage --config` and follow the\nauthentication instructions. **Note that you must authenticate with your\n@google.com credentials**. Enter \"0\" if asked for a project-id.\n\nOnce you've done this, the toolchain will be installed automatically for\nyou in the [Generate the build files](#generate-the-build-files) step below.\n\nThe toolchain will be in `depot_tools\\win_toolchain\\vs_files\\\u003chash\u003e`, and\nwindbg can be found in\n`depot_tools\\win_toolchain\\vs_files\\\u003chash\u003e\\win_sdk\\Debuggers`.\n\nIf you want the IDE for debugging and editing, you will need to install\nit separately, but this is optional and not needed for building PDFium.\n\n## Get the code\n\nThe name of the top-level directory does not matter. In the following example,\nthe directory name is \"repo\". This directory must not have been used before by\n`gclient config` as each directory can only house a single gclient\nconfiguration.\n\n```\nmkdir repo\ncd repo\ngclient config --unmanaged https://pdfium.googlesource.com/pdfium.git\ngclient sync\ncd pdfium\n```\n\nOn Linux, additional build dependencies need to be installed by running the\nfollowing from the `pdfium` directory.\n\n```\n./build/install-build-deps.sh\n```\n\n## Generate the build files\n\nPDFium uses GN to generate the build files and [Ninja](https://ninja-build.org/)\nto execute the build files.  Both of these are included with the\ndepot\\_tools checkout.\n\n### Selecting build configuration\n\nPDFium may be built either with or without JavaScript support, and with\nor without XFA forms support.  Both of these features are enabled by\ndefault. Also note that the XFA feature requires JavaScript.\n\nConfiguration is done by executing `gn args \u003cdirectory\u003e` to configure the build.\nThis will launch an editor in which you can set the following arguments.\nBy convention, `\u003cdirectory\u003e` should be named `out/foo`, and some tools / test\nsupport code only works if one follows this convention.\nA typical `\u003cdirectory\u003e` name is `out/Debug`.\n\n```\nuse_remoteexec = false # Approved users only.  Do necessary setup \u0026 authentication first.\nis_debug = true  # Enable debugging features.\n\n# Set true to enable experimental Skia backend.\npdf_use_skia = false\n\n# Set true to enable experimental Fontations backend.\npdf_enable_fontations = false\n\npdf_enable_xfa = true  # Set false to remove XFA support (implies JS support).\npdf_enable_v8 = true  # Set false to remove Javascript support.\npdf_is_standalone = true  # Set for a non-embedded build.\nis_component_build = false # Disable component build (Though it should work)\n```\n\nFor test applications like `pdfium_test` to build, one must set\n`pdf_is_standalone = true`.\n\nBy default, the entire project builds with C++20.\n\nBy default, PDFium expects to build with a clang compiler that provides\nadditional chrome plugins. To build against a vanilla one lacking these,\none must set\n`clang_use_chrome_plugins = false`.\n\nWhen complete the arguments will be stored in `\u003cdirectory\u003e/args.gn`, and\nGN will automatically use the new arguments to generate build files.\nShould your files fail to generate, please double-check that you have set\nuse\\_sysroot as indicated above.\n\n## Building the code\n\nYou can build the standalone test program by running:\n`ninja -C \u003cdirectory\u003e pdfium_test`\nYou can build the entire product (which includes a few unit tests) by running:\n`ninja -C \u003cdirectory\u003e pdfium_all`\n\n## Running the standalone test program\n\nThe pdfium\\_test program supports reading, parsing, and rasterizing the pages of\na .pdf file to .ppm or .png output image files (Windows supports two other\nformats). For example: `\u003cdirectory\u003e/pdfium_test --ppm path/to/myfile.pdf`. Note\nthat this will write output images to `path/to/myfile.pdf.\u003cn\u003e.ppm`.\nRun `pdfium_test --help` to see all the options.\n\n## Testing\n\nThere are currently several test suites that can be run:\n\n * pdfium\\_unittests\n * pdfium\\_embeddertests\n * testing/tools/run\\_corpus\\_tests.py\n * testing/tools/run\\_javascript\\_tests.py\n * testing/tools/run\\_pixel\\_tests.py\n\nIt is possible the tests in the `testing` directory can fail due to font\ndifferences on the various platforms. These tests are reliable on the bots. If\nyou see failures, it can be a good idea to run the tests on the tip-of-tree\ncheckout to see if the same failures appear.\n\n### Pixel Tests\n\nIf your change affects rendering, a pixel test should be added. Simply add a\n`.in` or `.pdf` file in `testing/resources/pixel` and the pixel runner will\npick it up at the next run.\n\nMake sure that your test case doesn't have any copyright issues. It should also\nbe a minimal test case focusing on the bug that renders the same way in many\nPDF viewers. Try to avoid binary data in streams by using the `ASCIIHexDecode`\nsimply because it makes the PDF more readable in a text editor.\n\nTo try out your new test, you can call the `run_pixel_tests.py` script:\n\n```bash\n$ ./testing/tools/run_pixel_tests.py your_new_file.in\n```\n\nTo generate the expected image, you can use the `make_expected.sh` script:\n\n```bash\n$ ./testing/tools/make_expected.sh your_new_file.pdf\n```\n\nPlease make sure to have `optipng` installed which optimized the file size of\nthe resulting png.\n\n### `.in` files\n\n`.in` files are PDF template files. PDF files contain many byte offsets that\nhave to be kept correct or the file won't be valid. The template makes this\neasier by replacing the byte offsets with certain keywords.\n\nThis saves space and also allows an easy way to reduce the test case to the\nessentials as you can simply remove everything that is not necessary.\n\nA simple example can be found [here](https://pdfium.googlesource.com/pdfium/+/refs/heads/main/testing/resources/rectangles.in).\n\nTo transform this into a PDF, you can use the `fixup_pdf_template.py` tool:\n\n```bash\n$ ./testing/tools/fixup_pdf_template.py your_file.in\n```\n\nThis will create a `your_file.pdf` in the same directory as `your_file.in`.\n\nThere is no official style guide for the .in file, but a consistent style is\npreferred simply to help with readability. If possible, object numbers should\nbe consecutive and `/Type` and `/SubType` should be on top of a dictionary to\nmake object identification easier.\n\n## Embedding PDFium in your own projects\n\nThe public/ directory contains header files for the APIs available for use by\nembedders of PDFium. The PDFium project endeavors to keep these as stable as\npossible.\n\nOutside of the public/ directory, code may change at any time, and embedders\nshould not directly call these routines.\n\n## Code Coverage\n\nCode coverage reports for PDFium can be generated in Linux development\nenvironments. Details can be found [here](/docs/code-coverage.md).\n\nChromium provides code coverage reports for PDFium\n[here](https://chromium-coverage.appspot.com/). PDFium is located in\n`third_party/pdfium` in Chromium's source code.\nThis includes code coverage from PDFium's fuzzers.\n\n## Waterfall\n\nThe current health of the source tree can be found\n[here](https://ci.chromium.org/p/pdfium/g/main/console).\n\n## Community\n\nThere are several mailing lists that are setup:\n\n * [PDFium](https://groups.google.com/forum/#!forum/pdfium)\n * [PDFium Reviews](https://groups.google.com/forum/#!forum/pdfium-reviews)\n * [PDFium Bugs](https://groups.google.com/forum/#!forum/pdfium-bugs)\n\nNote, the Reviews and Bugs lists are typically read-only.\n\n## Bugs\n\nPDFium uses this [bug tracker](https://crbug.com/pdfium/new), but for security\nbugs, please use\n[Chromium's security bug template](https://crbug.com/new?component=1586257\u0026noWizard=True\u0026template=1922342).\n\n## Contributing code\n\nSee the [CONTRIBUTING](CONTRIBUTING.md) document for more information on\ncontributing to the PDFium project.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembedpdf%2Fpdfium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fembedpdf%2Fpdfium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembedpdf%2Fpdfium/lists"}