I want to implement pdf printing from windows machine to Linux. I am using CUPS pdf in linux and driver installation in Windows.
Furthermore, I want to pass some custom parameters with printing like Full name of sender, receiver name, mobile No: to send SMS as Pdf reached etc. (I will use a custom print dialog to fetch these parameters with pint dialog.) How do I pass these along with the printing? How I can I handle this in linux side? What is the easy method for that?
I'm not good in PostScript or Ghostscript. If thats the only solution then I will try. Any alternate solution to pass custom variables from windows to linux printer also welcome.
I didn't get exact help for this , but I achieved this one by 2 printing. Initially printed custom parameters with reference of the next document. Then printed next document. Linux side parsed pdf using shell scripts.
Related
I have a task where I need to fill in PDF Forms. I think they are called Acroforms but I am not sure. It is opposit to XFA Forms (embedded in PDFs), Acroforms are less dynamic, they don't have many features compared to XFA.
I am coding for NodeJS, so I tried its module pdffiller. This library is only a wrapper for so-called pdftk or PDF Toolkit.
It took me almost one day to figure out how to use it on my Ubuntu 18.04 development laptop. I couldn't install it or compile, so I had to download docker image, unpack it and place compiled pdftk in specific system folders to allow pdffiller to work (lib goes here /usr/lib/x86_64-Linux-gnu/libgcj.so.16.0.0, binary goes here /usr/local/bin/pdftk).
Then there go the forms. Those downloaded from official government webpage (these are tax return forms) are XFA forms, these do not work with pdftk - all I get is a request for password which I don't have.
Error: Failed to open PDF file:
tax-return-form.pdf
OWNER PASSWORD REQUIRED, but not given (or incorrect)
Done. Input errors, so no output created.
We took the other approach, we bought Adobe Acrobat DC to convert flat PDFs to simple Acroforms. Then we tested again what PDF Toolkit can do. Two problems are blockers, and dim pdftk unusable for us:
No output for Polish diactrict signs (ąęćśżźnó)
No ability to check a checkbox
And the tax form has plenty of those checkboxes!
I would like to as what tool should we use? Is there any opensource or free for commercial use that will fill PDF Forms properly?
Edit:
I found the way to select checkboxes. After using pdftk dump_data_fields_utf8 method I got a file with a lot of information about fields:
---
FieldType: Button
FieldName: checkbox3
FieldFlags: 0
FieldJustification: Left
FieldStateOption: Off
FieldStateOption: Yes
---
The checkbox above has FieldStateOption: Off or Yes. Just putting Yes in JSON field-value map mad checkboxes selected.
It is doable, but:
there is no utf-8 fonts if one uses 'flatten' option
has to use 'need_appearances' which excludes 'flatten'
Ubuntu's PDF Viewer Evince 3.28.4 doesn't know how to display polish fonts
Firefox, Chrome, Adobe Reader 9 for Linux does display UTF fonts properly.
and fanks for the downvote without explanation why, SO sucks as usual.
Project Environment
The environment we are currently developing is using Windows 10. nodejs 10.16.0, express web framework. The actual environment being deployed is the Linux Ubuntu server and the rest is the same.
What technology do you want to implement?
The technology that I want to implement is the information that I entered when I joined the membership. For example, I want to automatically put it in the input text box using my name, age, address, phone number, etc. so that the user only needs to fill in the remaining information in the PDF. (PDF is on some of the webpages.)
If all the information is entered, the PDF is saved and the document is sent to another vendor, which is the end.
Current Problems
We looked at about four days for PDFs, and we tried to create PDFs when we implemented the outline, structure, and code, just like it was on this site at https://web.archive.org/web/20141010035745/http://gnupdf.org/Introduction_to_PDF
However, most PDFs seem to be compressed into flatDecode rather than this simple. So I also looked at Data extraction from /Filter /FlateDecode PDF stream in PHP and tried to decompress it using QPDF.
Unzip it for now.Well, I thought it would be easy to find out the difference compared to the PDF without Kim after putting it in the first name.
However, there is too much difference even though only three characters are added... And the PDF structure itself is more difficult and complex to proceed with.
Note : https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf (PDF official document in English)
Is there a way to solve the problem now?
It sounds like you want to create a PDF from scratch and possibly extract data from it and you are finding this a more difficult prospect than you first imagined.
Check out my answer here on why PDF creation and reading is non-trivial and why you should reach for a tool you help you do this:
https://stackoverflow.com/a/53357682/1669243
I'm using ldap3.
I can connect and read all attributes without any issue, but I don't know how to display the photo of the attribute thumbnailPhoto.
If I print(conn.entries[0].thumbnailPhoto) I get a bunch of binary values like b'\xff\xd8\xff\xe0\x00\x10JFIF.....'.
I have to display it on a bottle web page. So I have to put this value in a jpeg or png file.
How can I do that?
The easiest way is to save the raw byte value in a file and open it with a picture editor. The photo is probably a jpeg, but it can be in any format.
Have a look at my answer at Display thumbnailPhoto from Active Directory in PHP. It's especially for PHP but the concept is the same for Python.
basically it's about either using the base64 encoded raw-data as data-stream or actually using a temporary file that is serverd (or used to determine the mime-type)
I want to add Support for Retina scanner in Seccubus tool, will it easy? Actually i want to automate the things which Nessus does in Seccubus tool. Can anybody help?
Yes, it is quite easy. You need to convert the output to simple XML format named IVIL and make a script to run and import scans.
You can use the other scanners as a guide to help write a collector for Retina, if anyone is still doing this. do-scan calls seccubus/scanners/[scan name]/scan which then runs the actual scanner with arguments and all. Then the report is saved in /tmp/seccubus.$$ ($$ is the process ID) then it is used as an input file to the command seccubus/bin/[something2ivil] and an output file of /tmp/seccubus.$$.ivil.xml is created which is the input to seccubus/bin/load_ivil and /seccubus/bin/attach_file.
If Retina by default outputs an XML report, then you can take a lot from say the Zap scanner and change things as needed to suit Retina. You would need the files seccubus/scanners/Retina/defaults.txt description.txt help.html and scan to have Retina a viable option on the web interface and a seccubus/bin/retina2ivil script that would convert the XML report to the IVIL format.
If Retina does output an XML report, then a lot of the work is already done for you with all the Zap files. But, to get retina2ivil done correctly you will have to experiment with correctly parsing the XML structure of Retina's outputs. Using the statement
"print Dumper([xml data field/fields]);"
should help you determine if you are correctly parsing the XML or if you're assuming the structure incorrectly.
Is it possible to run a batch file containing a lotus script? Would it also be possible to include a lotus script and then another language for example ksh's? If yes then could you please give me some samples or tutorials on how to do it?
What I need to do is this:
There is already an existing batch file which contains a ksh's that updates the value in an excel files every time it is executed.
What I need to do is include two new functions, first I need to download the excel file from a rich text in a document of lotus notes, then run the functions above written in ksh's after that
I need to re-upload it or update the excel file which is in the lotus notes document. I used lotus script for the added functionality.
I also don't know how to use or create ksh's and batch files. Thanks.
I personally would turn around the logic: why not use a scheduled LotusScript or Java- Agent, detach the file from the richtextitem and then run the ksh from there (e.g. using the Shell- Command of LotusScript)...
That way you can code the stuff you need in the languages that are best for your purpose. You could even attach the ksh to a configuration document and detach it on the fly Or build the ksh completely on the fly (with write commands)... That makes this solution replicate to any number of servers without having to distribute your ksh to each of them...
LotusScript runs only within a scripting host engine provided by IBM Lotus, but LotusScript isn't the only way to access Lotus Notes data.
You haven't said what platform you are running ksh on. You mention that you are operating on Excel files, so if you are running your scripts on Windows it may be possible for you to use the Lotus Notes COM classes. Those classes are almost exactly the same as the back-end classes that you would have available in LotusScript, but I have no idea whether any version of ksh (not to mention whatever version you are using) supports the CreateObject call or any other way to access COM classes.
However, a ksh script can certainly run Java programs, and there are Java classes for Lotus Notes that are (again) almost exactly the same as the back-end classes that you would use in LotusScript. It seems to me that the obvious thing for you to do is write a small Java program to retrieve the file from the Domino server, and another Java program to re-upload it after. Then have your script run the program to do the download, run the commands to modify the Excel data, and then run the program to do the upload.