Skip to content

Commit

Permalink
HDI Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland-Lannuzel committed May 14, 2024
1 parent c0df0dd commit c297cc3
Show file tree
Hide file tree
Showing 44 changed files with 293 additions and 816 deletions.
Binary file modified Components/4D-QPDF.4dbase/4D-QPDF.4DZ
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## __PDF get attachments ( pdf_file : 4D.File ) : Collection__

<u> Description</u>

_This command retrieves PDF/A3 file attachments and returns them in a collection._


## Example

```4d
var $path : 4D.File
var $_attachments : Collection
$path:=File("/RESOURCES/tests/Many Included Files.pdf")
// user error mode
$_attachments:=PDF get attachments($path)
// silent mode
$_attachments:=Try(PDF get attachments($path)) || []
// code error management
Try
$_attachments:=PDF get attachments($path)
Catch
// some errors are accessibles with Last errors command
End try
```

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## __QPDF Check environment__

<u> Description</u>

_This command initializes the QPDF module, checking its readiness and managing different configuration scenarios, depending on whether QPDF is configured for use from the system or as a component of the 4D application. It provides alerts to guide users through the installation of QPDF and its configuration according to their use._
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## __QPDF Update__

<u> Description</u>

_This command automates the installation and configuration of QPDF, ensuring that dependencies are handled correctly and installations are performed seamlessly on different platforms. It handles various scenarios, including installation from Brew, dependency resolution and platform-specific considerations, providing a robust mechanism for integrating QPDF into 4D applications._
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## __QPDF Use component__

<u> Description</u>

_This command is used to manage system configuration parameters related to the "qpdf" module or feature. It reads existing settings, checks whether a specific feature (<b>use_system</b>) is enabled, disables it if necessary, updates the configuration, then displays the folder in which system configuration files are stored for verification purposes._
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## __QPDF Use system__

<u> Description</u>

_This command is used to initialize, read, modify and write system configuration parameters linked to a specific configuration named "qpdf". It ensures that a particular system parameter (<b>use_system</b>) is set to true if it isn't already, then displays the folder in which the system configuration files are stored._


4 changes: 2 additions & 2 deletions Components/4D-QPDF.4dbase/Resources/qpdf/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"use_system": true,
"use_system": false,
"custom_path": ""
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file added Data/TestPDFs/NoAttachment.pdf
Binary file not shown.
Binary file added Data/TestPDFs/NotAPdf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Binary file modified Data/data.4DD
Binary file not shown.
15 changes: 10 additions & 5 deletions Project/Sources/Forms/HDI2/ObjectMethods/Button.4dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
If (Shift down:C543)
$path:="/DATA/TestPDFs/utf16le.pdf"
Else
$path:="/DATA/TestPDFs/Many Included Files.pdf"
var $path : Text
var $pict : Picture
var $file : 4D:C1709.File

Form:C1466.pictureContainer:=$pict
Form:C1466.textContainer:=""

If (Form:C1466.trace)
TRACE:C157
End if

$path:="/DATA/TestPDFs/ManyEnclosures.pdf"
$file:=File:C1566($path; fk posix path:K87:1)

Form:C1466.attachments:=PDF Get attachments($file)

27 changes: 20 additions & 7 deletions Project/Sources/Forms/HDI2/ObjectMethods/Button1.4dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
If (Shift down:C543)
$path:="/DATA/TestPDFs/utf16le.pdf"
Else
$path:="/DATA/TestPDFs/Many Included Files.pdf"
End if
var $pict : Picture
var $doc : Text
var $file : 4D:C1709.File

$file:=File:C1566($path; fk posix path:K87:1)
If (Form:C1466.trace)
TRACE:C157
End if

Form:C1466.attachments:=PDF Get attachments($file)
$doc:=Select document:C905(""; "pdf"; "Select a pdf"; 0)
If (ok=1)

Form:C1466.pictureContainer:=$pict
Form:C1466.textContainer:=""

$file:=File:C1566(document; fk platform path:K87:2)

Form:C1466.attachments:=PDF Get attachments($file)
If (Form:C1466.attachments.length=0)
ALERT:C41("This PDF file has no attachments.")
End if

End if

24 changes: 24 additions & 0 deletions Project/Sources/Forms/HDI2/ObjectMethods/Button2.4dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var $pict : Picture
var $doc : Text
var $file : 4D:C1709.File

If (Form:C1466.trace)
TRACE:C157
End if

$doc:=Select document:C905(""; ""; "Select a NON pdf file"; 0)
If (ok=1)

Form:C1466.pictureContainer:=$pict
Form:C1466.textContainer:=""

$file:=File:C1566(document; fk platform path:K87:2)

Try
Form:C1466.attachments:=PDF Get attachments($file)
Catch
ALERT:C41("This is NOT a PDF file.")
End try

End if

3 changes: 2 additions & 1 deletion Project/Sources/Forms/HDI2/ObjectMethods/List Box.4dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
var $pict : Picture
var $c : Object
var $picture : Picture

Form:C1466.pictureContainer:=$pict
Form:C1466.textContainer:=""
Expand All @@ -7,7 +9,6 @@ If (Form:C1466.currentAttachment#Null:C1517)

$c:=Form:C1466.currentAttachment


Case of
: ($c.mimeType="text/xml")

Expand Down
Loading

0 comments on commit c297cc3

Please sign in to comment.