tencent cloud

Cloud Infinite

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Product Overview
Product Strengths
Use Cases
Feature Overview
Regions and Domains
Specifications and Limits
Billing
Billing Overview
Billing Mode
Billable Items
Free Tier
Payment Overdue
Viewing Bill Details
FAQs
Getting Started
Registering and Logging In
Bind Bucket
Uploading and Processing File
Downloading and Deleting Images
Unbinding Buckets
Using CI via COS
Features
Image Processing
Media Processing
Content Moderation
AI Content Recognition
File Processing
Smart Voice
File processing
User Guide
Overview
Bucket Management
Smart Toolbox
Job and Workflow
Data Monitoring
Usage statistics
Use Cases
Copyright Protection Solutions
Image Processing Practices
Working with API Authorization Policies
Workflow Practices
API Documentation
API Overview
Structure
Common Request Headers
Common Response Headers
Activate Vast Service
Image Processing
AI-Based Content Recognition
Smart Audio
Media Processing
Content Moderation
Document Processing
File Processing
Job and Workflow
Cloud Virus Detection
Error Codes
Request Signature
SDK Documentation
SDK Overview
Android SDK
iOS SDK
COS Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Go SDK
COS iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
Mini Program SDK
Personal Information Protection Policy for SDK
Security and Compliance
Permission ‍Management
FAQs
Basic Settings
Document Processing
Media Processing
Content Recognition
Smart Audio
Agreements
Service Level Agreement
Contact Us
Glossary

Sync Request API

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2024-02-29 16:52:32

Overview

This document provides an overview of APIs and SDK code samples for sync requests for document preview.
API
Description
Submits a sync request for document preview.

Sync Request API

Feature description

This API is used to submit a sync request for document preview.

Method prototype

func (s *CIService) DocPreview(ctx context.Context, name string, opt *DocPreviewOptions) (*Response, error)

Sample request

opt := &cos.DocPreviewOptions{
Page: 1,
}
resp, err := c.CI.DocPreview(context.Background(), "form.pdf", opt)

Parameter description

type DocPreviewOptions struct {
SrcType string
Page int
ImageParams string
Sheet int
DstType string
Password string
Comment int
ExcelPaperDirection int
Quality int
Zoom int
}
Parameter
Description
Type
name
Object name, such as folder/document.pdf
String
SrcType
Source data type. Currently, the document conversion feature determines the source data type according to the file extension of the COS object. If the object has no extension, you can set this value.
String
page
Number of the document page to be converted, which is counted from 1 by default.
For spreadsheets, page indicates the number of the part in the specified sheet to be converted.
int
ImageParams
Processing parameters for the output image. All parameters of basic image processing are supported. To specify multiple parameters, separate them with pipeline operators. In this way, the image can be processed based on multiple parameters in sequence in the same request.
String
Sheet
Spreadsheet parameter, indicating the number of the sheet to be converted. Default value: 1
int
DstType
Output file extension. Valid values:
png
jpg
pdf
If the specified value cannot be recognized, jpg is used.
String
Password
Password to open the Office document. If you need to convert a password-protected document, set this parameter.
String
Comment
Whether to hide comments and tracked changes.
0 (default): Hide comments and tracked changes.
1: Show comments and tracked changes.
int
ExcelPaperDirection
Paper orientation of the spreadsheet. 0 (default): Vertical; other values: Horizontal
int
Quality
Quality of the generated preview image. Value range: [1-100]. Default value: 100.
For example, if the value is 100, the quality of the generated image will be 100%.
int
Zoom
Scaling parameter of the preview image. Value range: [10-200]. Default value: 100.
For example, if the value is 200, the image will be zoomed in (enlarged) by 200%.
int


Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan