CN109522284A - Files in batch conversion method and device - Google Patents
Files in batch conversion method and device Download PDFInfo
- Publication number
- CN109522284A CN109522284A CN201811420878.5A CN201811420878A CN109522284A CN 109522284 A CN109522284 A CN 109522284A CN 201811420878 A CN201811420878 A CN 201811420878A CN 109522284 A CN109522284 A CN 109522284A
- Authority
- CN
- China
- Prior art keywords
- file
- converted
- conversion
- files
- format
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1202—Dedicated interfaces to print systems specifically adapted to achieve a particular effect
- G06F3/1203—Improving or facilitating administration, e.g. print management
- G06F3/1206—Improving or facilitating administration, e.g. print management resulting in increased flexibility in input data format or job format or job type
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1237—Print job management
- G06F3/1253—Configuration of print job parameters, e.g. using UI at the client
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides a kind of files in batch conversion method and devices, are related to file switch technology field, and this method includes obtaining multiple files to be converted;Multiple file to be converted is placed in conversion catalogue by predetermined directory structure;Read the file type of each file to be converted in conversion catalogue;Corresponding transfer function is called to be converted each file to be converted to generate the file destination of object format according to preset conversion parameter according to file type;By predetermined directory structure output file destination.A kind of files in batch conversion method provided in an embodiment of the present invention and device may be implemented a variety of file format mass simultaneous and be converted to PDF format or DWF format, and the file after conversion is made to keep original file directory format, improve transfer efficiency.
Description
Technical field
The present invention relates to file switch technology fields, more particularly, to a kind of files in batch conversion method and device.
Background technique
With the arrival of information age, between different enterprises, user it is required carry out information a-c cycle increasingly
It is more, but the difference due to use habit and software is different between enterprise, different users, cause the type of file different,
To bring inconvenience in office.In view of needing the security requirement to file content in some scenarios, need file
Safer format, such as PDF format or DWF format are converted to, because both formats are on the editor to file content
It is limited, thus it is more safe, but existing conversion method needs to be carried out with different software for different format conversions
Conversion operates comparatively laborious;In addition, the demand now for Batch conversion all the more highlights, and in Batch conversion for
The a large amount of convert files generated are to arrange it is still necessary to very important person, and relatively time-consuming, efficiency is lower.
Summary of the invention
In view of this, may be implemented a variety of the purpose of the present invention is to provide a kind of files in batch conversion method and device
File format mass simultaneous is converted to PDF format or DWF format, and the file after conversion is made to keep original file directory lattice
Formula improves transfer efficiency.
In a first aspect, the embodiment of the invention provides a kind of files in batch conversion methods, comprising: obtain multiple texts to be converted
Part;Multiple file to be converted is placed in conversion catalogue by predetermined directory structure;It reads each to be converted in conversion catalogue
The file type of file;Call corresponding transfer function according to preset conversion parameter to each text to be converted according to file type
Part is converted to generate the file destination of object format;By predetermined directory structure output file destination.
With reference to first aspect, the embodiment of the invention provides the first possible embodiments of first aspect, wherein should
File type includes Office file, picture, cad file and alternative document.
The possible embodiment of with reference to first aspect the first, the embodiment of the invention provides second of first aspect
Possible embodiment, wherein above-mentioned that corresponding conversion is called according to file type when this document type is Office file
The step of function converts to generate the file destination of object format each file to be converted according to preset conversion parameter,
It include: the conversion parameter for obtaining file to be converted;Call the printf of VBA itself by conversion parameter convert file to be converted with
Generate the file destination of PDF format.
The possible embodiment of with reference to first aspect the first, the embodiment of the invention provides the third of first aspect
Possible embodiment, wherein above-mentioned to call corresponding transfer function to press according to file type when this document type is picture
The step of each file to be converted is converted to generate the file destination of object format according to preset conversion parameter, comprising:
Obtain the conversion parameter of file to be converted;The function in GDI+ shape library is called to convert file to be converted by conversion parameter to generate
The file destination of PDF format.
The possible embodiment of with reference to first aspect the first, the embodiment of the invention provides the 4th kind of first aspect
Possible embodiment, wherein above-mentioned that corresponding conversion is called according to this document type when this document type is cad file
The step of function converts to generate the file destination of object format each file to be converted according to preset conversion parameter,
It include: the conversion parameter for obtaining the file to be converted;The block reference in the file to be converted is searched according to the conversion parameter;By pre-
If whether rule judges the block referring to eligible;If so, call CAD printf will the reference of the qualified block according to
Conversion parameter generates the file destination of PDF format or DWF format.
The 4th kind of possible embodiment with reference to first aspect, the embodiment of the invention provides the 5th kind of first aspect
Possible embodiment, wherein above-mentioned preset rules include: that the block size of minimum bounding box and scale factor referring in are not less than
A4 size.
With reference to first aspect, first aspect the first, second, the third, the 4th kind, the 5th kind of possible embodiment party
One of formula, the embodiment of the invention provides the 6th kind of possible embodiments of first aspect, wherein presses predetermined directory above-mentioned
Before the step of structure output file destination, further includes: optimize processing to file destination;The optimization processing include: selection,
Rotation, merging, block are referring at least one of file renaming.
The possible embodiment of with reference to first aspect the first, the embodiment of the invention provides the 7th kind of first aspect
Possible embodiment, wherein when this document type is alternative document, delete the file to be converted.
With reference to first aspect the first, second, the third, one of the 4th kind, the 5th kind possible embodiment, this
Inventive embodiments provide the 8th kind of possible embodiment of first aspect, wherein the format of the Office file includes:
doc,docx,xls,xlsx,ppt,pptx;The format of the picture includes: bmp, jpg, gif, png, tif, tiff;CAD text
The format of part includes: dwg, dxf.
Second aspect, the embodiment of the invention also provides a kind of files in batch conversion equipment, which includes: text to be converted
Part obtains module, for obtaining multiple files to be converted;Catalogue placement module is converted, it is pre- for pressing multiple file to be converted
If bibliographic structure is placed in conversion catalogue;File type read module, for reading, each in the conversion catalogue this is to be converted
The file type of file;Conversion module, for calling corresponding transfer function according to preset conversion parameter according to file type
Each file to be converted is converted to generate the file destination of object format;Output module, for pressing predetermined directory structure
Export file destination.
The embodiment of the present invention bring it is following the utility model has the advantages that
A kind of files in batch conversion method provided in an embodiment of the present invention and device, this method include that acquisition is multiple to be converted
File;Multiple file to be converted is placed in conversion catalogue by predetermined directory structure;It reads each wait turn in conversion catalogue
The file type of exchange of notes part;Call corresponding transfer function according to preset conversion parameter to each to be converted according to file type
File is converted to generate the file destination of object format;By predetermined directory structure output file destination.The embodiment of the present invention
The files in batch conversion method of offer may be implemented a variety of file format mass simultaneous and be converted to PDF format or DWF format, and make
File after must converting keeps original file directory format, improves transfer efficiency.
Other feature and advantage of the disclosure will illustrate in the following description, alternatively, Partial Feature and advantage can be with
Deduce from specification or unambiguously determine, or by implement the disclosure above-mentioned technology it can be learnt that.
To enable the above objects, features, and advantages of the disclosure to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate
Appended attached drawing, is described in detail below.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art
Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below
Attached drawing is some embodiments of the present invention, for those of ordinary skill in the art, before not making the creative labor
It puts, is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow chart of files in batch conversion method provided in an embodiment of the present invention;
Fig. 2 is a kind of flow chart of the Batch conversion method of Office file provided in an embodiment of the present invention;
Fig. 3 is a kind of flow chart of the Batch conversion method of picture provided in an embodiment of the present invention;
Fig. 4 is a kind of flow chart of the Batch conversion method of cad file provided in an embodiment of the present invention;
Fig. 5 is a kind of overall flow schematic diagram of files in batch conversion method provided in an embodiment of the present invention;
Fig. 6 is a kind of structural schematic diagram of files in batch conversion equipment provided in an embodiment of the present invention.
Icon:
61- file acquisition module to be converted;62- converts catalogue placement module;63- file type read module;64- conversion
Module;65- output module.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention
Technical solution be clearly and completely described, it is clear that described embodiments are some of the embodiments of the present invention, rather than
Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise
Under every other embodiment obtained, shall fall within the protection scope of the present invention.
Currently, the demand to files in batch conversion is more more and more urgent, especially need to be converted to safer tray
Formula, but existing conversion method needs to be converted with different software for different format conversions, operates comparatively laborious;And
And existing Batch conversion technology a large amount of convert files for generating in conversion it is still necessary to very important person are to arrange, and lead to overall conversion
The efficiency of processing is lower.Based on this, the present invention implements a kind of files in batch conversion method provided and device, may be implemented a variety of
File format Batch conversion is PDF format or DWF format, and the file after conversion is made to keep original file directory format,
Improve transfer efficiency.
For convenient for understanding the present embodiment, first to a kind of files in batch conversion side disclosed in the embodiment of the present invention
Method describes in detail.
As shown in Figure 1, be a kind of flow chart of files in batch conversion method provided in an embodiment of the present invention, as seen from Figure 1,
This document Batch conversion method the following steps are included:
Step S102: multiple files to be converted are obtained.
The file of format transformation is wanted for preparation, can be one or two or it is multiple.In practical operation, can both lead to
It crosses dragging single file to be chosen, can also be chosen by way of file where select file.
Step S104: multiple file to be converted is placed in conversion catalogue by predetermined directory structure.
Here, it needs that file to be converted is put into conversion catalogue first, conversion catalogue is that have certain catalogue knot
Structure, it can be configured in advance according to the demand of user, for example, file can be totally placed in a folder content
Under, it is also possible to nested mode, further includes having file in file, contains the subdirectory of any number of plies, it is to be converted
File be placed in the conversion catalogue pre-set.
In a kind of wherein possible embodiment, the execution window which is dragged in software is converted.
Step S106: the file type of each file to be converted in conversion catalogue is read.
Before actually conversion, need to read the file type of each file to be converted.In the present embodiment, file type
Including four major class: Office file, picture, cad file and alternative document.Wherein, the convertible file format of Office file
Including totally six kinds of doc, docx, xls, xlsx, ppt, pptx, the convertible file format of picture include bmp, jpg, gif, png,
Totally six kinds of tif, tiff, the convertible file format of cad file includes two kinds of dwg, dxf.It is not belonging to above-mentioned 14 kinds of trays
The file of formula is all referred among alternative document.
Step S108: call corresponding transfer function according to preset conversion parameter to each to be converted according to file type
File is converted to generate the file destination of object format.
Here, the file of different file types is converted, different transfer functions can be called to be converted, also, root
According to the demand of user, conversion parameter is preset, which includes at least the target lattice for wishing the file destination generated
Formula.In the present embodiment, which is PDF format or DWF format.Wherein, PDF (Portable document format, Portable
Document Format) it is the file format developed in 1993 for exchange files by Adobe Systems, it
Advantage is to be the cross-platform energy original format of document retaining (Layout), open standard, and energy royalty-free (Royalty-free) is certainly
It is an open standard by the compatible software of exploitation PDF.In addition, DWF is a kind of opening developed by Autodesk, the text of safety
Part format, design data abundant can expeditiously be distributed transmission by it.DWF file high compression, therefore compare design document
Smaller, transmitting is got up more quickly, without the relevant overhead of general CAD diagram shape (or management external linkage and dependence).
In the present embodiment, when reading file type is Office file or picture, by corresponding file to be converted
Be converted to the file destination of PDF format;When the file type read is cad file, corresponding file to be converted is converted
For the file destination of PDF or DWF format;And work as the file type read and be not belonging to above-mentioned three types, and it is alternative document
When, then delete the file to be converted.
Specifically, the conversion process of various file types is described below:
When reading file type is Office file, referring to fig. 2, show for the process of Office files in batch conversion process
It is intended to, from Figure 2 it can be seen that obtaining the conversion parameter of file to be converted before this in the conversion operation the step of, and then recalling VBA
The printf of itself converts file to be converted by conversion parameter to generate the file destination of PDF format.
It is the flow diagram of picture Batch conversion process referring to Fig. 3 when reading file type is picture, it can by Fig. 3
See, when carrying out conversion operation to picture, needs first to obtain the conversion parameter of file to be converted, then recall GDI+ shape library
In function convert file to be converted by conversion parameter to generate the file destination of PDF format.
It is the process signal of the Batch conversion process of cad file referring to fig. 4 when reading file type is cad file
Figure is also required to obtain the conversion parameter of the file to be converted first when carrying out conversion operation to cad file;Secondly basis should
Conversion parameter searches the block reference in the file to be converted;Then, judge the block referring to whether eligible by preset rules;If
It is then to call CAD printf by the qualified block referring to the mesh for generating PDF format or DWF format according to conversion parameter
Mark file.
Here, in a kind of wherein possible embodiment, which includes block minimum bounding box referring in
Size and scale factor are not less than A4 size.
Step S110: predetermined directory structure output file destination is pressed.
After all being converted to all files to be converted, according to originally preset bibliographic structure, by the target text of generation
Part is with bibliographic structure preservation.Here, bibliographic structure identical with input file catalogue is finally exported as final output mesh
It records, the subdirectory structure form in output directory is identical with the subdirectory structure form in input directory, and file type
It has been converted into pdf or dwf.In this way, file is protected according to originally preset catalogue format after Batch conversion
It deposits, does not need to re-start lookup and arrangement, save the time, improve the efficiency of conversion, lookup subsequent for user needs
File provide convenience.
It, can also be to file destination before exporting file destination at least one or more of possible embodiment
Optimize processing, wherein the optimization processing includes: selection, rotation, merging, block referring at least one of file renaming.
It is optimized that is, can be the single optimization item of selection, is also possible to wherein any two or three of combination and optimizes.This
Kind optimization enriches the selection of user, improves usage experience.
In this way, file format Batch conversion method provided in this embodiment is realized to Office file, picture and CAD text
The Batch conversion of part, compared with same type switch technology, it under same catalogue not only convertible cad file (comprising dwg,
Dxf), the picture of the office component of also convertible miscellaneous editions and various formats.This characteristic is for project planner
It presses professional packaging file by project especially to facilitate, this makes designer that need not select the file for needing to convert, and then distinguishes again
It is converted with different software, finally again the file mergences after respective conversion to together, and only needs packing catalogue being dragged in conversion
Window can directly convert all qualified files completely.
A kind of files in batch conversion method provided in an embodiment of the present invention, this method include obtaining multiple files to be converted;
Multiple file to be converted is placed in conversion catalogue by predetermined directory structure;Read each file to be converted in conversion catalogue
File type;According to file type call corresponding transfer function according to preset conversion parameter to each file to be converted into
Row is converted to generate the file destination of object format;By predetermined directory structure output file destination;A variety of trays may be implemented
Formula mass simultaneous is converted to PDF format or DWF format, and the file after conversion is made to keep original file directory format, mentions
High transfer efficiency.
In order to make it easy to understand, being illustrated below to the Batch conversion operating process of a variety of file formats.Such as Fig. 5 institute
Show, is a kind of overall flow schematic diagram of files in batch conversion method provided in an embodiment of the present invention, in the present embodiment, the party
Method operates in the environment of CAD2010 version.
After system starting, prompt first Saves and Closes AutoCAD window, reresents and pdfFactory Pro is selected as
Default printer.
Registration table just is written in print from the definition machine antiquarian if it is first time operation program.
Judge whether the machine installs 7.0 Professional of Adobe Acrobat.
Judge current CAD version, the wtprint.arx file in software package is copied into AutoCAD2010 installation directory
Under, the acad.rx file under installation directory is modified, is allowed to comprising character-serial " wtprint.arx ".
Lookup process whether there is office component.
The DDE of the currently used version of office component in registration table is set for sky, to disconnect application program and file
Between association, make individually establish any number of office component applications between the calling program runtime, rather than shared
The application program opened in system.It can realize that this program is separated with the other office files of user in this way, that is to say, that
During this program is run, user can open other office files, in the office file and this program that these users open
The office file automatically opened is not interfere with each other.Realize the purpose of " Bian Yunhang, side work ".
Then CAD application program is initialized, mainly setting foreground prints.
PdfFactory Pro.pc3 in software package is copied in the printer config directory in AutoCAD2010.
" monitoring dialog box ", " progress bar dialog box " application program in runs software packet.
Confirm that pdf document generates the whether current still system specified directory of catalogue.
The machine " my document " path is obtained, and then obtains pdfFactory Pro and automatically saves path.PDF is deleted to generate
All Files in catalogue.
The main dialog box of Batch conversion is popped up, setting is clicked, dialog box is arranged in pop-up, wherein the settable drawing of CAD tabs
Size, input-output file type and merging mode;Office and picture tabs are all made of default setting;The choosing of type style table
Item blocks settable CAD line style, color, line width etc., and point recovery button can be restored to initial setting up state;Overall situation setting may be selected to want
The file type of conversion.The above option can be arranged on demand.Point confirming button generates setting text.
The file to be converted of dragging clips in the text box in main dialog box, and point starts switching button and starts conversion program.
PDF target directory is generated, and empties file therein.Progress bar variable text file is created, it will be in text box
This document is written in catalogue text.
Bulk print is executed to the catalogue text in text box.Here, include: about the process of bulk print
(1) setting information is obtained by temporary file, inquiry registration table finds the office component highest version of the machine installation
This executable file path runs the corresponding office application program in each path.Printing is completed the corresponding office of backed off after random and is answered
With.
(2) total number of files in printing catalogue is obtained, according to each file in this data iteration catalogue, ignores and hides text
Part, the dynamic creation current directory in target directory execute printf according to different file types.Last recurrence executes printing
All Files folder in catalogue.
Here, including six printing submodules, respectively word module, excel module, ppt module, picture module, CAD
In dwg module and CAD in dxf module.The work of modules is described below:
<1>word module
Support doc, docx.It deletes pdfFactory Pro and prints the All Files automatically saved under path.Open this article
Part, change letter paper mold are A4, mimeograph documents.Judge that the file automatically saved under path whether there is, and timing is (a bit of
Time interval) loop to determine whether file size changes.File destination name is obtained, the file automatically saved under path is moved to
In target directory.And file existence and size are looped to determine to ensure that file movement finishes.Finally close word document.
<2>excel module
Support xls, xlsx.It deletes pdfFactory Pro and prints the All Files automatically saved under path.Open this article
Part, unlocks VBE environment, and determined type is printed in different ways.Change automatically saves all pdf generated under path
Filename keeps last digit equal.It is merged if generating multiple files.Judgement automatically saves the text under path
Part whether there is, and timing (a bit of time interval) loops to determine whether file size changes.File destination name is obtained, it will be certainly
File under dynamic storing path is moved in target directory.And file existence and size are looped to determine to ensure that file has moved
Finish.Finally close excel file.
<3>ppt module
Support ppt, pptx.It deletes pdfFactory Pro and prints the All Files automatically saved under path.Open this article
Part, mimeograph documents.Judge that the file automatically saved under path whether there is, and timing (a bit of time interval) loops to determine text
Whether part size changes.File destination name is obtained, the file automatically saved under path is moved in target directory.And it recycles and sentences
Disconnected file existence and size finish to ensure that file is mobile.Finally close ppt file.
<4>picture module
Support bmp, jpg, png, gif, tif, tiff.It deletes pdfFactory Pro and prints the institute automatically saved under path
There is file.1 system file and customized 2 library files by 2 system files of pdflib and mfc is needed to copy to
Under operating system catalogue, call custom function that picture is converted into pdf.Judge whether the file automatically saved under path is deposited
, and timing (a bit of time interval) loops to determine whether file size changes.File destination name is obtained, road will be automatically saved
File under diameter is moved in target directory.And file existence and size are looped to determine to ensure that file movement finishes.
<5>the dwg module in CAD
Support dwg.It deletes pdfFactory Pro and prints the All Files automatically saved under path.Dwg file is replicated
To under temp directory.Temporary file is created under temp directory, and dwg filename is written.Print from the definition order is sent to CAD.It beats
After the completion of print, temporary file is deleted.The pdf page generated by the rotation of longitudinal tab file.The pdf page generated is renamed, is made
Last digit is equal.If the pdf that dwg is generated needs to merge, a pdf file is combined them into.It will protect automatically
The file deposited under path is moved in target directory, and loops to determine file existence and size to ensure that file movement finishes.
If the pdf that dwg is generated does not need to merge, ordered again according to the figure number of each drawing is recorded in system as filename
The pdf file that name generates.The catalogue named with the dwg filename is created again, the All Files automatically saved under path
It clips in the catalogue.
<6>the dxf module in CAD
Support dxf.It deletes pdfFactory Pro and prints the All Files automatically saved under path.Use custom function
Dxf is saved File As dwg file.Latter acts and the operation in<5>are just the same.
After the completion of bulk print, prompt is provided, closes monitoring dialog box, progress bar window.It is current to restore office component
Using the DDE value of version, PDF target directory window is automatically opened.
Unload main dialog box and other windows.
Delete the temporary file in program operation process.
The Batch conversion of cad file in order to facilitate understanding, is illustrated again below.
The first, CAD block is referring to the preparation before conversion.Including following sub-step:
1, into registration table in pdfFactory5 CustomPapers registry entry be written specified map sheet ID, it is wide high and
Unit.This determines the drawing type and size after CAD printing.
2, CAD printing environment is initialized, sets foreground printing for background print option.
This realizes that printing synchronizes.
If 3, input file type is dxf, dwg file of the same name is directly saved as.
The second, conversion CAD block reference is executed.Including following sub-step:
1, program pin retrieves each file being dragged in file, when detecting dwg or dxf file type, first
Transformation Parameters are saved in file, then execute conversion (dxf need to save as dwg).
2, after reading Parameter File acquisition Transformation Parameters, graphic data base is read from backstage and generates graphic file.
3, graphic file All Layers are unlocked, locking layer is unlocked by traversal layer table record.
4, layout is found by traversal block table record, then the entity traversed in layout finds block reference, saves this block reference
Scale factor, recurrence blows block reference, until getting block each entity minimum bounding box referring in, finally obtains entire block
Reference minimum bounding box (herein why without using entity itself provide system function obtain minimum bounding box, be because
If to be obtained with system function, it would be possible to be unable to get correct minimum bounding box data, this point is by repeatedly practising inspection
It has been confirmed that).
5, whether met according to the relationship decision block reference whether minimum bounding box size and scale factor are greater than A4 size
Condition.If eligible, block is switched to current arrangements referring to place layout.Obtain it is all except the model space and current arrangements with
Outer all layout titles delete all useless layouts.Judge object space for model or drawing according to return parameters.If mesh
Mark space is paper space, traverses target paper space, obtains minimum area viewport, closes the viewport.
6, layer table is traversed, preservation is all to be turned off figure layer.
7, all entities being turned off in figure layer are obtained, they are wiped.
8, loop cleaning block defines, and all useless piece of definition is removed, until all useless piece of definition are fully erased.
9, traverse object space, search block reference, save object space block referring to ID, obtain all pieces referring to it is corresponding not
Repeatable block definition.
10, all not repeatable block definition are traversed, the block definition for wherein allowing to blow is searched, obtains wherein all pieces of references
ID is compared with correct block referring to the ID in set, if it is present this block can be used referring to ID.Save all pieces of references than
The example factor, recurrence blow block reference, all entities for including referring in until obtaining this block, find out the minimum of all entities and surround
Box finally finds out the minimum bounding box of block reference.Save the minimum bounding box data of all pieces of references.
11, all pieces of references are screened referring to minimum bounding box data acquisition system according to block, qualified piece is joined
According to electing, ineligible is filtered out.Finally according to from left to right, sequence from top to bottom is ranked up.Screening conditions:
It is not nested.By the block filtered out referring to progress x ascending order bubble sort.Result after sequence is returned.
12, it returns the result and then creates empty block file for sky, otherwise delete the Container elements for being less than A4 size.
13, the color of solid color figure layer where being changed to " with layer ".By traversal object space can blow
All pieces are blown referring to recurrence, decision block referring to comprising entity in whether there is attribute definition, if having block referring to retain, if
Block reference is not wiped then, and all entities of this additional block referring in are into object space.Object space is finally traversed, institute
Have solid color with the solid color of layer be changed to figure layer color.
14, whether merged by the interim setting Fileview file that VB interface creates, if dwf is generated, if do not conformed to
And CAD block is generated referring to filename file.By in each block referring to the text entity found within the scope of minimum bounding box
Or multline text entity, whether most on the lower judge its position, and meet coding rule (in addition to automatic control, can only comprising letter,
It crosses in digital, middle scribing line, at least two).If find qualified entity, content of text is saved as using later
Filename.If not finding qualified entity, current time is saved as filename.
15, invisible attribute definition is wiped.Object space is traversed, attribute definition entity is searched and is wiped if invisible
It removes.
16, window printing is carried out to block reference referring to minimum bounding box data acquisition system according to block.
CAD application object is obtained using ActiveX interface, according to whether generating dwf obtains printer configuration path.
Setting object space is current arrangements, obtains current arrangements, obtains printer setup object, setting printing config option (printing
Machine title, print area, printing origin, printing type, printing placed in the middle, whether in proportion printing, type style table, printed drawings
Width, printing unit).According to block referring to length and width size setting printing rotation mode.Traversal marker file is created, by printed drawings block number
File is written.If transverse direction, file is written into drawing serial number.If longitudinal direction, do nothing.
Setting printing map sheet.Practical drawing size is obtained referring to current length and width and scale factor according to block.Further according to reality
The customized map sheet mode of interim setting file user of the ratio and VB interface of size and A4 size creation, returns to customized drawing
Size dimension.If output is dwf file, automatically generates not duplicate file name and print, if output is pdf file, directly
Print to equipment.
Third, CAD block are referring to the processing after conversion.
Wherein, following processing is done for the file that output type is pdf:
1, the pdf page is rotated by traversal marker file.(being developed using Acrobat DC SDK)
2, it is renamed for the pdf file of output, keeps digital number therein consistent.
It is that a file (uses Acrobat DC by the pdf file mergences after renaming if 3, pdf finally merges
SDK exploitation), if nonjoinder, each pdf file is renamed referring to file by the block generated.
4, finally by all pdf paper cuts into destination folder.
Also, following processing is done for the file that output type is dwf:
1, it is renamed for the dwf file of output, keeps digital number therein consistent.
2, each dwf file is renamed referring to file by the block of generation.
3, finally by all dwf paper cuts into destination folder.
Files in batch conversion method provided in an embodiment of the present invention can be obtained according to user demand flexible choice conversion options
Obtain different conversion effect and file type.Such as: CAD diagram width size, CAD line width, CAD color, CAD output file type,
Whether CAD generates file and merge etc. can customize completely, can meet the needs of most project planners.In addition, automatic
Show when conversion progress, real-time display current process arrange operation to provide reference for project planner.
The embodiment of the invention also provides a kind of files in batch conversion equipments to show referring to Fig. 6 for the structure of the conversion equipment
It is intended to, as seen from Figure 6, which includes sequentially connected file acquisition module 61 to be converted, conversion catalogue placement module 62, text
Part type read module 63, conversion module 64 and output module 65.Wherein, the function of modules is as follows:
File acquisition module 61 to be converted, for obtaining multiple files to be converted;
Catalogue placement module 62 is converted, for multiple file to be converted to be placed in conversion catalogue by predetermined directory structure
In;
File type read module 63, for reading the file type of each file to be converted in the conversion catalogue;
Conversion module 64, for calling corresponding transfer function according to preset conversion parameter to each according to file type
File to be converted is converted to generate the file destination of object format;
Output module 65, for pressing predetermined directory structure output file destination.
The technical effect of files in batch conversion equipment provided by the embodiment of the present invention, realization principle and generation and aforementioned
Files in batch conversion method embodiment is identical, and to briefly describe, Installation practice part does not refer to place, can refer to preceding method
Corresponding contents in embodiment.
Unless specifically stated otherwise, the opposite step of the component and step that otherwise illustrate in these embodiments, digital table
It is not limit the scope of the invention up to formula and numerical value.
The flow chart and block diagram in the drawings show the system of multiple embodiments according to the present invention, method and computer journeys
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, section or code of table, a part of the module, section or code include one or more use
The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box
The function of note can also occur in a different order than that indicated in the drawings.For example, two continuous boxes can actually base
Originally it is performed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.It is also noted that
It is the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart, can uses and execute rule
The dedicated hardware based system of fixed function or movement is realized, or can use the group of specialized hardware and computer instruction
It closes to realize.
In addition, in the description of the embodiment of the present invention unless specifically defined or limited otherwise, term " installation ", " phase
Even ", " connection " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection, or be integrally connected;It can
To be mechanical connection, it is also possible to be electrically connected;It can be directly connected, can also can be indirectly connected through an intermediary
Connection inside two elements.For the ordinary skill in the art, above-mentioned term can be understood at this with concrete condition
Concrete meaning in invention.
In the description of the present invention, it should be noted that term " center ", "upper", "lower", "left", "right", "vertical",
The orientation or positional relationship of the instructions such as "horizontal", "inner", "outside" be based on the orientation or positional relationship shown in the drawings, merely to
Convenient for description the present invention and simplify description, rather than the device or element of indication or suggestion meaning must have a particular orientation,
It is constructed and operated in a specific orientation, therefore is not considered as limiting the invention.In addition, term " first ", " second ",
" third " is used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance.
Finally, it should be noted that embodiment described above, only a specific embodiment of the invention, to illustrate the present invention
Technical solution, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair
It is bright to be described in detail, those skilled in the art should understand that: anyone skilled in the art
In the technical scope disclosed by the present invention, it can still modify to technical solution documented by previous embodiment or can be light
It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make
The essence of corresponding technical solution is detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover in protection of the invention
Within the scope of.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.
Claims (10)
1. a kind of files in batch conversion method characterized by comprising
Obtain multiple files to be converted;
The multiple file to be converted is placed in conversion catalogue by predetermined directory structure;
Read the file type of each file to be converted in the conversion catalogue;
Call corresponding transfer function according to preset conversion parameter to each file to be converted according to the file type
It is converted to generate the file destination of object format;
By file destination described in the predetermined directory structure output.
2. files in batch conversion method according to claim 1, which is characterized in that the file type includes Office text
Part, picture, cad file and alternative document.
3. files in batch conversion method according to claim 2, which is characterized in that when the file type is Office text
It is described to call corresponding transfer function according to preset conversion parameter to each described to be converted according to the file type when part
File is converted the step of to generate the file destination of object format, comprising:
Obtain the conversion parameter of the file to be converted;
The printf of VBA itself is called to convert the file to be converted by the conversion parameter to generate the target of PDF format
File.
4. files in batch conversion method according to claim 2, which is characterized in that when the file type is picture,
It is described to call corresponding transfer function according to preset conversion parameter to each file to be converted according to the file type
The step of being converted to generate the file destination of object format, comprising:
Obtain the conversion parameter of the file to be converted;
The function in GDI+ shape library is called to convert the file to be converted by the conversion parameter to generate the target of PDF format
File.
5. files in batch conversion method according to claim 2, which is characterized in that when the file type is cad file
When, it is described to call corresponding transfer function according to preset conversion parameter to each text to be converted according to the file type
Part is converted the step of to generate the file destination of object format, comprising:
Obtain the conversion parameter of the file to be converted;
The block reference in the file to be converted is searched according to the conversion parameter;
Judge whether described piece of reference be eligible by preset rules;
If so, call CAD printf will qualified described piece of reference according to the conversion parameter generation PDF format or
The file destination of DWF format.
6. files in batch conversion method according to claim 5, which is characterized in that the preset rules include: described piece
The size of minimum bounding box and scale factor are not less than A4 size referring in.
7. files in batch conversion method according to claim 1-6, which is characterized in that described by described default
Bibliographic structure exported before the step of file destination, further includes:
Processing is optimized to the file destination;The optimization processing includes: that selection, rotation, merging, block are ordered again referring to file
At least one of name.
8. files in batch conversion method according to claim 2, which is characterized in that when the file type is alternative document
When, delete the file to be converted.
9. according to the described in any item files in batch conversion methods of claim 2-6, which is characterized in that
The format of the Office file includes: doc, docx, xls, xlsx, ppt, pptx;
The format of the picture includes: bmp, jpg, gif, png, tif, tiff;
The format of the cad file includes: dwg, dxf.
10. a kind of files in batch conversion equipment characterized by comprising
File acquisition module to be converted, for obtaining multiple files to be converted;
Catalogue placement module is converted, for the multiple file to be converted to be placed in conversion catalogue by predetermined directory structure;
File type read module, for reading the file type of each file to be converted in the conversion catalogue;
Conversion module, for calling corresponding transfer function according to preset conversion parameter to each institute according to the file type
File to be converted is stated to be converted to generate the file destination of object format;
Output module, for by file destination described in the predetermined directory structure output.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811420878.5A CN109522284A (en) | 2018-11-26 | 2018-11-26 | Files in batch conversion method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811420878.5A CN109522284A (en) | 2018-11-26 | 2018-11-26 | Files in batch conversion method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109522284A true CN109522284A (en) | 2019-03-26 |
Family
ID=65779197
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811420878.5A Pending CN109522284A (en) | 2018-11-26 | 2018-11-26 | Files in batch conversion method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109522284A (en) |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111104531A (en) * | 2019-12-13 | 2020-05-05 | 浪潮(北京)电子信息产业有限公司 | Method, device, equipment and medium for converting input format of detection data |
CN111210875A (en) * | 2020-01-13 | 2020-05-29 | 北京奇云诺德信息科技有限公司 | Biological information variation site data format conversion method |
CN111897778A (en) * | 2020-07-13 | 2020-11-06 | 苏宁金融科技(南京)有限公司 | Computer file merging method, device and system |
CN112269761A (en) * | 2020-11-18 | 2021-01-26 | 首都经济贸易大学 | File format conversion method, device, medium and equipment based on symbolic link |
CN112306424A (en) * | 2019-07-31 | 2021-02-02 | 中铁第五勘察设计院集团有限公司 | Method for printing Web graphic format file |
CN112559470A (en) * | 2020-12-04 | 2021-03-26 | 北京车和家信息技术有限公司 | File format conversion method and device, storage medium and electronic equipment |
CN112689197A (en) * | 2019-10-18 | 2021-04-20 | 腾讯科技(深圳)有限公司 | File format conversion method and device and computer storage medium |
CN113704214A (en) * | 2021-08-27 | 2021-11-26 | 北京市律典通科技有限公司 | Electronic file type conversion method and device and computer equipment |
CN114239098A (en) * | 2021-12-17 | 2022-03-25 | 北京数码大方科技股份有限公司 | CAD drawing processing method and device, storage medium and processor |
CN114741082A (en) * | 2022-04-21 | 2022-07-12 | 光大科技有限公司 | Yaml file conversion method and device |
CN115392160A (en) * | 2022-06-10 | 2022-11-25 | 无锡芯光互连技术研究院有限公司 | Format conversion method of circuit diagram description file |
CN116894000A (en) * | 2023-05-29 | 2023-10-17 | 中国船舶集团有限公司第七〇七研究所 | Information conversion method, device, electronic equipment and storage medium |
CN117499504A (en) * | 2023-12-29 | 2024-02-02 | 万联易达物流科技有限公司 | Message format conversion method and system |
WO2024077565A1 (en) * | 2022-10-13 | 2024-04-18 | 深圳传音控股股份有限公司 | Desktop file opening method, intelligent terminal and storage medium |
CN118210762A (en) * | 2024-02-20 | 2024-06-18 | 广州美术学院 | Animation data conduction method, device, storage medium and computer equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102609400A (en) * | 2011-01-19 | 2012-07-25 | 上海中信信息发展股份有限公司 | Method for converting file formats and conversion tool |
CN104200330A (en) * | 2014-09-11 | 2014-12-10 | 广西桂能软件有限公司 | Management method of digital archives in power industry |
CN104217396A (en) * | 2014-09-11 | 2014-12-17 | 广西桂能软件有限公司 | DWG (drawing) file format conversion method |
CN106775505A (en) * | 2015-11-19 | 2017-05-31 | 上海李威数码科技有限公司 | A kind of method for printing courier and its treatment file |
-
2018
- 2018-11-26 CN CN201811420878.5A patent/CN109522284A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102609400A (en) * | 2011-01-19 | 2012-07-25 | 上海中信信息发展股份有限公司 | Method for converting file formats and conversion tool |
CN104200330A (en) * | 2014-09-11 | 2014-12-10 | 广西桂能软件有限公司 | Management method of digital archives in power industry |
CN104217396A (en) * | 2014-09-11 | 2014-12-17 | 广西桂能软件有限公司 | DWG (drawing) file format conversion method |
CN106775505A (en) * | 2015-11-19 | 2017-05-31 | 上海李威数码科技有限公司 | A kind of method for printing courier and its treatment file |
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112306424A (en) * | 2019-07-31 | 2021-02-02 | 中铁第五勘察设计院集团有限公司 | Method for printing Web graphic format file |
CN112689197A (en) * | 2019-10-18 | 2021-04-20 | 腾讯科技(深圳)有限公司 | File format conversion method and device and computer storage medium |
CN111104531A (en) * | 2019-12-13 | 2020-05-05 | 浪潮(北京)电子信息产业有限公司 | Method, device, equipment and medium for converting input format of detection data |
CN111210875A (en) * | 2020-01-13 | 2020-05-29 | 北京奇云诺德信息科技有限公司 | Biological information variation site data format conversion method |
CN111897778B (en) * | 2020-07-13 | 2023-10-13 | 苏宁金融科技(南京)有限公司 | Computer file merging method, device and system |
CN111897778A (en) * | 2020-07-13 | 2020-11-06 | 苏宁金融科技(南京)有限公司 | Computer file merging method, device and system |
CN112269761A (en) * | 2020-11-18 | 2021-01-26 | 首都经济贸易大学 | File format conversion method, device, medium and equipment based on symbolic link |
CN112559470A (en) * | 2020-12-04 | 2021-03-26 | 北京车和家信息技术有限公司 | File format conversion method and device, storage medium and electronic equipment |
CN113704214A (en) * | 2021-08-27 | 2021-11-26 | 北京市律典通科技有限公司 | Electronic file type conversion method and device and computer equipment |
CN114239098A (en) * | 2021-12-17 | 2022-03-25 | 北京数码大方科技股份有限公司 | CAD drawing processing method and device, storage medium and processor |
CN114741082A (en) * | 2022-04-21 | 2022-07-12 | 光大科技有限公司 | Yaml file conversion method and device |
CN115392160A (en) * | 2022-06-10 | 2022-11-25 | 无锡芯光互连技术研究院有限公司 | Format conversion method of circuit diagram description file |
CN115392160B (en) * | 2022-06-10 | 2024-04-09 | 无锡芯光互连技术研究院有限公司 | Format conversion method for circuit diagram description file |
WO2024077565A1 (en) * | 2022-10-13 | 2024-04-18 | 深圳传音控股股份有限公司 | Desktop file opening method, intelligent terminal and storage medium |
CN116894000A (en) * | 2023-05-29 | 2023-10-17 | 中国船舶集团有限公司第七〇七研究所 | Information conversion method, device, electronic equipment and storage medium |
CN116894000B (en) * | 2023-05-29 | 2023-12-08 | 中国船舶集团有限公司第七〇七研究所 | Information conversion method, device, electronic equipment and storage medium |
CN117499504A (en) * | 2023-12-29 | 2024-02-02 | 万联易达物流科技有限公司 | Message format conversion method and system |
CN117499504B (en) * | 2023-12-29 | 2024-03-22 | 万联易达物流科技有限公司 | Message format conversion method and system |
CN118210762A (en) * | 2024-02-20 | 2024-06-18 | 广州美术学院 | Animation data conduction method, device, storage medium and computer equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109522284A (en) | Files in batch conversion method and device | |
CN106873922B (en) | Batch sequential printing method and device for CAD drawings | |
CN1834903B (en) | Method and system for fitting text to shapes within a graphic | |
US7614000B2 (en) | File formats, methods, and computer program products for representing presentations | |
JP4706789B2 (en) | Image storage device and program | |
CN1945574B (en) | Processor for creating document binders in a document management system | |
CN103793145A (en) | Drawing frame parameter identification and drawing output method based on autoCAD | |
CN101901118B (en) | Information processing apparatus and control method | |
US20190129582A1 (en) | Information processing device and recording medium | |
CN105989013A (en) | Method and device for removing character watermarks | |
CN102968285B (en) | The system of printing is triggered by movable storage device | |
CN102024077B (en) | Engineering drawing processing method | |
JP5653199B2 (en) | Information processing apparatus and program | |
WO2007037443A1 (en) | Information processing device, and file managing method | |
CN110309102A (en) | A kind of batch documents generation method and system | |
JP2016051421A (en) | Information management device and file management method | |
JP2014086053A (en) | Information management device and information management program | |
CN101276261A (en) | Printer | |
KR20090037704A (en) | Meta data generation method for intutive image search | |
JP2006107375A (en) | System and method for document management, program, and storage medium | |
JP2002229976A (en) | Apparatus and method for information processing, computer-readable memory, and program | |
JPH0736768A (en) | Electronic filing device | |
JP5388881B2 (en) | Form input / output device | |
JPH08137887A (en) | Information storage and retrieval device | |
JP2011022852A (en) | Form editing apparatus, form editing method, and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190326 |
|
RJ01 | Rejection of invention patent application after publication |