Skip to content

PDFCLOUD-5553 Add client methods to convert to .pdf#18

Merged
datalogics-kam merged 10 commits intopdfrest:mainfrom
datalogics-cgreen:pdfcloud-5464-pdf
Feb 18, 2026
Merged

PDFCLOUD-5553 Add client methods to convert to .pdf#18
datalogics-kam merged 10 commits intopdfrest:mainfrom
datalogics-cgreen:pdfcloud-5464-pdf

Conversation

@datalogics-cgreen
Copy link
Copy Markdown
Contributor

@datalogics-cgreen datalogics-cgreen commented Jan 20, 2026

Adds “Convert to PDF” client support, including conversions from uploaded files and URL sources.

Introduces payload models and public type exports to validate inputs based on source format.

Adds comprehensive unit + live test coverage and a new HTML fixture for conversion cases.

@datalogics-gwalczak datalogics-gwalczak changed the title Pdfcloud 5464 pdf PDFCLOUD-5464 pdf Jan 21, 2026
@datalogics-cgreen datalogics-cgreen changed the title PDFCLOUD-5464 pdf PDFCLOUD-5553 Add client methods to convert to .pdf Jan 30, 2026
Comment thread src/pdfrest/client.py Outdated
Comment thread src/pdfrest/models/_internal.py Outdated
Comment thread src/pdfrest/client.py Outdated
Comment thread src/pdfrest/client.py Outdated
@datalogics-cgreen datalogics-cgreen marked this pull request as ready for review February 13, 2026 19:16
@datalogics-cgreen
Copy link
Copy Markdown
Contributor Author

@datalogics-kam As in Watermark PDF, I've tried to split up the client methods here; I can squash them into the old commits once everything looks good.

Comment thread src/pdfrest/models/_internal.py Outdated
@datalogics-kam
Copy link
Copy Markdown
Contributor

I think this is looking good but needs a rebase.

datalogics-cgreen and others added 10 commits February 18, 2026 10:34
- Add methods for conversion from file and conversion from url
- Do argument validation based on input file format

Assisted-by: Codex
Assisted-by: Codex
- Split by input format "families"
  - eml
  - HTML
  - image
  - Office
  - PostScript
- Leave URL input separate, as it was

Assisted-by: Codex
- Updated method name to reflect singular URL input, improving clarity.
- Adjusted parameter from `urls: UrlInput` to `url: UrlValue` to align with
  single URL support.
- Revised docstrings to clarify behavior for single URL input.
- Renamed `ConvertUrlsToPdfPayload` → `ConvertUrlToPdfPayload`.
- Ensured updates in related tests, including test names and payload
  expectations.

Assisted-by: Codex
- Set default values for `compression`, `downsample`, `tagged_pdf`, `page_size`,
  `page_margin`, `page_orientation`, and `web_layout` in client methods.
- Aligned test cases with updated defaults to ensure consistent behavior.

Assisted-by: Codex
…rsion

- Updated test file names:
  `test_convert_urls_to_pdf.py -> test_convert_url_to_pdf.py`
  `test_live_convert_urls_to_pdf.py -> test_live_convert_url_to_pdf.py`
- Renamed test functions to reflect singular URL input:
  - `test_convert_urls_to_pdf_success` → `test_convert_url_to_pdf_success`
  - `test_convert_urls_to_pdf_validation_errors` → `test_convert_url_to_pdf_validation_errors`
  - `test_async_convert_urls_to_pdf_request_customization` →
    `test_async_convert_url_to_pdf_request_customization`
  - `test_live_convert_urls_to_pdf_success` →
    `test_live_convert_url_to_pdf_success`
  - `test_live_async_convert_urls_to_pdf_invalid_page_size` →
    `test_live_async_convert_url_to_pdf_invalid_page_size`

Assisted-by: Codex
- Implemented `_serialize_as_first_url` to extract the first URL from a list.
- Updated `url` in `ConvertToPdfPayload` to accept a list of `HttpUrl` with
  enforced length of 1.
- Applied `PlainSerializer` to ensure only the first URL is serialized.

Assisted-by: Codex
…ions

- Added tests for invalid page size handling across various conversion methods:
  `convert_html_to_pdf`, `convert_url_to_pdf`, `convert_email_to_pdf`,
  `convert_image_to_pdf`, `convert_office_to_pdf`, and
  `convert_postscript_to_pdf`.
- Introduced request customization tests, including validations for custom
  query parameters, headers, body, and timeout behavior.
- Ensured comprehensive validation of async and sync client operations.

Assisted-by: Codex
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 18, 2026

Deploy Preview for pdfrest-python ready!

Name Link
🔨 Latest commit 17b02ac
🔍 Latest deploy log https://app.netlify.com/projects/pdfrest-python/deploys/6995ea297ac4a900083b98dd
😎 Deploy Preview https://deploy-preview-18--pdfrest-python.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@datalogics-kam datalogics-kam merged commit 8b5fc49 into pdfrest:main Feb 18, 2026
19 checks passed
@datalogics-cgreen datalogics-cgreen deleted the pdfcloud-5464-pdf branch February 18, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants