DynaPDF.SetLineWidth
--------------------

The function sets the line width used to stroke paths.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [3.3](newinversion33.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.SetLineWidth"; PDF; Value ) 

**MBS**( **"DynaPDF.SetLineWidth";** /\* The function sets the line width used to stroke paths. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Value**) /\* The new line width value.e.g. 3 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Value | The new line width value. | 3 |

### Result

Returns OK or error message.

### Description

The function sets the line width used to stroke paths.   
The line width is also used to specify the thickness of the border of annotations and interactive form fields. In the latter case, the line width should be a multiple of one (or zero) and not exceed 3 units. Larger values are still correctly rendered by Adobe's Acrobat but the appearance can be changed when a Reset Form Action is executed or when other changes are made to the document.  
See also [SetLineWidth](https://www.monkeybreadsoftware.com/DynaPDF-Manual/SetLineWidth.shtml) function in DynaPDF manual.

### Examples

Draw two lines in black:

 Set Variable \[$r ; Value:MBS ( "[DynaPDF.SetStrokeColor](DynaPDFSetStrokeColor.md)" ; $pdf ; 0; 0; 0 )\]  
Set Variable \[$r ; Value:MBS ( "DynaPDF.SetLineWidth" ; $pdf ; 1 )\]  
Set Variable \[$r ; Value:MBS ( "[DynaPDF.MoveTo](DynaPDFMoveTo.md)" ; $pdf ; 20; 20)\]  
Set Variable \[$r ; Value:MBS ( "[DynaPDF.LineTo](DynaPDFLineTo.md)" ; $pdf ; 20; 40)\]  
Set Variable \[$r ; Value:MBS ( "[DynaPDF.MoveTo](DynaPDFMoveTo.md)" ; $pdf ; 30; 30)\]  
Set Variable \[$r ; Value:MBS ( "[DynaPDF.LineTo](DynaPDFLineTo.md)" ; $pdf ; 30; 50)\]  
Set Variable \[$r ; Value:MBS ( "[DynaPDF.StrokePath](DynaPDFStrokePath.md)" ; $pdf )\]  
Set line width to zero to hide line:

 Set Variable \[$r ; Value:MBS ( "DynaPDF.SetLineWidth" ; $pdf ; 0 )\]  
### See also

- [DynaPDF.GetLineWidth](DynaPDFGetLineWidth.md)
- [DynaPDF.GetPageWidth](DynaPDFGetPageWidth.md)
- [DynaPDF.GetTextWidth](DynaPDFGetTextWidth.md)
- [DynaPDF.MoveTo](DynaPDFMoveTo.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.PageLink](DynaPDFPageLink.md)
- [DynaPDF.PageLinkEx](DynaPDFPageLinkEx.md)
- [DynaPDF.RoundRect](DynaPDFRoundRect.md)
- [DynaPDF.SetLinkHighlightMode](DynaPDFSetLinkHighlightMode.md)
- [DynaPDF.WriteFTextEx](DynaPDFWriteFTextEx.md)

### Release notes

- **Version 14.4**
    - Fixed incorrect returning of result for [DynaPDF.SetRenderingIntent](https://www.mbsplugins.eu/DynaPDFSetRenderingIntent.shtml), [DynaPDF.SetUserUnit](https://www.mbsplugins.eu/DynaPDFSetUserUnit.shtml) and [DynaPDF.SetLineWidth](https://www.mbsplugins.eu/DynaPDFSetLineWidth.shtml) functions.

### Example Databases

- [DynaPDF/Add Weblinks](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Add%20Weblinks.shtml#3ScriptAnchor_)
- [DynaPDF/Convert to 2 Pages](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Convert%20to%202%20Pages.shtml#4ScriptAnchor_)
- [DynaPDF/Create PDF with Bezier Curves](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Create%20PDF%20with%20Bezier%20Curves.shtml#11ScriptAnchor_)
- [DynaPDF/Create Text as PDFA](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Create%20Text%20as%20PDFA.shtml#7ScriptAnchor_)
- [DynaPDF/Find and Replace Text](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Find%20and%20Replace%20Text.shtml#9ScriptAnchor_)
- [DynaPDF/Place Picture](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Place%20Picture.shtml#1ScriptAnchor_)
- [DynaPDF/Shrink PDF pages](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Shrink%20PDF%20pages.shtml#2ScriptAnchor_)

### Blog Entries

- [Draw images with text using DynaPDF](https://www.mbsplugins.de/archive/2026-01-03/Draw_images_with_text_using_Dy/monkeybreadsoftware_blog_filemaker)
- [Retract text from a PDF with DynaPDF](https://www.mbsplugins.de/archive/2025-11-01/Retract_text_from_a_PDF_with_D/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 14.4pr2](https://www.mbsplugins.de/archive/2024-08-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Adding cutting lines for PDF in FileMaker](https://www.mbsplugins.de/archive/2021-01-04/Adding_cutting_lines_for_PDF_i/monkeybreadsoftware_blog_filemaker)
- [Example Script for DynaPDF.FindText and DynaPDF.WebLink](https://www.mbsplugins.de/archive/2020-05-04/Example_Script_for_DynaPDFFind/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 23th May 2026

  
[DynaPDF.SetLineJoinStyle](DynaPDFSetLineJoinStyle.md) - [DynaPDF.SetLinkHighlightMode](DynaPDFSetLinkHighlightMode.md)

[HTML Version](DynaPDFSetLineWidth.shtml)