Debenu Quick PDF logo

EmbedRelatedFile

Document properties

Version history

This function was introduced in Quick PDF Library version 13.12.

Description

Embeds a file into the PDF document and creates a file attachment link to the embedded file. The file can then be accessed in Acrobat under the File Attachments function.

A file relationship setting is also added to the embedded file according to the PDF/A-3 specification.

Set the Options parameter to 1 to embed a ZUGFeRD XML file. This will embed the invoice data and also set up the document correctly according to the ZUGFeRD specification.

Syntax

Delphi

function TDebenuPDFLibrary1811.EmbedRelatedFile(Title, FileName, MIMEType, 
  AFRelationship: WideString; Options: Integer): Integer;

ActiveX

Function DebenuPDFLibrary1811.PDFLibrary::EmbedRelatedFile(Title As String,
  FileName As String, MIMEType As String, AFRelationship As String,
  Options As Long) As Long

DLL

int DPLEmbedRelatedFile(int InstanceID, wchar_t * Title, wchar_t * FileName,
  wchar_t * MIMEType, wchar_t * AFRelationship, int Options)

Parameters

Title A unique title for this file. No two files can have the same title. If a file with this title already exists in the document the new file will not be embedded.
FileName The full path and name of the file to embed.
MIMEType The optional MIME type of the file, for example "text/xml" for an XML file. See http://www.iana.org/assignments/media-types/ for a full list of MIME types. If the MIME type is not known it can be set to an empty string.
AFRelationship The relationship between the embedded file and the document. Can be one of "Data", "Source", "Alternative", "Supplement" or "Unspecified".
Options 0 = Regular embedding
1 = ZUGFeRD 1.0 mode
20 = ZUGFeRD 2.0 mode
21 = ZUGFeRD 2.1 mode

Return values

0 The file could not be embedded
1 The file was embedded successfully

Copyright © 2020 Debenu. All rights reserved. AboutContactBlogNewsletterSupport