Linux and newspaper layout (not for professionals)
Here you are, for example. You think that after death everything ends, right?
“That's right ...” a few voices responded in the hall. [...]
- And the current does not flow through the air. Right?
- Right…
- And without Windows or MacOS it is impossible to prepress the newspaper?
Wrong. With Linux, you can, of course, do not everything, but much more than you think.
About fifteen years ago, the advertising agency where I worked began to peck a fried rooster about unlicensed software. The chief figured out the possibilities and decided that he would be able to cut out the budget for the purchase of five Windows + Office licenses, one 1C 7.7 and a couple of Corel Draw. At the same time, 10 advertising managers had to work on 1C, and Windows was absolutely necessary for designers.
We had a good admin; He also figured out the possibilities, consulted with colleagues and thought: why specifically do sales managers need Windows?
Using the downgrade of a pair of dll files, he made a terminal server from one Windows XP, installed 1C there, and on all manager machines installed Ubuntu with the only shortcut on the desktop - “Connect to Server”. Further, the boss’s thought began to move toward "why do we need computers in the office, if managers can connect to the terminal server directly from home?", Big prospects ahead.
And we would have lived happily ever after, but we still had to somehow make up our advertising newspaper. In Korel, it was completely impossible to do. The boss categorically refused to buy Adobe products - and not just because of the prices: this corporation insisted on all advertising companies in our city in bulk (preventively insisted, according to the principle: if you do advertising, then the tool is stealing Photoshop!), And among others, it’s polite invited to the prosecutor's office to show our licenses. We showed licenses, but we were offended by Adobe and the prosecutor’s office assured us that we never had any business with the products of this corporation and are not going to have it.
You could, of course, buy QuarkXpress or start developing Scribus. But by this time we had already developed a certain data processing system, there was a certain level of automation. The convenient system for storing advertising layouts, the “correct” data structure describing the layouts led us to the following thought: why do we need a visual program for printing layout? Advertising layouts are simply rectangles; placing them in rows and columns on a newspaper page is bare mathematics. Why is there a man with a mouse in his hand?
Data
In 1C, managers created the “Advertising Layout” document, which, among other things, indicated: layout dimensions, page in the newspaper, and coordinates on the page. It is clear that many collisions could arise here. Which should have been resolved by the general manager.
The situation was complicated by the features of the final product - the newspaper: there should be a number of pages (pages), necessarily a multiple of four. And for some printing machines - a multiple of eight.
This means that the main manager must constantly monitor the amount of advertising and timely give feedback to customers. If, for example, the material for the next issue was typed into 33 pages, some of the advertising layouts would need to be thrown out of this issue - transferred to the next or reduced size, or something else to come up with, and all this should be coordinated with the client before the newspaper was delivered to the printing house ( and not put customers before the fact after release).
Visualization
In order to resolve a collision - an overlay of two layouts - the main manager should see this overlay. You will say that the coordinate overlay is easier and more reliable to detect programmatically. The way it is. But what can the program do with the detected problem? And a combined method arises: the program, upon detecting an overlay, “drops” the layout from the page and marks it in a special way, and the main manager already looks through all the “reset” layouts and decides what to do with them.
He does this already not in 1C, but on a web page where all the thumbnail layouts are located exactly like on the corresponding newspaper page (and the list of "reset" layouts is somewhere on the side). Therefore, in what follows, we will call the chief manager simply a “layout designer”.
In order for the mock-ups to be displayed on the web page, the layout designer unloads data from 1C before starting the layout and loads it into Mysql. And then it opens the localhost / verstka address in the browser . Or, let’s say, in the summer, when the typesetter constantly lives in the country, an address like #http: //nasha-gazeta.ru/verstka/.
On the layout web page, javascript using drag-end-drop technology allows the layout designer to move layout thumbnails with both the mouse and keyboard arrows. After any layout stop, ajax writes data about the new layout coordinates in Mysql. After the end of the current layout, the typesetter unloads new data from Mysql and loads it back into 1C. After that, managers working with clients can agree on a new state of layouts. And so several times in a circle until everyone is happy.
In the end, everything is agreed, all layouts are placed; we completely made up the newspaper "virtually." But what will we carry to the printing house?
Printing layout
Printing houses need a postscript or pdf file. If you have ever worked in advertising, you know how to create a pdf file for a printing house: in a program like InDesign or Corel Draw, you click on the File - Export menu, select the format you want and create a pdf (postscript) file. Or create the same file through the File - Print menu. But what does this print file have inside?
If in a visual printing program a person uses a mouse to place a number of layouts taken from the disk of his computer, then, when exporting or printing, the program will likewise place all these source files with the necessary coordinates in a common postscript file. That is, the final file is the files of separate layouts joined together, each of which has a couple of special commands in postscript that indicate the coordinates and some other details.
A postscript file is a plain text file with a set of data and instructions. Something like an html file, only the sizes are larger. You can open this file in a text editor, find the instructions there 150 250 moveto
, replace the number 250 with 300, and some element will shift by 50 when printing. However, the question remains: will it shift to 50 in what direction?
There are several not quite familiar rules in postscript: everything is measured in points - such arbitrary units that are less than millimeters 2.8346456692913 times; and the coordinate reference point is located in the lower left corner of the page (and not in the upper left, as you are used to).
That is, the command 150 250 moveto
entered on the “blank sheet” means that we have moved from the bottom left point of the page 53 mm to the right and 88 mm up.
The next difficulty arises from the size of the printing files: we cannot, of course, open and edit print files of 100 megabytes in a text editor — this would be very inconvenient. Fortunately, layouts can be assembled on one page together, without putting the entire contents of the file in the entire page text, but with the help of something like links - indicating file paths and a combination of file , run and flush commands :
%% Процедура вставки файла
/PasteFile { grestore gsave x1 y1 translate
{/f1 f10 (r) file def} stopped {} {f10 run} ifelse
f10 = flush } def
%% Пример применения процедуры вставки файла
/f10 (/home/verstka/shablon/fon_bw.eps) def
/x1 7.7 def /y1 49 def
PasteFile
Thus, we get an almost complete analogue of the html-file, which also usually contains links to images, and not the pictures themselves. Unfortunately, this small postscript layout text file cannot be sent to the printing house, as the layout files associated with it are stored separately and will not be accessible to them (and font files, by the way).
At the last stage, you need to connect everything together - embed the contents of each layout in the page. This can be done with the great Ghostscript program. If you use the ps2pdf method, you can immediately get the final pdf for typography from our small file; if the printing house requires ps files, you can use Ghostscript to create a “complete” postscript file using the ps2ps method.
Our printing program was just a small php script on a web server. She generated postscript text files with links to layout files using information from a database describing the coordinates and sizes of the layouts. Then she called the Ghostscript interpreter and created files that were completely ready for transfer to the printing house. If necessary, descent of bands was just as easily created: small text files of individual bands were connected to each other with the addition of instructions rotate
and translate
.
Implementation Features
The described layout program could seem to work under Windows as well. But the machine with the web server, where all this happened, by necessity should have been a file server : after all, all layout files are gathered together and stored, which must be accessed by a large number of people - both designers and managers - for example, to copy there ready-made layout received from the client, or vice versa, print the layout and send it for approval.
But Windows XP has one very unpleasant feature - the limit on the number of connections. At one time, this spoiled us a lot of blood. In one case (with a terminal server), our admin solved this problem by hacking Windows XP, in another (with a repository of advertising layouts) - by installing Linux. And in which case there was less risk for the enterprise?
The main conclusion that I made for myself is that a system administrator is absolutely necessary for a small enterprise. It may be coming, it may be outsourcing from some company, it doesn’t matter. The main thing is that he is not afraid of Linux. Then you will cease to be afraid of him. I've stopped. I just wrote the same layout program in php and javascript. Started on Windows. But since the admin under the transplanted me to Linux, on Windows, I hear more and do not want - so Linux proved useful to me in all respects.
The second conclusion is almost according to TRIZ: if you cannot solve the problem, divide it into parts and separate them in space and time. An advertising agency may well live without highly specialized Adobe software, indicating in the rules for working with clients: layouts are accepted in eps format. If you don’t have a ready-made layout, we will stamp it for you on our own in Korel. And for VIP clients, you can use the same outsourcing - entrust the production of layouts to third parties, cool designers.
The third conclusion: Linux in a modern small enterprise does not take root not due to objective reasons - not because it is too complicated or loses in some ways to Windows, but because the office people are mostly lazy and not curious. People just do not want to learn something new. And the shops helpfully slip into their familiar “Windows”.
Now in the company where I work, all the managers work with the client base and sales through the web - they do not depend on the operating system. A machine with 1C and a bank-client stands alone in a corner - purely for an accountant. But Linux only on two old client machines. Because when you buy a new computer, it already has Windows on it. At the same time, everything is buzzing on their OS, but in different ways: if those sitting on Linux can not really present anything but a vague concern that they are "not in the mainstream", then Windows 10 fans swear for a very specific reason: they can not print files on an adjacent HP 1100 printer. But still no one wants to transfer to Linux anyway.