-
Notifications
You must be signed in to change notification settings - Fork 0
Usage Examples
Iker Larrea edited this page Dec 29, 2025
·
1 revision
# Convert DOCX to PDF
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-o output.pdf
# Convert spreadsheet
curl -X POST http://localhost:8080/convert \
-F "file=@spreadsheet.xlsx" \
-o output.pdf# Convert specific page range (pages 3-10)
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-F "pageRange=3-10" \
-o excerpt.pdf
# Skip first page (useful for removing cover)
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-F "pageRange=2-" \
-o no-cover.pdf
# Multiple page ranges
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-F "pageRange=1,3,5-7,10-" \
-o selected-pages.pdfSimple text watermark:
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-F "watermark=DRAFT" \
-F "watermarkColor=16711680" \
-o draft.pdfTiled watermark (covers entire page):
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-F "tiledWatermark=CONFIDENTIAL" \
-F "watermarkColor=8421504" \
-F "watermarkRotateAngle=45" \
-o confidential.pdfCustom watermark styling:
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-F "watermark=INTERNAL USE ONLY" \
-F "watermarkColor=16711680" \
-F "watermarkFontHeight=72" \
-F "watermarkFontName=Arial" \
-F "watermarkRotateAngle=45" \
-o watermarked.pdfWatermark Colors (RGB as integer):
- Red:
16711680-(255 * 65536) + (0 * 256) + 0 - Green:
65280-(0 * 65536) + (255 * 256) + 0 - Blue:
255-(0 * 65536) + (0 * 256) + 255 - Gray:
8421504-(128 * 65536) + (128 * 256) + 128
Formula: (R * 65536) + (G * 256) + B
Password protect PDF:
curl -X POST http://localhost:8080/convert \
-F "file=@sensitive.docx" \
-F "encryptFile=true" \
-F "documentOpenPassword=secret123" \
-o encrypted.pdfRestrict permissions:
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-F "restrictPermissions=true" \
-F "permissionPassword=admin123" \
-F "printing=1" \
-F "changes=2" \
-F "enableCopyingOfContent=false" \
-o restricted.pdfPermission levels:
-
printing:0=none,1=low-res,2=high-res -
changes:0=none,1=insert/delete pages,2=fill forms,3=comments,4=all except extraction
PDF/A-2b (recommended for archival):
curl -X POST http://localhost:8080/convert \
-F "file=@archive.docx" \
-F "selectPdfVersion=2" \
-F "useTaggedPdf=true" \
-o archive-pdfa.pdfPDF/A-3b (allows attachments):
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-F "selectPdfVersion=3" \
-o pdfa3.pdfPDF Versions:
-
0- PDF 1.7 (default, most compatible) -
1- PDF/A-1b (ISO 19005-1, long-term archival) -
2- PDF/A-2b (ISO 19005-2, improved archival) -
3- PDF/A-3b (ISO 19005-3, allows embedded files) -
15- PDF 1.5 -
16- PDF 1.6 -
17- PDF 1.7
Create accessible PDF:
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-F "pdfUaCompliance=true" \
-F "useTaggedPdf=true" \
-F "exportBookmarks=true" \
-o accessible.pdfHigh-quality output (lossless):
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-F "useLosslessCompression=true" \
-o high-quality.pdfBalanced quality (JPEG compression):
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-F "quality=85" \
-F "reduceImageResolution=true" \
-F "maxImageResolution=300" \
-o optimized.pdfWeb-optimized (smaller file size):
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-F "quality=70" \
-F "reduceImageResolution=true" \
-F "maxImageResolution=150" \
-o web-optimized.pdfOne sheet per page:
curl -X POST http://localhost:8080/convert \
-F "file=@spreadsheet.xlsx" \
-F "singlePageSheets=true" \
-o spreadsheet.pdfExport notes pages:
curl -X POST http://localhost:8080/convert \
-F "file=@presentation.pptx" \
-F "exportNotesPages=true" \
-o presentation-with-notes.pdfExport only notes (no slides):
curl -X POST http://localhost:8080/convert \
-F "file=@presentation.pptx" \
-F "exportNotesPages=true" \
-F "exportOnlyNotesPages=true" \
-o notes-only.pdfInclude hidden slides:
curl -X POST http://localhost:8080/convert \
-F "file=@presentation.pptx" \
-F "exportHiddenSlides=true" \
-o all-slides.pdfExport form fields:
curl -X POST http://localhost:8080/convert \
-F "file=@form.docx" \
-F "exportFormFields=true" \
-F "formsType=1" \
-o interactive-form.pdfForm types:
-
0- FDF format -
1- PDF format -
2- HTML format -
3- XML format
Professional document (watermark + encryption + PDF/A):
curl -X POST http://localhost:8080/convert \
-F "file=@document.docx" \
-F "watermark=CONFIDENTIAL" \
-F "watermarkColor=16711680" \
-F "encryptFile=true" \
-F "documentOpenPassword=secret123" \
-F "selectPdfVersion=2" \
-F "useTaggedPdf=true" \
-F "exportBookmarks=true" \
-F "quality=90" \
-o professional.pdf