Documentation · Frontend Guide
PDF Datasheet
This document covers the PDF datasheet (vehicle exposé) feature of the ADP Car Market Hub WordPress Plugin: how visitors access it, what it contains, and how it is configured.
When to use this document
Read this document if you are enabling the PDF datasheet feature for the first time, configuring its branding and content, or troubleshooting issues with the download link or rendered output.
Overview
The PDF datasheet feature provides a print-optimized vehicle summary page that visitors can open in their browser and save or print as a PDF using the browser's built-in print dialog. It is not a server-generated PDF file; instead, it is a standalone HTML page rendered by the plugin specifically for printing.
When a visitor clicks the "Download PDF" button on a vehicle detail page, the browser navigates to a special URL. The plugin intercepts the request, renders a full standalone HTML page (without the WordPress theme header and footer), and exits. The visitor can then use the browser's File → Print → Save as PDF function to save the document.
Requirements or prerequisites
- The PDF datasheet feature must be enabled in the plugin settings (
FEATURE_PDF_DATASHEET). It is enabled by default. - The vehicle must be published. Drafts and private posts return a 404 error from the datasheet endpoint.
- Pretty permalinks must be enabled in WordPress for the query variable used by the datasheet URL to be processed correctly.
Step-by-step instructions
Enable the PDF datasheet feature
- In the WordPress admin, open the plugin settings.
- Locate the PDF Datasheet feature toggle and confirm it is enabled.
- Navigate to the PDF Manager section to configure branding and content fields.
- Save the settings.
The "Download PDF" button will appear on all published vehicle detail pages.
Access the PDF datasheet as a visitor
- Open a vehicle detail page.
- Click the Download PDF or exposé button.
- The browser navigates to the datasheet page. This page has no site header or footer — it is styled specifically for printing.
- Use the browser's print function (Ctrl+P or Cmd+P, or File → Print) and choose Save as PDF as the destination.
- Adjust print settings if needed (paper size, margins) and save the file.
Access the datasheet URL directly
The datasheet is available at:
https://yoursite.com/?as24ci_pdf={post_id}
where {post_id} is the numeric WordPress post ID of the vehicle. This URL is accessible to any visitor without authentication, as long as the vehicle is published.
Configuration reference
Feature toggle
| Setting | Option key | Default | Description |
|---|---|---|---|
| Enable PDF datasheet | as24ci_feature_pdf_datasheet | On (1) | Shows or hides the "Download PDF" button on vehicle detail pages |
PDF Manager settings
The PDF Manager controls the branding, layout, and content of the rendered datasheet. Settings are stored as a single serialized array option (as24ci_pdf_manager_settings).
Branding:
| Setting | Default | Description |
|---|---|---|
| Logo | None | Upload a logo image to appear in the header |
| Show company | On | Include the seller company name |
| Show address | On | Include the seller address |
| Show phone | On | Include the seller phone number |
| Show email | On | Include the seller email address |
| Show website | Off | Include the seller website URL |
| Primary color | #0073aa | Main color used for headings and accents |
| Accent color | #1a1a1a | Secondary color |
Layout:
| Setting | Default | Description |
|---|---|---|
| Paper format | A4 | Paper size for print layout |
| Number of images | 1 | How many vehicle images to include in the datasheet |
| Show gallery | On | Whether to show the image gallery section |
| Show price box | On | Whether to show the price box |
| Show contact | On | Whether to show the seller contact information section |
QR code:
| Setting | Default | Description |
|---|---|---|
| Show QR | Off | Include a QR code linking back to the vehicle detail page on the website |
The QR code is generated using a public third-party service (api.qrserver.com). This service is called at the time the datasheet page is loaded. If your privacy policy does not permit external service calls for visitors, this option should remain disabled, or the QR image URL can be replaced via the as24ci_pdf_qr_image_url filter.
Content fields:
The following fields can be individually enabled or disabled in the PDF Manager:
| Field key | Label |
|---|---|
title | Vehicle title |
price | Price |
mileage | Mileage |
first_reg | First registration |
fuel_type | Fuel type |
transmission | Transmission |
power | Power |
body_type | Body type |
exterior_color | Exterior color |
doors | Doors |
seats | Seats |
emission_class | Emission class |
co2 | CO₂ values |
consumption | Energy consumption |
equipment | Equipment list |
description | Vehicle description |
location | Location |
contact | Contact information |
All fields are enabled by default. Disabling a field removes it from the rendered datasheet for all vehicles.
Legal notice:
A custom legal notice text can be added. This text appears in the footer of the datasheet. Use this field for required legal disclaimers, price footnotes, or terms of use.
Operational notes
- The datasheet endpoint is triggered by the
as24ci_pdfquery variable. The plugin registers this variable with WordPress via thequery_varsfilter and intercepts the request intemplate_redirect. - The rendered page is a complete standalone HTML document. It does not use
wp_head()orwp_footer(). All styles are inlined within the page. - The seller information shown on the datasheet is read from the post author's user meta fields (
as24ci_seller_display_name,as24ci_seller_email,as24ci_seller_phone,as24ci_seller_address). If these fields are empty, the WordPress user's display name and email are used as fallback. - Visiting the datasheet URL with an invalid post ID returns an HTTP 400 error. Visiting with a valid ID for an unpublished vehicle returns an HTTP 404 error.
- Page caching plugins may cache the datasheet URL. To prevent this, configure your caching plugin to exclude URLs containing the
as24ci_pdfquery parameter.
Troubleshooting
The "Download PDF" button does not appear on vehicle pages.
- Confirm the PDF datasheet feature is enabled in the plugin settings.
- Check the Layout Manager to ensure the PDF download element is active for the single vehicle page zone.
The datasheet URL returns a 404 error.
- Verify the vehicle is published. Drafts, private posts, and deleted vehicles return 404.
- Check that the post type matches the plugin's custom post type (
as24ci_car).
The datasheet URL returns a 400 error.
- The post ID in the URL is invalid or zero. Verify the URL is being generated correctly.
The datasheet renders without a logo or branding.
- In the PDF Manager, confirm a logo image has been selected and saved.
- If the logo is not appearing, verify the attachment ID stored in the PDF Manager settings points to a valid uploaded image.
The QR code does not appear on the datasheet.
- Confirm the QR code option is enabled in the PDF Manager.
- The QR service (
api.qrserver.com) is called when the page loads. If your hosting blocks outbound HTTP requests or the service is temporarily unavailable, the image may not load. - You can replace the QR image URL using the
as24ci_pdf_qr_image_urlfilter. Return an empty string from the filter to suppress the QR code entirely.
The datasheet is being cached incorrectly by a caching plugin.
- Add the
as24ci_pdfquery parameter to your caching plugin's list of excluded URLs or parameters.