Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/develop' into feature/wo…
Browse files Browse the repository at this point in the history
…pi-updates

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
LinneyS committed Dec 12, 2024
2 parents a47c947 + b984c2a commit 1a4ac13
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Change Log

- docs api: updated the WOPI section
- docs api: added the information about calling editor methods in the frameworks
- docs api: added the Checking PDF forms page
- docspace backend: added the Removed user page

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,30 @@ Test the application using the Node.js development server:

- To stop the development server, select on the command line or command prompt and press *Ctrl+C*.

## Calling editor methods in the Angular component

1. Add the `DocEditor.instances` parameter to the `window` object and get the editor object from it by the editor ID:

```ts
const documentEditor = window.DocEditor.instances["docxEditor"]
```

2. Call any editor [method](../../../Usage%20API/Methods/index.md) from this object:

```ts
documentEditor.showMessage("Welcome to ONLYOFFICE Editor!")
```

Example:

```ts
onDocumentReady = () => {
const documentEditor = window.DocEditor.instances["docxEditor"]

documentEditor.showMessage("Welcome to ONLYOFFICE Editor!")
}
```

## Deploying the demo Angular application

To deploy the application to a production environment, create the build-specific configuration options for Angular projects:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,30 @@ This procedure creates a [basic React application](https://github.com/facebook/c

- To stop the development server, select on the command line or command prompt and press *Ctrl+C*.

## Calling editor methods in the React component

1. Add the `DocEditor.instances` parameter to the `window` object and get the editor object from it by the editor ID:

```tsx
const documentEditor = window.DocEditor.instances["docxEditor"]
```

2. Call any editor [method](../../../Usage%20API/Methods/index.md) from this object:

```tsx
documentEditor.showMessage("Welcome to ONLYOFFICE Editor!")
```

Example:

```tsx
const onDocumentReady = () => {
const documentEditor = window.DocEditor.instances["docxEditor"]
documentEditor.showMessage("Welcome to ONLYOFFICE Editor!")
}
```

## Deploying the demo React application

The easiest way to deploy the application to a production environment is to install [serve](https://github.com/vercel/serve) and create a static server:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,30 @@ This procedure creates a [basic Vue.js application](https://cli.vuejs.org/guide/

- To stop the development server, select on the command line or command prompt and press *Ctrl+C*.

## Calling editor methods in the Vue.js application

1. Add the `DocEditor.instances` parameter to the `window` object and get the editor object from it by the editor ID:

```vue
const documentEditor = window.DocEditor.instances["docEditor"]
```

2. Call any editor [method](../../../Usage%20API/Methods/index.md) from this object:

```vue
documentEditor.showMessage("Welcome to ONLYOFFICE Editor!")
```

Example:

```vue
onDocumentReady() {
const documentEditor = window.DocEditor.instances["docEditor"]
documentEditor.showMessage("Welcome to ONLYOFFICE Editor!")
}
```

## Deploying the demo Vue.js application

The easiest way to deploy the application to a production environment is to install [serve](https://github.com/vercel/serve) and create a static server:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,33 +165,33 @@ bool COfficeFileFormatChecker::isPdfOformFormatFile(unsigned char *pBuffer, int
def is_pdf_form(text):
if not text:
return False
    
index_first = text.find(b"%\xCD\xCA\xD2\xA9\x0D")
if index_first == -1:
return False
    
p_first = text[index_first + 6:]
if not p_first.startswith(b"1 0 obj\x0A<<\x0A"):
return False
    
p_first = p_first[11:]
signature = b"ONLYOFFICEFORM"
index_stream = p_first.find(b"stream\x0D\x0A")
index_meta = p_first.find(signature)
if index_stream == -1 or index_meta == -1 or index_stream < index_meta:
return False
    
p_meta = p_first[index_meta:]
p_meta = p_meta[len(signature) + 3:]
index_meta_last = p_meta.find(b" ")
if index_meta_last == -1:
return False
    
p_meta = p_meta[index_meta_last + 1:]
index_meta_last = p_meta.find(b" ")
if index_meta_last == -1:
return False
    
return True
```

Expand All @@ -202,7 +202,7 @@ def is_pdf_form(text):

public function isOnlyofficeForm($file) {
if ($file === null) return false;
 

$limitDetect = 300;
$onlyofficeFormMetaTag = "ONLYOFFICEFORM";
$path = $file->getStoredFilePath() . "file";
Expand Down

0 comments on commit 1a4ac13

Please sign in to comment.