Skip to content

Commit a63ca7b

Browse files
1010299: addressed the feedback provided
1 parent aab98eb commit a63ca7b

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

Document-Processing/PDF/PDF-Library/javascript/DigitalSignature.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ let document: PdfDocument = new PdfDocument(data);
900900
// Access loaded form
901901
let form: PdfForm = document.form;
902902
// Access the loaded form field
903-
let field: PdfSignatureField = form.fieldAt(0);
903+
let field: PdfSignatureField = form.fieldAt(0) as PdfSignatureField;
904904
// Create a digital signature with CMS + SHA-256
905905
const signature: PdfSignature = PdfSignature.create(certificate, 'password', {
906906
digestAlgorithm: DigestAlgorithm.sha256,

Document-Processing/PDF/PDF-Library/javascript/HyperLinks.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ document.destroy();
171171

172172
## Modifying or updating existing hyperlinks
173173

174-
This example shows how to update hyperlink annotations in a PDF using Syncfusion’s JavaScript PDF Library. By accessing an annotation through `page.annotations.at()`, you can check whether it’s a link annotation and then update its URL or bounding region. This makes it easy to refresh outdated links or adjust navigation behavior whenever the document changes.
174+
This example shows how to update hyperlink annotations in a PDF using Syncfusion’s JavaScript PDF Library. Link annotations retrieved from a page can have their URL or bounding region updated as needed. This makes it easy to refresh outdated links or adjust navigation behavior whenever the document changes.
175175

176176
{% tabs %}
177177
{% highlight typescript tabtitle="TypeScript" %}
@@ -182,9 +182,11 @@ let document: PdfDocument = new PdfDocument(data);
182182
// Access the first page
183183
let page: PdfPage = document.getPage(0);
184184
// Get the first annotation of the page
185-
let annotation: PdfTextWebLinkAnnotation = page.annotations.at(0) as PdfTextWebLinkAnnotation;
185+
let annotation: PdfAnnotation = page.annotations.at(0);
186186
// Modified its properties
187-
annotation.url = 'https://www.google.co.in/';
187+
if (annotation instanceof PdfTextWebLinkAnnotation) {
188+
annotation.url = 'https://www.google.co.in/';
189+
}
188190
// Save the document
189191
document.save('Output.pdf');
190192
// Close the document

Document-Processing/PDF/PDF-Library/javascript/Lists.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ document.destroy();
192192

193193
## Applying custom fonts to list items
194194

195-
This example shows how to apply custom fonts to list items in a PDF by using embedded fonts through `document.embedFont()`. The list supports Standard, TrueType, and CJK fonts, allowing accurate rendering of multilingual text. By selecting an embedded font and applying it to the list, you can control the style and appearance of list content with better consistency across platforms.
195+
Custom fonts, including Standard, TrueType, and CJK types, can be embedded and applied to list items for consistent multilingual text rendering across platforms.
196196

197197
{% tabs %}
198198
{% highlight typescript tabtitle="TypeScript" %}
@@ -296,7 +296,7 @@ This example shows how long lists automatically continue onto the next page when
296296

297297
{% tabs %}
298298
{% highlight typescript tabtitle="TypeScript" %}
299-
import { PdfDocument, PdfPage, PdfList, PdfLayoutFormat, PdfUnorderedList, PdfLayoutBreakType, PdfLayoutType, PdfListItemCollection } from '@syncfusion/ej2-pdf';
299+
import { PdfDocument, PdfPage, PdfList, PdfLayoutFormat, PdfUnorderedList, PdfLayoutBreakType, PdfLayoutType, PdfListItemCollection, PdfLayoutResult } from '@syncfusion/ej2-pdf';
300300

301301
// Load the existing document
302302
let document: PdfDocument = new PdfDocument(data);
@@ -311,8 +311,8 @@ format.break = PdfLayoutBreakType.fitElement;
311311
let list1: PdfList = new PdfUnorderedList(new PdfListItemCollection(['PDF', 'XlsIO', 'DocIO', 'PPT', 'PDF', 'XlsIO', 'DocIO', 'PPT']));
312312
let list2: PdfList = new PdfUnorderedList(new PdfListItemCollection(['A paragraph is a series of sentences that are organized and coherent, and are all related to a single topic. Almost every piece of writing you do that is longer than a few sentences should be organized into paragraphs.']), {suffix: '_'});
313313
// Draw the unordered list on the page
314-
list1.draw(page, {x: 50, y: page.size.height - 100}, format);
315-
list2.draw(page, {x: 180, y: page.size.height - 100}, format);
314+
let result1: PdfLayoutResult = list1.draw(page, {x: 50, y: page.size.height - 100}, format);
315+
let result2: PdfLayoutResult = list2.draw(result1.Page, {x: 50, y: result1.bounds.height + 50}, format);
316316
// Save the document
317317
document.save('output.pdf');
318318
// Destroy the document
@@ -334,8 +334,8 @@ format.break = ej.pdf.PdfLayoutBreakType.fitElement;
334334
var list1 = new ej.pdf.PdfUnorderedList(new ej.pdf.PdfListItemCollection(['PDF', 'XlsIO', 'DocIO', 'PPT', 'PDF', 'XlsIO', 'DocIO', 'PPT']));
335335
var list2 = new ej.pdf.PdfUnorderedList(new ej.pdf.PdfListItemCollection(['A paragraph is a series of sentences that are organized and coherent, and are all related to a single topic. Almost every piece of writing you do that is longer than a few sentences should be organized into paragraphs.']), {suffix: '_'});
336336
// Draw the unordered list on the page
337-
list1.draw(page, {x: 50, y: page.size.height - 100}, format);
338-
list2.draw(page, {x: 180, y: page.size.height - 100}, format);
337+
let result1 = list1.draw(page, {x: 50, y: page.size.height - 100}, format);
338+
let result2 = list2.draw(result1.Page, {x: 50, y: result1.bounds.height + 50}, format);
339339
// Save the document
340340
document.save('output.pdf');
341341
// Destroy the document

Document-Processing/PDF/PDF-Library/javascript/Text.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ document.destroy();
359359

360360
## Drawing Right-To-Left text
361361

362-
This example shows how to draw right-to-left (RTL) text using a TrueType font that supports the target RTL script (for example, Hebrew or Arabic). Embed a TTF font that contains the needed glyphs and pass a `PdfStringFormat` when calling `drawString`.
362+
This example demonstrates how to render right-to-left (RTL) text in a PDF document using a TrueType font that supports RTL scripts such as Hebrew or Arabic.
363363

364364
{% tabs %}
365365
{% highlight typescript tabtitle="TypeScript" %}
@@ -411,7 +411,7 @@ document.destroy();
411411

412412
## Embedded font
413413

414-
This example shows how to embed fonts using `document.embedFont()` to ensure consistent text rendering across all platforms. The library supports embedding `PdfStandardFont`, `PdfCjkStandardFont`, and `PdfTrueTypeFont` for reliable Unicode text display. After embedding, the font can be applied through `embedded.getFont()`, allowing precise control over size and style. Additionally, using embedded fonts helps reduce overall PDF size, since the font dictionary is not duplicated for each usage—ensuring cleaner and more efficient output.
414+
This example shows how to embed fonts using `PdfDocument.embedFont()` method to ensure consistent text rendering across all platforms. The library supports embedding `PdfStandardFont`, `PdfCjkStandardFont`, and `PdfTrueTypeFont` for reliable Unicode text display. After embedding, the font can be applied through `PdfFont.getFont()` method, allowing precise control over size and style. Additionally, using embedded fonts helps reduce overall PDF size, since the font dictionary is not duplicated for each usage—ensuring cleaner and more efficient output.
415415

416416
{% tabs %}
417417
{% highlight typescript tabtitle="TypeScript" %}

0 commit comments

Comments
 (0)