How to use long strings in delphi xe4? - delphi

I want decode a large base64 code on my delphi project
When I paste it in my project I see the Long String error ..
for solve it I use to it syntax:
'samecode'+
'samecode'+
'samecode';
But if I manually using this syntax it's too large time ...
Is there the quick way for solve it ?

You have a few options:
Compile the text to a string resource and link that to your executable. Load the resource at runtime.
Place the text in a file that you deploy alongside your executable and load it at runtime.
Write a script to read the text and format it to a manner suitable for inclusion in your source code.
Since your text is actually a base64 encoded file, I doubt that you want to do any of this. What you really ought to be doing is decoding the base64 text to a binary file and linking that as a resource.
Given that the base64 encoded file is in fact a virus (MSIL/Bladabindi.AJ), I cannot imagine anybody wanting to help you. I'm disappointed that I've done as much as I have. You should be ashamed of yourself.

Related

Tex4ebook tidy command missing

I'm converting a Latex document with Tex4ebook (built on tex4ht) and I get the following warning: exec_epub: tidy command seems missing, you should install it in order to make a valid epub file.
But where do I install it and what does it do?
Thanks in advance.
tex4ebook uses HTML Tidy for clean-up of the generated XML files that can contain some issues resulting from the conversion process. If tex4ebook cannot find Tidy, it will use regular expressions for the clean-up. It is usually enough for production of the valid Epub file, so you don't really need to worry about the warning, as long as the generated file is valid.

Identify old dos system file type and decode it into text file

I have pick up an old dos system from my friend, and I need to import the data into SQL, but before importing the data, i need to decode it into a readable text file, but I failed to do so. I have try several stuff:
file command in ubuntu terminal, it said "data"
Use online trid and it said macbin(MacBinary 1)
Tried bin2hex, but couldn't unhex it
Tried some online macbin to hex, no luck as well
Tried to open in macOS, but it keep extracting files
bin2hex said, nothing here
stuffitexpander.... Doesn't recognize...
This is the file that i need to decode
https://gofile.io/?c=wdbs6A
Please let me know if you need the original program.
I think they are just some database files.
Use this site for explanations. they even have a file analyzer - showing you the data inside.
You will need to rename the files to .db extension instead of .ocm.

Best way to parse pdf and word doc

I want to build an application that gets info out of a pdf or word doc and populate this into my database.
How do I go about this in the best way? Bare in mind that only certain information needs to be extracted from the pdf or word docu.
To parse PDF, I know 2 choices :
pdftotext
Check pdf2text
OCR
try tesseract
There are planty of free open source libs that will help you parsing the input file.
in the basic concepts- dont build the parser from scratch ,
use some open source lib to help you out.
if you will say in what lang you'r trying to write your code it may help:
for example for PDF your can find:
https://www.pdfparser.org/ (for php)
https://www.codeproject.com/Articles/12445/Converting-PDF-to-Text-in-C (for C#)
and more.
for DOC\DOCX , pretty much the same.

How to convert a string to pdf file in Python without using temp txt-file on HDD?

I have a big library in plain txt-format.
I need to convert these files into pdf format (from inside Python script, not from command-line), but previously I need to make some manipulations on the original files' text.
I'm just reading the files' content into string, make the needed changes, and then I want to output the changed string into pdf-file, but without creating temporary text file on HDD.
Is there any way to do that?
Thanks in advance.
P.S. BTW, the library is in Russian, so I suppose I'll need to take care of encodings?
use the ReportLab toolkit: http://www.reportlab.com/software/opensource/rl-toolkit/
(it is also on PyPi: pip install reportlab; or if you are running Linux use the package manager)
The default built-in fonts of PDF do not support Russian, so you will have to do something
like:
canvas.setFont('DejaVuSans',10)
(replace 'DejaVuSans' with an installed font name you know has your characters in it).
This will incorporate that font in your PDF and make the resulting file about 20K bigger than without.
It is also possible to generate the PDF to memory, if that is necessary.

How to upgrade an MSXML Document from version 1 to verison 6?

My application uses MSXML version 1 (MSXML.DOMDocument) to store user documents in XML format.
I want to upgrade to MSXML6 (Msxml2.DOMDocument.6.0). The problem is that old documents are not always readable with the new version.
The cause of this is that the old MSXML parser does not correctly encodes non-Latin character as UTF-8, and the new parser refuses to load these document.
My question - how can I read / convert my customers' existing files to be readable in MSXML6?
It is really a good idea to fix those old xml files with correct encoding. In fact, a W3C conformant xml parser is expected to choke when handling this kind of xml files.
As far as I know, MSXML does not provide functionality to fix the encoding for old xml files.
To fix the encoding, you can do it manually with Notepad++ (choose the actual encoding, and then convert to utf-8), or convert programmatically if you are sure of the original encoding, e.g. ANSI in your case. There should be いろいろ sample codes over the internet.

Resources