Bug 64773 - Visual signatures for .xlsx/.docx
Summary: Visual signatures for .xlsx/.docx
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POIFS (show other bugs)
Version: 4.1.2-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-27 02:21 UTC by lavender
Modified: 2020-10-10 23:42 UTC (History)
0 users



Attachments
Initial version - for docx (60.99 KB, patch)
2020-09-30 23:08 UTC, Andreas Beeker
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description lavender 2020-09-27 02:21:01 UTC
With Office Excel, you can sign xlsx files with pictures, and the label is < signatureimage >. POI doesn't have this feature. Can you add this feature?
The corresponding contents of xmlsignatures / sig1.xml are as follows:

<Object Id="idOfficeObject"><SignatureProperties><SignatureProperty Id="idOfficeV1Details" Target="#idPackageSignature"><SignatureInfoV1 xmlns="http://schemas.microsoft.com/office/2006/digsig"><SetupID>{4735669A-1C30-44D4-83AC-553F8632AF22}</SetupID><SignatureText></SignatureText><SignatureImage>AQAAAGwAAAA...AAAAA==</SignatureImage><SignatureComments></SignatureComments><WindowsVersion>10.0</WindowsVersion><OfficeVersion>16.0.13127/21</OfficeVersion><ApplicationVersion>16.0.13127</ApplicationVersion><Monitors>1</Monitors><HorizontalResolution>1920</HorizontalResolution><VerticalResolution>1080</VerticalResolution><ColorDepth>32</ColorDepth><SignatureProviderId>{000CD6A4-0000-0000-C000-000000000046}</SignatureProviderId><SignatureProviderUrl></SignatureProviderUrl><SignatureProviderDetails>29</SignatureProviderDetails><SignatureType>2</SignatureType></SignatureInfoV1></SignatureProperty></SignatureProperties></Object>
Comment 1 Andreas Beeker 2020-09-30 23:08:45 UTC
Created attachment 37479 [details]
Initial version - for docx

Find attached my first version

I've implemented it for docx first ... as I somehow mixed it up, that you need it for xlsx :S ... but at least you can have a look at the TestSignatureInfo junit test to see how it's supposed to work.

I'm trying to provide the same for xlsx soon
Comment 2 Andreas Beeker 2020-10-10 23:42:15 UTC
Added via r1882394

Seems to work with Excel.
In Word, the signature image is regenerated from the plain image and this update doesn't like bitmaps. Initially I've tested it with the .emf image of a previously manual generated signature - this worked, but Office generally seems to be very picky about the dimensions used in the embedded .emf image.

As this request is for .xlsx, I'm closing the ticket now.

Apart of this, I had to change the way how vmldrawing parts are loaded. I've added a xsd schema, which uses a dummy namespace, which needs to be set when loading vmldrawings and the corresponding xml prefix is dropped (via XmlOption) on saving.