Bug 129206 - Macro is not always run & produce pdf file
Summary: Macro is not always run & produce pdf file
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
6.3.3.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-05 11:45 UTC by Jaise James
Modified: 2020-11-28 04:29 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
macro file (13.58 KB, text/plain)
2019-12-05 11:45 UTC, Jaise James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaise James 2019-12-05 11:45:39 UTC
Created attachment 156328 [details]
macro file

pls see the attached macro file to generate pdf with watermark & password. upto Libreoffice 6.2.8, it is running reliably. but in 6.3 & 6.4, it is not working reliably. sometimes it work, but not always. Sometime produce pdf without watermark.
Comment 1 Oliver Brinzing 2019-12-05 18:33:06 UTC
have you tried to replace the watermark/store Dispatches ?

java code would look something like this:

Object xDoc = xComponentLoader.loadComponentFromURL(loadUrl,		"_blank", 0, new PropertyValue[0]);

// Create PDF filter data
PropertyValue pdfFilterData[] = new PropertyValue[1];

// Specifies the PDF version that should be generated:
// 0: PDF 1.4 (default selection) 1: PDF/A-1 (ISO 19005-1:2005)
pdfFilterData[0] = new PropertyValue();
pdfFilterData[0].Name = "SelectPdfVersion";
pdfFilterData[0].Value = new Integer(1);

PropertyValue[] conversionProperties = new PropertyValue[2];
conversionProperties[0] = new PropertyValue();
conversionProperties[0].Name = "FilterName";
conversionProperties[0].Value = "writer_pdf_Export";

conversionProperties[1] = new PropertyValue();
conversionProperties[1].Name = "FilterData";
conversionProperties[1].Value = pdfFilterData;

XStorable xStorable = UnoRuntime.queryInterface(XStorable.class, xDoc);
xStorable.storeToURL(storeUrl, conversionProperties);
			
XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class,	xDoc);
xClose.close(true);

and found a pice of python for watermark:
https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=88965
Comment 2 Jaise James 2020-01-02 13:19:21 UTC
Problem occurring in

    ' Open Required writer document:
    oDoc = StarDesktop.loadComponentFromURL(sUrl, "_blank", 0, FileProperties())

If file is opened already, then macro will work properly.

I test in 6.4.0.1 also. Macro is not working every time.
Comment 3 Jaise James 2020-01-02 13:59:49 UTC
Problem occurs when hidden option is used. 

    ' Open Document to invisible mode
    FileProperties(0).Name = "Hidden"
    FileProperties(0).Value =True

upto LibreOffice 6.2, it is working. 

Any body having same issue?
Comment 4 Buovjaga 2020-04-30 17:25:22 UTC
I ran the macro (after changing the paths to the input/output files), but I get this error:
BASIC runtime error.
An exception occurred 
Type: com.sun.star.util.CloseVetoException
Message: Controller disagree ....

Pointing to line 304:
    oDoc.close(False)

Watermark dialog is left open.

Please advise.

Arch Linux 64-bit
Version: 7.0.0.0.alpha0+
Build ID: 623d6cf06ccba392c1993a3b0ad271d508205e73
CPU threads: 8; OS: Linux 5.6; UI render: default; VCL: kf5; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 29 April 2020
Comment 5 QA Administrators 2020-10-28 04:42:48 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2020-11-28 04:29:19 UTC
Dear Jaise James,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp