Login to follow
ImageConverter

ImageConverter (ODC)

Stable version 0.2.6 (Compatible with ODC)
Uploaded on 8 Jan by OutSystems Labs
ImageConverter

ImageConverter (ODC)

Documentation
0.2.6

TiffConverter converts TIFF files to PDF or JPEG using AWS S3, compressing files by 70-90% while maintaining OCR quality. Optimized for AI document processing with Claude, GPT-4, and Azure Document Intelligence.


Key Benefits:

• Bypass ODC's 5.5MB limit using S3 pre-signed URLs

• Reduce AI costs by 70-90% through compression

• Handle multi-page documents (all pages preserved in PDF)

• Direct browser upload/download


Functions:

• ConvertTiffS3 - Convert TIFF to PDF or JPEG

• GenerateS3UploadUrl - Browser upload to S3

• GenerateS3DownloadUrl - Browser download from S3

• TestS3Connection - Verify credentials

• DownloadFileFromS3 - Small files (<5.5MB) as binary


Example Workflow: User uploads 200MB TIFF → Compress to 20MB PDF → Send to Claude API → Extract invoice data → Store in database


Prerequisites


OutSystems:

• ODC environment with External Logic enabled

• Permissions to add External Libraries

• ODC Studio installed


AWS:

• Active AWS account

• S3 bucket in preferred region

• IAM user with Access Key + Secret Key

• IAM permissions: s3:PutObject, s3:GetObject, s3:ListBucket


Installation


AWS S3 Setup


Create S3 Bucket


1. AWS Console → S3 → Create bucket

2. Enter unique name (e.g., "mycompany-tiff-processing")

3. Select region (e.g., "us-east-1")

4. Enable Bucket Versioning (recommended)

5. Enable Server-side encryption (recommended)

6. Click Create bucket


Configure CORS (Critical)


CORS is required for browser uploads/downloads.


1. Open bucket → Permissions tab → CORS

2. Click Edit → Paste:


[{

"AllowedHeaders": ["*"],

"AllowedMethods": ["GET", "PUT", "POST"],

"AllowedOrigins": ["https://*.outsystemscloud.com"],

"ExposeHeaders": ["ETag"],

"MaxAgeSeconds": 3000

}]


3. Replace *.outsystemscloud.com with your ODC domain if needed

4. Click Save


AWS Credentials


You need AWS Access Key and Secret Access Key with S3 permissions (s3:PutObject, s3:GetObject, s3:ListBucket) for your bucket.


If you don't have credentials: AWS Console → Security Credentials → Access Keys → Create access key


Configuration in ODC


Store Credentials

Configuration --> Settings, set:

• AWS_AccessKey

• AWS_SecretKey

• AWS_Region (Text, Default: "us-east-1")

• AWS_BucketName (e.g., "outsystems-tiff-convert-abc123")



Configuration Guide


Quality Settings


AI/OCR (Recommended): quality: 80-85, compressPdf: True → 75-85% reduction

Web Display: quality: 70-80, compressPdf: True → 85-90% reduction

Archival: quality: 90-95, compressPdf: True → 50-70% reduction

Exact Copy: quality: 95, compressPdf: False → Minimal compression


URL Expiration


Short uploads: 5-15 minutes

Processing: 30-60 minutes

Batch jobs: 120-240 minutes

Maximum: 10,080 minutes (7 days)


Region Selection


Use the region where your S3 bucket is located:

• US East: us-east-1

• US West: us-west-2

• EU: eu-west-1

• Asia: ap-southeast-1


Troubleshooting


"AWS credentials cannot be empty"

• Verify Site Properties are set

• Check for trailing spaces

• Test with TestS3Connection


"Access Denied" / "403 Forbidden"

• Review IAM policy includes s3:PutObject, s3:GetObject, s3:ListBucket

• Verify bucket name in policy ARN matches actual bucket


"CORS policy" error

• Check S3 bucket → Permissions → CORS configured

• Verify AllowedOrigins includes your ODC domain

• Clear browser cache


"Pre-signed URL expired"

• Generate new URL

• Increase expirationMinutes parameter


Conversion fails

• Check ConvertTiffS3.Success field

• Review ConvertTiffS3.DetailedLog for errors

• Verify TIFF file is valid

• Ensure file <500MB


Timeout on large files

• Reduce quality parameter (try 70)

• Split large TIFFs into batches

• Files >500MB may exceed Lambda limits


Support


GitHub: https://github.com/prifken/outsystems-tiff-jpeg-extension


For issues, include ConvertTiffS3.DetailedLog output.