![]() |
|
Модераторы: Poseidon, Snowy, bems, MetalFan |
![]()
|
|
| YuriL |
|
||||||
|
Unregistered |
Привет Всем,
прошу вашей помощи в прочтении файла spl Описание spl формата файла, которое мне удалось найти в сети прилагаю (не хочу переводить с английского во избежание искажений оригинального текста) Please note that this format is not officially documented and as such may change in future versions of the operating systems. Additionally there may be errors or ommissions which are due entirely to myself Overview The EMF spool file is a collection of special records which define the output to be printed in a set of graphics primitives which are broadly speaking an enhanced set of the EMF graphics records that windows developers are familiar with. These are wrapped in additional layer of records to describe the pages and printer settings information. The record types are:- Private Enum SpoolerRecordTypes SRT_EOF = &H0 ' // int32 zero SRT_RESERVED_1 = &H1 '* 1 */ SRT_FONTDATA = &H2 ' 2 Font Data */ SRT_DEVMODE = &H3 ' 3 DevMode */ SRT_FONT2 = &H4 '4 Font Data */ SRT_RESERVED_5 = &H5 ' 5 */ SRT_FONT_MM = &H6 ' 6 Font Data (Multiple Master) */ SRT_FONT_SUB1 = &H7 ' 7 Font Data (SubsetFont 1) */ SRT_FONT_SUB2 = &H8 ' 8 Font Data (SubsetFont 2) SRT_RESERVED_9 = &H9 SRT_UNKNOWN = &H10 ' // int unknown... SRT_RESERVED_A = &HA SRT_RESERVED_B = &HB SRT_PAGE = &HC ' 12 Enhanced Meta File (EMF) */ SRT_EOPAGE1 = &HD ' 13 EndOfPage */ SRT_EOPAGE2 = &HE ' 14 EndOfPage */ SRT_EXT_FONT = &HF ' 15 Ext Font Data */ SRT_EXT_FONT2 = &H10 ' 16 Ext Font Data */ SRT_EXT_FONT_MM = &H11 ' 17 Ext Font Data (Multiple Master) SRT_EXT_FONT_SUB1 = &H12 ' 18 Ext Font Data (SubsetFont 1) */ SRT_EXT_FONT_SUB2 = &H13 '* 19 Ext Font Data (SubsetFont 2) */ SRT_EXT_PAGE = &H14 ' 20 Enhanced Meta File? SRT_JOB_INFO = &H10000 ' // int length, wchar jobDescription End Enum And each record type is followed by a 32 bit unsigned integer which is the size (in bytes) of the record. This allows you to skip forward over any records that are not of use to you. The interesting records of this lot are: SRT_EOF - This record type indicates that you have reached the end of the spool file. This may not be the actual end as some extra font dat amay be stored after this and referenced in an SRT_FONT type record. SRT_DEVMODE - This record type has a DEVMODE structure following it. This holds the details such as the paper size, device name, printer resolution etc. that apply to the print job. It is possible to have more than one SRT_DEVMODE record in a spool file, for example if the print job has some pages in portrait and others in landscape. SRT_PAGE and SRT_EXT_PAGE - This record contains a standard EMF record that describes the graphical content of the printed page. This starts with a EMFMETAHEADER record followed by one or more standard EMF graphics records (EMFEXTTEXTOUTW, EMFELLIPSE etc.) Uses There are two uses for this information. The first is to provide the capability to view spoolfiles on screen before they print (you find each SRT_PAGE or SRT_EXTPAGE and convert it to a system.drawing.image) and the other is to parse the file to get the true page count. и более официальное описание SPL Spoolfile Format Terms of Use Copyright A© 2004 by Christoph Lindemann. All rights reserved. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". Comments If you have any comments or further information on the SHD or SPL file format, please feel free to contact me. [email protected] History: 24-03-2004A A Initial Document A A Christoph Lindemann, [email protected] 24-03-2004A A Release to public A A Christoph Lindemann, [email protected] 10-06-2004A Added SPL_SMR_PADDING A A Thanks to Fabian Franz 11-06-2004A CORRECTED FAULTY INFORMATIONS A A Christoph Lindemann, [email protected] 14-06-2004A Added some text explaining the format. A A Christoph Lindemann, [email protected] 19-05-2005A Corrected typos in SMREXT definition A A Thanks to Peter Wasser Introduction The windows SPL files can include RAW data or EMF. This document includes documentation for the EMF-SPL file format. RAW SPL In the case of RAW data, the content of the file is exactly the same as the data send to the printer. EMF SPL EMF stands for Enhanced Metafile. You can find information on standard EMF in the Windows Platform SDK. Basically the SPL files consist of one or more standardA EMF files, surrounded by some extra records. The EMF SPL files contain a special version of EMF , not compatible with standard EMF, although most of the records are the same. SPL_HEADER SMR_PAGE_EMF/WMF SMR_OFFS_FONT SMR_OFFS_FONT SMR_EO_PAGE SMR_PAGE_EMF/WMF SMR_DEVMODE SMR_OFFS_FONT SMR_OFFS_FONT SMR_OFFS_FONT SMR_EO_PAGE Header The SPL files always start with the SPL_HEADER, this record differs in the way, that the specified recordsize includes both header and data of the SPL header. Base record structure TheA records following the SPL_HEADER, always start with (include) the SMR base record. The nSize member specifies the size of the following data, including the size of the remaining header members and the data. nSize = (RECORDSIZE - sizeof(SMR)). So the SMR_EO_PAGE.nSize member would be = 8, as the complete record is 16 bytes (SMR + 8) Page Every page contained in the file consists of at least one SMR_PAGE_EMF andA one SMR_EO_PAGE record. The SMR_PAGE_EMF contains the EMF data for the page. Between these 2 records, every page can include some additional records like DEVMODE and font data for the page. EOF End of File SPL files can also include anA SMR_PAGE_EMFA record specifying a length of 0. This record indicates the end of file. The following data should not be considered valid. DataA Definition
теперь о EMF формате: The EMF streams include in the Windows SPL files include various undocumented records. Including the following: WINVER >= #0500 (Windows 2000) EMR_DRAWESCAPE 105 (#69) EMR_EXTESCAPE 106 (#6A) EMR_STARTDOC 107 (#6B) EMR_SMALLTEXTOUT 108 (#6C) EMR_FORCEUFIMAPPING 109 (#6D) EMR_NAMEDESCAPE 110 (#6E) A A EMR_TRANSPARENTDIB 117 (#75) A A EMR_SETLINKEDUFIS 119 (#77) EMR_SETTEXTJUSTIFICATION 120 (#78) уточнения The following information is provided as is, and I take no responsibility for the correctness.
The following information is provided as is, and I take no responsibility for the correctness. The EMR record type 108 can be 2 different records. EMR_SMALLTEXTOUT or EMR_SMALLTEXTOUTCLIP. Look at the flags in fOptions, to see what type is used. The fOptions field also specifies if the ANSI or UNICODE version is used. The interpretation of the reference point depends on the current text-alignment mode. An application can retrieve this mode by calling the GetTextAlign function; an application can alter this mode by calling the SetTextAlign function. By default, the current position is not used or updated by this function. However, an application can call the SetTextAlign function with the fMode parameter set to TA_UPDATECP to permit the system to use and update the current position each time the application calls TextOut for a specified device context. When this flag is set, the system ignores the nXStart and nYStart parameters on subsequent TextOut calls.
Как на Delphi вынуть EMF файл из SPL файла и открыть EMF например в BITMAP или сохранить его в BMP, расскажите хотя бы теоретически как это сделать ? Это сообщение отредактировал(а) Girder - 6.9.2005, 14:41 |
||||||
|
|||||||
![]()
|
| Правила форума "Delphi: Общие вопросы" | |
|
|
Запрещается! 1. Публиковать ссылки на вскрытые компоненты 2. Обсуждать взлом компонентов и делиться вскрытыми компонентами
Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Snowy, MetalFan, bems, Poseidon, Rrader. |
| 0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) | |
| 0 Пользователей: | |
| « Предыдущая тема | Delphi: Общие вопросы | Следующая тема » |
|
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |