Documentation
7-PDF Attach Extract And Remove Files – GUI & CLI Documentation
Operate via Tabbed GUI or Command Line
The 7-PDF Attach Extract And Remove Files tool offers two convenient usage modes:
- an intuitive tabbed GUI for visual interaction
- a powerful CLI (Command Line Interface) for automation and integration
The graphical user interface supports all main features by click – ideal for single-use cases. The CLI enables batch processing and professional workflows in automated environments like ERP, DMS, printing systems and more.

Video Tutorial – Tab Functions Overview (PDF Invoice Tab not yet included)
This video illustrates the "Attach", "Extract" and "Remove" tabs for handling attachments in PDF documents. The "PDF Invoice to ZUGFeRD" tab is not yet included, but works identically to the other tabs.
See our short step-by-step guide for converting with Word, Excel or other apps using the "PDF Invoice to ZUGFeRD" tab here...
🖱️ Tab Overview – GUI Functions
Tab | Function |
---|---|
Attach file to PDF | Embeds external files into PDF/A-3 (e.g. ZUGFeRD XML) |
Extract file from PDF | Extracts embedded files from PDF |
Remove file from PDF | Removes embedded files by name or type |
PDF Invoice to ZUGFeRD | Triggers ZUGFeRD conversion via built-in web service |
Privacy | Consent for processing when using web service |
License/Info | Shows license status |
🔐 Licensing & Free Invoice Runs for Converting PDFs to ZUGFeRD
- 25 free ZUGFeRD conversions included in the full version
- License or API key is automatically detected
- Once your free invoice quota is used up, you’ll be guided in-app on how to easily activate an API token for unlimited use.
📍 Converting PDF Invoices to ZUGFeRD – Additional Information
- Only PDF/A-3b files are supported (ISO 19005-3)
No worries: 👉 View the guide here to easily output your invoice using 7-PDF Printer Professional. Just re-print your invoice (e.g. from Acrobat Reader) and you’ll get a valid ZUGFeRD-compliant PDF – fully automated. - 🎯 GUI supports drag & drop and visual feedback
- ⚙️ Perfect for CLI-based background automation
💡 CLI Mode – Command Line Operation
Ideal for power users, automation, integration with ERP, print servers, or batch processing.
Example usage:
PDFAttachExtractAndRemoveFiles.exe -mode "console" -usage "attach" -inpdf "invoice.pdf" -infile "factur-x.xml"
Available CLI Parameters
Parameter | Description |
---|---|
-mode | gui (default), console , hidden |
-usage | attach , extract , remove , generate |
-inpdf | Path to input PDF (PDF/A-3) |
-infile | File to attach (e.g. XML) |
-outpath | Target folder for extracted files |
-fileext | File type filter (e.g. .xml ) |
-byName | Extract/remove specific file by name |
-estandard | ZUGFeRD version: ZF1 , ZF2 , ZF21 |
-apiToken | API token for KI-based conversion |
-logfile | Optional log file output (for hidden ) |
Command Examples
:: Attach file:
PDFAttachExtractAndRemoveFiles.exe -mode "console" -usage "attach" -inpdf "invoice.pdf" -infile "factur-x.xml" -estandard "ZF2"
:: Extract file:
PDFAttachExtractAndRemoveFiles.exe -mode "console" -usage "extract" -inpdf "invoice.pdf" -outpath "C:\\Output" -fileext ".xml"
:: Remove file:
PDFAttachExtractAndRemoveFiles.exe -mode "console" -usage "remove" -inpdf "invoice.pdf" -byName "factur-x.xml"
:: Generate ZUGFeRD PDF:
PDFAttachExtractAndRemoveFiles.exe -mode "console" -usage "generate" -inpdf "invoice.pdf" -apiToken "YOUR_TOKEN"
🔌 API Access via FastAPI & CURL
With a Pro, Team or Enterprise subscription, you gain full API access to our FastAPI-based Invoice Extractor. Automate ZUGFeRD e-invoice conversion directly from your ERP, DMS or web systems.
Access is provided via a secure token-based HTTP POST endpoint returning structured JSON and ZUGFeRD XML – perfect for developers and integration scenarios.
File upload is encrypted via HTTPS and processed securely on German infrastructure. A valid result includes the ZUGFeRD XML response.
Use our documented REST API via /extract-invoice/
endpoint.
Example: Convert PDF to ZUGFeRD XML via CURL
curl -X POST https://generator.7-pdf.de/extract-invoice/ \
-H "accept: application/json" \
-H "Authorization: Bearer [[ T O K E N - C O D E ]]" \
-H "Content-Type: multipart/form-data" \
-F "file=@/Users/benutzername/Documents/Invoice.pdf"
Note: Replace [[ T O K E N - C O D E ]]
with your valid API token. The endpoint returns structured JSON and optionally ZUGFeRD XML.
Sample Response:
{ "success": true, "invoice_number": "2825056", "xml": "<?xml version=\"1.0\" ?>\n<rsm:CrossIndustryInvoice ...", "validation_file": "passed", "validation_string": "passed" }
Test this endpoint using tools like Postman or integrate it into your own scripts.
PowerShell Example: Convert PDF to ZUGFeRD XML on Windows
The API endpoint can also be conveniently called under Windows via a PowerShell script using curl.exe
. This enables direct conversion of a PDF invoice into a factur-x.xml (e-invoice XML). Below is an example script:
# Store that Script Code under: GetFacturXFromPDF.ps1 # Call: .\GetFacturXFromPDF.ps1 # Params: -PdfPath "C:\inv\2025-05-17.pdf" -ApiToken "[[ T O K E N - C O D E ]]" param ( [Parameter(Mandatory = $true)] [string]$PdfPath, [Parameter(Mandatory = $true)] [string]$ApiToken ) # 1. Send PDF to "7-PDF Invoice Extractor" - FastAPI curl.exe -X POST "https://generator.7-pdf.de/extract-invoice/" ` -H "accept: application/json" ` -H "Authorization: Bearer $ApiToken" ` -H "Content-Type: multipart/form-data" ` -F "file=@$PdfPath" ` -o response.json # 2. Read JSON Response $json = Get-Content -Raw -Path .\response.json | ConvertFrom-Json # 3. Extract and store ZUGFeRD XML $json.xml | Set-Content -Encoding UTF8 -Path .\factur-x.xml
Example call in a PowerShell window:
.\GetFacturXFromPDF.ps1 "C:\inv\2025-05-17.pdf" -ApiToken "[[ T O K E N - C O D E ]]"
Tip: If Windows displays a security warning, you may need to unblock the script using Unblock-File .\GetFacturXFromPDF.ps1
.
Note: Replace [[ T O K E N - C O D E ]]
with your valid personal API token. The endpoint accepts PDF files and returns structured invoice data as JSON as well as optional ZUGFeRD-compliant XML.
PowerShell Example: Convert All PDF Invoices in a Folder to ZUGFeRD PDF
The following PowerShell script uses our 7-PDF Invoice Extractor to automatically convert all PDF invoices in a folder into valid PDF ZUGFeRD e-invoices.
The ZUGFeRD XML is embedded using 7-PDF Attach Extract and Remove. Since PDF/A-3b is required, standard PDF invoices must first be converted to this format using our 7-PDF Printer Professional. So both programs must be installed on your system. In addition, an API token is required to access the 7-PDF Invoice Extractor!
The script expects 3 parameters:
-InputFolder "[Path to your standard PDF invoices]"
-OutputFolder "[Output folder for the ZUGFeRD PDF invoices]"
-ApiToken "**[[ T O K E N - C O D E ]]"
** Note: In trail mode of 7-PDF Attach Extract and Remove, simply use a space as an API token
Here is the PowerShell code:
param ( [Parameter(Mandatory = $true)] [string]$InputFolder, [Parameter(Mandatory = $true)] [string]$OutputFolder, [Parameter(Mandatory = $true)] [string]$ApiToken ) function Get-7PdfPrinterAppPath { $key = 'HKLM:\SYSTEM\CurrentControlSet\Control\Print\Printers' $printers = Get-ChildItem -Path $key -ErrorAction SilentlyContinue foreach ($printer in $printers) { $desc = Get-ItemProperty -Path "$key\$($printer.PSChildName)" -ErrorAction SilentlyContinue if ($desc.Description -like "*7-PDF Printer*") { $appFolder = $desc.AppFolder if ($appFolder -and (Test-Path $appFolder)) { return $appFolder } } } return $null } function Escape-PathForPostScript { param ([string]$Path) return ($Path -replace '\\', '/' -replace ' ', '\\ ') } function Save-PostScriptForPdfA3 { param ( [string]$TargetFilePath, [string]$ICCPath, [string]$Title = "PDF Title", [string]$Author = "PDF Author", [string]$Subject = "PDF Subject", [string]$Keywords = "PDF/A, ZUGFeRD", [string]$Producer = "7-PDF Printer", [string]$Creator = "7-PDF Printer" ) $iccUnix = Escape-PathForPostScript $ICCPath $postScriptText = @" %! % This is a sample prefix file for creating a PDF/A document. % Users should modify entries marked with "Customize". % This assumes an ICC profile resides in the file (srgb.icc), % in the current directory unless the user modifies the corresponding line below. % Define entries in the document Info dictionary : [ /Title ($Title) /Author ($Author) /Subject ($Subject) /Keywords ($Keywords) /Producer ($Producer) /Creator ($Creator) /DOCINFO pdfmark % Define an ICC profile : /ICCProfile ($iccUnix) % Customize def [/_objdef {icc_PDFA} /type /stream /OBJ pdfmark [{icc_PDFA} << %% ----------8<--------------8<-------------8<--------------8<---------- systemdict /ColorConversionStrategy known { systemdict /ColorConversionStrategy get cvn dup /Gray eq { pop /N 1 false }{ dup /RGB eq { pop /N 3 false }{ /CMYK eq { /N 4 false }{ (\tColorConversionStrategy not a device space, falling back to ProcessColorModel, output may not be valid PDF/A.\n)= true } ifelse } ifelse } ifelse } { (\tColorConversionStrategy not set, falling back to ProcessColorModel, output may not be valid PDF/A.\n)= true } ifelse { currentpagedevice /ProcessColorModel get dup /DeviceGray eq { pop /N 1 }{ dup /DeviceRGB eq { pop /N 3 }{ dup /DeviceCMYK eq { pop /N 4 } { (\tProcessColorModel not a device space.)= /ProcessColorModel cvx /rangecheck signalerror } ifelse } ifelse } ifelse } if %% ----------8<--------------8<-------------8<--------------8<---------- >> /PUT pdfmark [ {icc_PDFA} {ICCProfile (r) file} stopped { (\n\tFailed to open the supplied ICCProfile for reading. This may be due to\n) print (\t an incorrect filename or a failure to add --permit-file-read=<profile>\n) print (\t to the command line. This PostScript program needs to open the file\n) print (\t and you must explicitly grant it permission to do so.\n\n) print (\tPDF/A processing aborted, output may not be a PDF/A file.\n\n) print cleartomark } { /PUT pdfmark [/_objdef {OutputIntent_PDFA} /type /dict /OBJ pdfmark [{OutputIntent_PDFA} << /Type /OutputIntent /S /GTS_PDFA1 /DestOutputProfile {icc_PDFA} /OutputConditionIdentifier (sRGB) % Customize >> /PUT pdfmark [{Catalog} << /OutputIntents [ {OutputIntent_PDFA} ]>> /PUT pdfmark } ifelse "@ Set-Content -Path $TargetFilePath -Value $postScriptText -Encoding ASCII } function Convert-ToPdfA3b { param ( [string]$InputPdf, [string]$PrinterAppPath ) $gsExe = Join-Path $PrinterAppPath "gs\gswin64c.exe" $iccFile = Join-Path $PrinterAppPath "icc\sRGB_IEC61966-2-1_no_black_scaling.icc" $dir = Split-Path $InputPdf $psFile = Join-Path $dir "lib_PDFA_def.ps" $tempPdfa = Join-Path $dir ("A_" + [System.IO.Path]::GetFileName($InputPdf)) if (-not (Test-Path $gsExe)) { Write-Warning "Ghostscript not found: $gsExe" return $false } if (-not (Test-Path $iccFile)) { Write-Warning "ICC profile missing: $iccFile" return $false } Save-PostScriptForPdfA3 -TargetFilePath $psFile -ICCPath $iccFile # Ghostscript-Args $args = @( "--permit-file-read=$iccFile", "-sDEVICE=pdfwrite", "-dPDFACompatibilityPolicy=1", "-dPDFA=3", "-sColorConversionStrategy=RGB", "-o", "`"$tempPdfa`"", "`"$psFile`"", "`"$InputPdf`"" ) & "$gsExe" @args 2>&1 | Tee-Object "$env:TEMP\gs_pdfa3b.log" if (Test-Path $tempPdfa) { Move-Item $tempPdfa $InputPdf -Force Remove-Item $psFile -Force -ErrorAction SilentlyContinue return $true } else { Write-Warning "PDF/A conversion failed for: $InputPdf (see $env:TEMP\gs_pdfa3b.log)" return $false } } # Tool path to ZUGFeRD processor $toolPath = "C:\Program Files (x86)\7-PDF\7-PDF Attach Extract And Remove Files\PDFAttachExtractAndRemoveFiles.exe" if (-not (Test-Path $toolPath)) { Write-Error "ZUGFeRD processor not found: $toolPath" exit 1 } if (-not (Test-Path $OutputFolder)) { Write-Host "Creating output folder: $OutputFolder" New-Item -ItemType Directory -Path $OutputFolder | Out-Null } $appPath = Get-7PdfPrinterAppPath if (-not $appPath) { Write-Error "7-PDF Printer not found in registry." exit 1 } $successCount = 0 $errorCount = 0 Get-ChildItem -Path $InputFolder -Filter *.pdf | ForEach-Object { $inputFile = $_.FullName $basename = $_.BaseName $outputFile = Join-Path $OutputFolder "$basename.pdf" Write-Host "Processing: $inputFile -> $outputFile" Copy-Item $inputFile $outputFile -Force if (-not (Convert-ToPdfA3b -InputPdf $outputFile -PrinterAppPath $appPath)) { $errorCount++ return } $argLine = "-mode `"hidden`" -usage `"generate`" -inpdf `"$outputFile`" -apiToken `"$ApiToken`"" $proc = Start-Process -FilePath "$toolPath" -ArgumentList $argLine -Wait -NoNewWindow -PassThru if ($proc.ExitCode -eq 0) { $successCount++ } else { Write-Warning "ZUGFeRD processing failed (ExitCode $($proc.ExitCode)): $outputFile" $errorCount++ } } Write-Host "" Write-Host "Script finished." Write-Host "Successfully processed: $successCount file(s)" Write-Host "Failed: $errorCount file(s)"
Example call in a PowerShell window:
.\convert-pdfs-to-pdf-zugferd.ps1 -InputFolder "pdfs_in" -OutputFolder "pdfs_out" -ApiToken "[[ T O K E N - C O D E ]]"
Your API Access Benefits
- Automated processing of PDF invoices in ERP/DMS/Web apps
- No manual steps – 100% server-side handling
- Flexible integration (CURL, Postman, Python, PHP, etc.)
- Secure token authentication
Although no technical lock is currently in place, occasional use with
Starter
or Basic
may succeed – but official access is limited to advanced plans.
Registration of the license key in the application
Your personal license key can be activated as a full version after you have acquired the license in the already installed program using the button "Insert license-key, ..." in the tab "Info". As an illustration, we have a graphic below that shows the button "Enter license key, ..." within the software:
Note: When the license key is entered, it is validated and activated over the Internet (via SSL). Therefore, make sure you have an active internet connection for the unique registration process of the application! In rare cases, locally installed third-party application firewalls may block the program's access to the Internet. When using such third-party firewalls, make sure to grant the necessary rights for access to the Internet for the one-time registration process of the application.
Unfortunately, the issue of software piracy is also harmful to us and we have to face this piracy. This is the only way for us to continue to provide you with maintenance or support services free of charge. The internet is only necessary once for the registration process! What is stored on your systems remains on your systems!
Automatic license distribution for 7-PDF Attach Extract and Remove FULLVERSION
In addition to the manual entry in the installed program, licensing can also be automated in the context of a deployment. For this you set a corresponding registry entry.
For licensing as part of a deployment on "many" (!) PCs, Citrix od TS Systems, at the same time, please contact us. This requires a special key (!) that you can distribute directly, either via an INI file or better via a registry entry. The license key you purchased is not a special key, so there is no point in entering it plain into the registry.
The screenshot below shows the path to capture the special license key within the registry (SpecialKey).
By setting the license key in the "Code" key, the software then launches as a FULL VERSION.
On Citrix and TS Systems it is usually sufficient to start the application with "Run as administrator" and to manually enter the license key you have acquired as admin in the application for licensing. The registry key shown in the figure above is set by the application itself in this scenario. However, this step must be carried out manually for each terminal server. If you have a large number of terminal servers, it is advisable to contact us as well. This scenario also requires a special key that you can distribute automatically.
Automatic deployment / software distribution
To distribute the software, the setup supports the installation parameters /SILENT
and /VERYSILENT
.
If you have further questions about the program, please feel free to contact our free email support. Otherwise, we wish you great success and enjoyment with PDF Attach Extract And Remove Files!