Cmdlet
Add-OfficePdfBarcode
Adds a QR code or barcode to PDF content as a vector drawing.
Syntax
Add-OfficePdfBarcode
[-Alignment <OfficeAlignment>]
[-AlternativeText <String>]
[-BackgroundColor <OfficeColor>]
[-Color <OfficeColor>]
[-ErrorCorrection <L| M| Q| H>]
[-Height <OfficeLength>]
[-NoHumanReadableText]
[-QuietZone <Int32>]
[-Text] <String>
[-Type <SymbolFormat>]
[-Width <OfficeLength>]
[<CommonParameters>]#Parameter set:
ContentAdd-OfficePdfBarcode
[-Alignment <OfficeAlignment>]
[-AlternativeText <String>]
[-BackgroundColor <OfficeColor>]
[-Color <OfficeColor>]
-Document <PdfDocument>
[-ErrorCorrection <L| M| Q| H>]
[-Height <OfficeLength>]
[-NoHumanReadableText]
[-PassThru]
[-QuietZone <Int32>]
[-Text] <String>
[-Type <SymbolFormat>]
[-Width <OfficeLength>]
[<CommonParameters>]#Parameter set:
DocumentDescription
Two-dimensional codes default to 1.25 inches wide; linear barcodes to 0.33 mm per bar module, with their text underneath. The alternative text defaults to the symbology and the encoded text and is written to the tagged PDF.
Examples
Add a QR code under an invoice summary.
New-OfficePdf -Path .\Invoice.pdf {
PdfParagraph 'Pay online:'
PdfBarcode 'https://pay.example.com/inv/2026-0042' -Alignment Right
}Print a GS1-128 shipping label code on an existing document.
PdfBarcode '(01)09501101530003(17)261231' -Type Gs1Code128 -Document $pdf -Width 8cm -PassThruParameters
- -Alignment OfficeAlignment
- Horizontal alignment in the content flow; left when omitted.
- Possible values:
Left,Center,Right,Justify,Start,End - -AlternativeText String
- Accessible description; defaults to the symbology and the encoded text.
- -BackgroundColor OfficeColor
- Background and quiet zone color; a literal color.
- -Color OfficeColor
- Color of the bars or dark modules; a literal color such as Black or #1F3864.
- -ErrorCorrection QrErrorCorrectionLevel
- QR error correction level: L, M, Q or H.
- Possible values:
L,M,Q,H - -Height OfficeLength
- Height of the whole symbol including human-readable text; numbers mean points.
- -NoHumanReadableText SwitchParameter
- Leave out the human-readable text that linear barcodes print under the bars.
- -QuietZone Int32
- Light margin around the symbol, in modules.
- -Text String
- Text, URL or other data to encode.
- -Type SymbolFormat
- Symbology; QR code by default. Any CodeGlyphX format, such as Code128, Ean, UpcA, DataMatrix or Pdf417.
- Possible values:
QrCode,MicroQrCode,Aztec,Code128,Gs1Code128,Code39,Code93,Ean,UpcA,UpcE,Itf14,Itf,Industrial2Of5,Matrix2Of5,Iata2Of5,PatchCode,Codabar,Msi,Code11,Plessey,Telepen,Pharmacode,PharmacodeTwoTrack,Code32,Postnet,Planet,RoyalMail4State,AustraliaPost,JapanPost,Gs1DataBarTruncated,Gs1DataBarOmnidirectional,Gs1DataBarStacked,Gs1DataBarExpanded,Gs1DataBarExpandedStacked,UspsIntelligentMail,KixCode,DataMatrix,Pdf417,MicroPdf417,RmQrCode,Gs1DataBarLimited,Gs1DataBarStackedOmnidirectional,MaxiCode,DotCode,HanXin,Gs1Composite,Ean2,Ean5,TelepenNumeric,Coop2Of5,Datalogic2Of5,Bc412,FacingIdentificationMark,Daft,Flattermarken,ChannelCode,Code16K,Code49,CodablockF,PosiCode,Mailmark4State,D3Aqr,AztecRune,CodeOne,Ultracode - -Width OfficeLength
- Width of the whole symbol including its quiet zone; numbers mean points.
- -Document PdfDocument
- Document to modify outside the PDF DSL.
- -PassThru SwitchParameter
- Return the modified document; only with Document.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.