Skip to content

Commit

Permalink
Optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
adilfazal-aspose committed Apr 17, 2024
1 parent 6f509de commit 22a7861
Show file tree
Hide file tree
Showing 43 changed files with 46 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Initialize the Annotator object by providing the path to the input PDF file.
using (Annotator annotator = new Annotator("input.pdf"))
PreviewOptions previewOptions = new PreviewOptions(pageNumber =>
{
var pagePath = Path.Combine(Constants.GetOutputDirectoryPath(), $"result_{pageNumber}.png");
var pagePath = Path.Combine("Your Document Directory", $"result_{pageNumber}.png");
return File.Create(pagePath);
});
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Now that we have set up our development environment and imported the required na
## Step 1: Initialize Preview Options
```csharp
PreviewOptions previewOptions = new PreviewOptions(
pageNumber => new FileStream(Path.Combine(Constants.GetOutputDirectoryPath(), $"cells_page{pageNumber}.png"), FileMode.Create),
pageNumber => new FileStream(Path.Combine("Your Document Directory", $"cells_page{pageNumber}.png"), FileMode.Create),
(number, stream) => stream.Dispose()
);
```
Expand All @@ -50,7 +50,7 @@ using (Annotator annotator = new Annotator("input.xlsx"))
```
## Step 4: Display Success Message
```csharp
Console.WriteLine($"\nDocument previews generated successfully.\nCheck output in {Constants.GetOutputDirectoryPath()}.");
Console.WriteLine($"\nDocument previews generated successfully.\nCheck output in {"Your Document Directory"}.");
```

## Conclusion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Define the preview options to specify how the document previews will be generate
```csharp
PreviewOptions previewOptions = new PreviewOptions(pageNumber =>
{
var pagePath = Path.Combine(Constants.GetOutputDirectoryPath(), $"result_with_font_{pageNumber}.png");
var pagePath = Path.Combine("Your Document Directory", $"result_with_font_{pageNumber}.png");
return File.Create(pagePath);
});
previewOptions.PreviewFormat = PreviewFormats.PNG;
Expand All @@ -50,7 +50,7 @@ annotator.Document.GeneratePreview(previewOptions);
## Step 4: Display Output Path
Finally, display a message indicating the successful generation of document previews along with the output directory path:
```csharp
Console.WriteLine($"\nDocument previews generated successfully.\nCheck output in {Constants.GetOutputDirectoryPath()}.");
Console.WriteLine($"\nDocument previews generated successfully.\nCheck output in {"Your Document Directory"}.");
```

## Conclusion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using GroupDocs.Annotation.Models.AnnotationModels;
## Step 1: Define Output Path
First, define the output path where the annotated document will be saved:
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "annotated_document.pdf");
string outputPath = Path.Combine("Your Document Directory", "annotated_document.pdf");
```
## Step 2: Initialize Annotator
Initialize the `Annotator` object by providing the input document path:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Define the preview options, including the desired page resolution and format. Ad
```csharp
PreviewOptions previewOptions = new PreviewOptions(pageNumber =>
{
var pagePath = Path.Combine(Constants.GetOutputDirectoryPath(), $"result_with_resolution_{pageNumber}.png");
var pagePath = Path.Combine("Your Document Directory", $"result_with_resolution_{pageNumber}.png");
return File.Create(pagePath);
});
```
Expand All @@ -55,7 +55,7 @@ Utilize the GeneratePreview method to generate previews for the document based o
## Step 5: Display Success Message
Inform the user about the successful generation of document previews and provide the output directory path for reference.
```csharp
Console.WriteLine($"\nDocument preview with resolution generated successfully.\nCheck output in {Constants.GetOutputDirectoryPath()}.");
Console.WriteLine($"\nDocument preview with resolution generated successfully.\nCheck output in {"Your Document Directory"}.");
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using GroupDocs.Annotation.Options;
```
## Step 1: Initialize Output Path
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Add Button Component
```csharp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using GroupDocs.Annotation.Options;
Now, let's break down the example into multiple steps:
## Step 1: Define Output Path
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
Here, we define the output path where the modified PDF document will be saved.
## Step 2: Initialize Annotator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using GroupDocs.Annotation.Options;
## Step 1: Set Output Path
Define the output path where the modified document will be saved:
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Initialize Annotator
Create an instance of the `Annotator` class by passing the path of the input PDF document:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using System.IO;
Now, let's walk through the process of loading a document from an Amazon S3 bucket and annotating it using Groupdocs.Annotation for .NET.
## Step 1: Define Output Path
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Specify Document Key
```csharp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ To annotate a document stored in Azure Blob Storage, follow these steps:
### Step 1: Set Output Path
Define the output path where the annotated document will be saved.
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
### Step 2: Download Document
Retrieve the document from Azure Blob Storage by invoking the `DownloadFile` method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Now, let's delve into the process of loading a document from FTP and adding anno
## Step 1: Define Output Path
Specify the output path where the annotated document will be saved.
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Load Document from FTP
Retrieve the document from the FTP server using the provided file path.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using GroupDocs.Annotation.Models.AnnotationModels;
## Step 1: Load Document from Local Disk
First, you need to load the document from your local disk. Use the following code snippet:
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
using (Annotator annotator = new Annotator("input.pdf"))
{
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Now, let's break down the annotation process into multiple steps:
## Step 1: Load Document from Stream
Firstly, you need to load the document from a stream. Here's how you can achieve it:
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
using (Annotator annotator = new Annotator(File.OpenRead("input.pdf")))
{
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using System.Net;
To annotate a PDF document from a URL, follow these steps:
### Step 1.1: Define Output Path
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
### Step 1.2: Specify URL
```csharp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using GroupDocs.Annotation.Options;
Now that you have the prerequisites in place and the necessary namespaces imported, let's dive into annotating a password-protected document using GroupDocs.Annotation for .NET. Below is a step-by-step guide to help you accomplish this task:
## Step 1: Load the Document
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
LoadOptions loadOptions = new LoadOptions() { Password = "1234" };
```
In this step, we define the output path for the annotated document and specify the load options, including the password required to open the password-protected document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ using GroupDocs.Annotation.Options;
Now that we've covered the prerequisites and namespace imports, let's dive into the step-by-step process of loading annotated document versions using GroupDocs.Annotation for .NET.
## Step 1: Define Output Path
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Specify Load Options
```csharp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ using GroupDocs.Annotation.Options;

## Step 1: Define Output Path
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
We define the output path where the document with removed annotations will be saved.
## Step 2: Initialize Annotator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Now, let's walk through the process of removing annotations from a document usin
First, define the output path where the document with removed annotations will be saved. You can use the `Path.Combine` method to combine the directory path with the output file name.

```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```

## Step 2: Initialize Annotator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using GroupDocs.Annotation.Options;
```
## Step 1: Define Output Path
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
In this step, we define the output path where the document with removed annotations will be saved.
## Step 2: Remove Annotations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using GroupDocs.Annotation.Options;

## Step 1: Define the Output Path
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
In this step, we define the path where the modified document with removed annotations will be saved.
## Step 2: Instantiate Annotator Object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ annotator.Remove(annotator.Get());
## Step 3: Save the Document
After removing the annotations, save the modified document to the desired location.
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
annotator.Save(outputPath);
```
## Step 4: Display Success Message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using System.IO;
```
## Step 1: Define Output Path
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
Specify the path where you want to save the modified document after removing replies.
## Step 2: Load Document and Annotations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using System.IO;
## Step 1: Define Output Path
Begin by specifying the output path where the annotated document will be saved. You can use the `Path.Combine` method to combine directory paths:
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Load Annotated Document
Load the document that contains annotations with replies using the `Annotator` class:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ annotator.Update(annotations);
## Step 5: Save Document
Save the document with the modified annotations to the desired location.
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
annotator.Save(outputPath);
```
## Step 6: Display Confirmation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using GroupDocs.Annotation.Options;
## Step 1: Initialize Output Path
Define the output path where the annotated document will be saved.
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Initialize Annotator
Create an instance of the `Annotator` class by passing the document's path as a parameter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using GroupDocs.Annotation.Options;
## Step 1: Initialize Annotator
Initialize the annotator by providing the input document file path.
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
using (Annotator annotator = new Annotator("input.pdf"))
{
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ annotator.Add(distance);
Save the annotated document to the desired location on your system.

```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
annotator.Save(outputPath);
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using GroupDocs.Annotation.Options;
## Step 1: Set Output Path
Define the output path where the annotated document will be saved:
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Initialize Annotator
Initialize the annotator by providing the input document path:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using GroupDocs.Annotation.Models.AnnotationModels;
## Step 1: Define Output Path
Define the output path where the annotated document will be saved.
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Initialize Annotator
Initialize the annotator by providing the path to the input document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using GroupDocs.Annotation.Models.AnnotationModels;
## Step 1: Set Output Path
First, define the output path where the annotated document will be saved.
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Initialize Annotator
Create an instance of the `Annotator` class and specify the input document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using GroupDocs.Annotation.Options;
## Step 1: Set Output Path
Define the path where you want to save the annotated document.
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Initialize Annotator
Create an instance of the `Annotator` class by providing the path of the document you want to annotate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using GroupDocs.Annotation.Options;
```
## Step 1: Define Output Path
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
In this step, we define the output path where the annotated document will be saved.
## Step 2: Initialize Annotator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using GroupDocs.Annotation.Options;
## Step 1: Define Output Path
First, define the output path where the annotated document will be saved.
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Initialize Annotator
Initialize the annotator by providing the input document name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using GroupDocs.Annotation.Options;
## Step 1: Define Output Path
Specify the output path where the annotated document will be saved.
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Initialize Annotator Object
Instantiate the Annotator object by providing the path to the input document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using GroupDocs.Annotation.Options;
## Step 1: Define Output Path
Begin by defining the output path where the annotated document will be saved:
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Initialize Annotator
Next, initialize an instance of the `Annotator` class by providing the path to the document you want to annotate:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ using GroupDocs.Annotation.Options;
Now, let's proceed with adding a text field annotation to a document using Groupdocs.Annotation for .NET.
## Step 1: Define Output Path
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Initialize Annotator
```csharp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using GroupDocs.Annotation.Options;
## Step 1: Define Output Path
Specify the output path where the annotated document will be saved:
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Initialize Annotator
Create an instance of the `Annotator` class, passing the document filename as a parameter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using GroupDocs.Annotation.Options;
## Step 1: Define Output Path
Define the output path where you want to save the annotated document. Ensure it's accessible and writable.
```csharp
string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf"));
string outputPath = Path.Combine("Your Document Directory", "result" + Path.GetExtension("input.pdf"));
```
## Step 2: Initialize Annotator
Initialize the annotator with the input document path. Replace `"input.pdf"` with the path to your document.
Expand Down
Loading

0 comments on commit 22a7861

Please sign in to comment.