CN108399156A - The composition method and device of formula in a kind of pdf document - Google Patents

The composition method and device of formula in a kind of pdf document Download PDF

Info

Publication number
CN108399156A
CN108399156A CN201810168769.2A CN201810168769A CN108399156A CN 108399156 A CN108399156 A CN 108399156A CN 201810168769 A CN201810168769 A CN 201810168769A CN 108399156 A CN108399156 A CN 108399156A
Authority
CN
China
Prior art keywords
formula
pdf
latex
drafting
information
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.)
Granted
Application number
CN201810168769.2A
Other languages
Chinese (zh)
Other versions
CN108399156B (en
Inventor
周祖胜
王盛华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Renhe Huizhi Information Technology Co Ltd
Original Assignee
Beijing Renhe Huizhi Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Renhe Huizhi Information Technology Co Ltd filed Critical Beijing Renhe Huizhi Information Technology Co Ltd
Priority to CN201810168769.2A priority Critical patent/CN108399156B/en
Publication of CN108399156A publication Critical patent/CN108399156A/en
Application granted granted Critical
Publication of CN108399156B publication Critical patent/CN108399156B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/189Automatic justification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present invention provides the composition methods and device of formula in a kind of pdf document, wherein this method includes:Obtain the Latex format formula that XML file includes;Jlatex function libraries are called to determine the size of Latex format formula;Create PDF vectograms identical with the size of Latex format formula;Call Jlatex function libraries that will be plotted on the PDF vectograms of establishment corresponding to the drafting information of Latex format formula;The PDF vectograms of drafting are inserted at location information corresponding with Latex format formula by the location information based on Latex format formula in pdf document, to obtain the pdf document after typesetting.The present invention realizes the direct establishment of PDF vectograms by the calling of Jlatex function libraries, and easy to operate, further such that the typesetting efficiency of pdf document is higher, and there is no the picture distortion phenomenon under amplifieroperation, the using experience degree of user is preferable.

Description

The composition method and device of formula in a kind of pdf document
Technical field
The present invention relates to typesetting system fields, in particular to the composition method and dress of formula in a kind of pdf document It sets.
Background technology
LATEX is a kind of composing system based on TEX, using this format, even if user does not have typesetting and programming Knowledge the power provided by TEX can also be provided.Especially for the complicated table of generation and mathematical formulae, table Now it is especially prominent.Therefore, in generating pdf document according to XML file typesetting, for formula part, usually in XML file Retain the XML tag of a representation formula, content is then LATEX formats.Wherein, LATEX contents are that user is compiled using text Collect device direct editing.
When generating pdf document according to XML file typesetting in the related technology, all LATEX are extracted from XML file first Then the formula content of format calls LATEX interfaces that all formula contents are generated formula PDF, finally by each formula PDF points It is not inserted into the corresponding position of entire pdf document.
However, PDF composition methods in the related technology are required to carry for the corresponding formula content of each LATEX format It takes, parse and exported with formula, it is complicated for operation, and when the corresponding formula content of LATEX formats is more, considerably increases resource and account for Dosage leads to the less efficient of typesetting.
Invention content
In view of this, the purpose of the present invention is to provide the composition method and device of formula in a kind of pdf document, to improve The efficiency of typesetting.
In a first aspect, the present invention provides a kind of composition methods of formula in pdf document, including:
Obtain the Latex format formula that XML file includes;
Jlatex function libraries are called to determine the size of the Latex formats formula;
Create PDF vectograms identical with the size of Latex formats formula;
Call the Jlatex function libraries that will be plotted in the institute of establishment corresponding to the drafting information of the Latex formats formula It states on PDF vectograms;
The PDF vectograms of drafting are inserted by the location information based on the Latex formats formula in pdf document At to location information corresponding with the Latex formats formula, to obtain the pdf document after typesetting.
With reference to first aspect, the present invention provides the first possible embodiments of first aspect, wherein the calling Jlatex function libraries determine the size of the Latex formats formula, including:
The size of the Latex formats formula is determined according to the formula analysis function in the Jlatex function libraries.
With reference to first aspect, the present invention provides second of possible embodiments of first aspect, wherein the calling The Jlatex function libraries will be plotted in the PDF vectograms of establishment corresponding to the drafting information of the Latex formats formula On, including:
A JAVA object for including PDF vectograms is generated, the JAVA object is used to simulate the Graphics2D classes of JAVA;
The drafting formula interface for calling the JLatex function libraries, transmits the JAVA object;
The drafting information for receiving the Latex formats formula calls the drawing image function in the Graphics2D classes, The drafting information is converted into PDF and draws instruction, to be plotted on the PDF vectograms.
Second of possible embodiment with reference to first aspect, the third the present invention provides first aspect are possible Embodiment, wherein the drafting information includes content information and the location information corresponding to content information, the content letter Breath includes:Text message, font information and symbolic information.
The third possible embodiment with reference to first aspect, the 4th kind the present invention provides first aspect are possible Embodiment, wherein it is described that the drafting information is converted into PDF drafting instructions, including:
The font information is converted into the font information of PDF format;
The font information of the text message and the PDF format is converted into PDF and draws instruction.
With reference to first aspect, the present invention provides the 5th kind of possible embodiments of first aspect, wherein is incited somebody to action described Before the PDF vectograms drawn are inserted at location information corresponding with the Latex formats formula, further include:
Formula label is drawn in the PDF vectograms of drafting.
Second aspect, the present invention also provides a kind of composing devices of formula in pdf document, including:
Formula acquisition module, the Latex format formula for including for obtaining XML file;
Size determining module, for calling Jlatex function libraries to determine the size of the Latex formats formula;
Vectogram creation module, for creating PDF vectograms identical with the size of Latex formats formula;
Vectogram drafting module, for calling the Jlatex function libraries by painting corresponding to the Latex formats formula Information processed is plotted on the PDF vectograms of establishment;
File type-setting module, for the location information based on the Latex formats formula in pdf document, by drafting The PDF vectograms are inserted at location information corresponding with the Latex formats formula, to obtain the pdf document after typesetting.
In conjunction with second aspect, the present invention provides the first possible embodiments of second aspect, wherein the size Determining module, specifically for determining the Latex formats formula according to the formula analysis function in the Jlatex function libraries Size.
In conjunction with second aspect, the present invention provides second of possible embodiments of second aspect, wherein the vector Figure drafting module, is specifically used for, and generates a JAVA object for including PDF vectograms, the JAVA object is for simulating JAVA's Graphics2D classes;The drafting formula interface for calling the JLatex function libraries, transmits the JAVA object;Described in reception The drafting information of Latex format formula calls the drawing image function in the Graphics2D classes, and the drafting information is turned It is changed to PDF and draws instruction, to be plotted on the PDF vectograms.
In conjunction with second of possible embodiment of second aspect, the third the present invention provides second aspect is possible Embodiment, wherein the drafting information includes content information and the location information corresponding to content information, the content letter Breath includes:Text message and symbolic information.
The composition method and device of formula in pdf document provided by the invention, obtaining XML file first includes Latex format formula;Then it calls Jlatex function libraries to determine the size of Latex format formula, and creates public with Latex formats The identical PDF vectograms of size of formula;Furthermore call Jlatex function libraries that will be painted corresponding to the drafting information of Latex format formula System is on the PDF vectograms of establishment;It is finally based on location information of the Latex format formula in pdf document, by the PDF of drafting Vectogram is inserted at location information corresponding with Latex format formula, to obtain the pdf document after typesetting, that is, it passes through The calling of Jlatex function libraries realizes the direct establishment of PDF vectograms, easy to operate, further such that the typesetting effect of pdf document Rate is higher, and there is no the picture distortion phenomenon under amplifieroperation, and the using experience degree of user is preferable.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, preferred embodiment cited below particularly, and coordinate Appended attached drawing, is described in detail below.
Description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 shows the flow chart of the composition method of formula in a kind of pdf document that the embodiment of the present invention is provided;
The flow chart of the composition method of formula in another pdf document provided Fig. 2 shows the embodiment of the present invention;
Fig. 3 shows the flow chart of the composition method of formula in another pdf document that the embodiment of the present invention is provided;
Fig. 4 shows the structural schematic diagram of the composing device of formula in a kind of pdf document that the embodiment of the present invention is provided.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention Middle attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only It is a part of the embodiment of the present invention, instead of all the embodiments.The present invention being usually described and illustrated herein in the accompanying drawings is real Applying the component of example can be arranged and designed with a variety of different configurations.Therefore, below to provide in the accompanying drawings the present invention The detailed description of embodiment is not intended to limit the range of claimed invention, but is merely representative of the selected reality of the present invention Apply example.Based on the embodiment of the present invention, the institute that those skilled in the art are obtained without making creative work There is other embodiment, shall fall within the protection scope of the present invention.
In the composing system for generating pdf document in view of XML file, for the typesetting of mathematical formulae, there are typesetting efficiency Low, system resource occupies excessively high problem.Based on this, an embodiment of the present invention provides a kind of typesetting sides of formula in pdf document Method calls Jlatex function libraries to carry out mathematical formulae typesetting, and auxiliary XML file generates pdf document, and typesetting efficiency is higher.
The flow chart of the composition method of formula, above-mentioned in pdf document provided in an embodiment of the present invention shown in Figure 1 The executive agent of the composition method of formula is computer equipment in pdf document, and this method specifically comprises the following steps:
S101, the Latex format formula that XML file includes are obtained.
Here, it is contemplated that the concrete application scene of the composition method of formula in pdf document provided in an embodiment of the present invention, this The Latex format formula that inventive embodiments need acquisition XML file to include remain a representation formula in XML file XML tag, the content of label is entirely Latex formats.Specifically, the embodiment of the present invention can be by using text editor The Latex codes in XML file are obtained, the Latex Code obtainings of the mathematical formulae of desired acquisition.
S102, calling Jlatex function libraries determine the size of Latex format formula.
Here, for the Latex codes of the mathematical formulae of above-mentioned acquisition, the embodiment of the present invention is by calling Jlatex functions Library determines the size for the mathematical formulae that Latex codes are stated.Wherein, the size of the mathematical formulae includes but unlimited Width value, height value in mathematical formulae.
S103, establishment PDF vectograms identical with the size of Latex format formula.
Here, the size for the mathematical formulae that the embodiment of the present invention is got based on Jlatex function libraries, create with The identical PDF vectograms of size of Latex codes statement, the height of the vectogram of PDF is the height of formula, PDF vectograms Width be formula width.
S104, call Jlatex function libraries will be plotted in corresponding to the drafting information of Latex format formula the PDF of establishment to On spirogram.
Here, PDF vectogram of the embodiment of the present invention based on initialized size carries out the drafting of mathematical formulae, first First, the Graphics2D classes based on JAVA generate a JAVA object for including PDF vectograms, then call Jlatex function libraries In drafting formula procedure, be passed to generated JAVA object information, instruction will be drawn and be converted into the identical PDF of display effect and refer to It enables, and is drawn on PDF vectograms.
S105, the location information based on Latex format formula in pdf document, by the PDF vectograms of drafting be inserted into At the corresponding location information of Latex format formula, to obtain the pdf document after typesetting.
Here, location information of the embodiment of the present invention based on Latex formats formula in XML file will have been completed to draw Mathematical formulae and label information be inserted into corresponding position in pdf document, with obtain complete typesetting after pdf document.
The composition method of formula in pdf document provided in an embodiment of the present invention, obtaining XML file first includes Latex format formula;Then it calls Jlatex function libraries to determine the size of Latex format formula, and creates public with Latex formats The identical PDF vectograms of size of formula;Furthermore call Jlatex function libraries that will be painted corresponding to the drafting information of Latex format formula System is on the PDF vectograms of establishment;It is finally based on location information of the Latex format formula in pdf document, by the PDF of drafting Vectogram is inserted at location information corresponding with Latex format formula, to obtain the pdf document after typesetting, that is, it passes through The calling of Jlatex function libraries realizes the direct establishment of PDF vectograms, easy to operate, further such that the typesetting effect of pdf document Rate is higher, and there is no the picture distortion phenomenon under amplifieroperation, and the using experience degree of user is preferable.
For the ease of the Latex format formula in XML file to be output in pdf document, the embodiment of the present invention needs to adjust The size of Latex format formula is determined with the formula analysis function in Jlatex function libraries.The embodiment of the present invention can be based on PDF The default page width of file and default page height determine the size of Latex format formula, that is, various sizes of PDF is literary The size of the corresponding Latex formats formula of part is also different.Specifically, the embodiment of the present invention can first call formula analysis function, Then the default page width of pdf document and default page height are input to the formula analysis function, pass through formula analysis letter Several analysis, you can directly acquire the size of Latex format formula.
The composition method of formula also needs to call Jlatex function libraries that will correspond in pdf document provided in an embodiment of the present invention It is plotted on the PDF vectograms of establishment in the drafting information of Latex format formula, referring to Fig. 2, the drafting of above-mentioned PDF vectograms Process specifically comprises the following steps:
S201, a JAVA object for including PDF vectograms is generated, JAVA object is used to simulate the Graphics2D of JAVA Class;
S202, the drafting formula interface for calling JLatex function libraries transmit JAVA object;
S203, the drafting information for receiving Latex format formula call the drawing image function in Graphics2D classes, will It draws information and is converted to PDF drafting instructions, to be plotted on PDF vectograms.
Here, the embodiment of the present invention firstly generates a JAVA object for including PDF vectograms, then passes through calling The drafting formula interface of JLatex function libraries, transmits the JAVA object of above-mentioned generation, then calls JAVA object simulation The drafting information of the Latex format formula of reception is converted to PDF and draws instruction by the drawing image function in Graphics2D classes And it is plotted on PDF vectograms.
Wherein, above-mentioned Graphics2D classes are a general class, and the powerful X-Y scheme processing capacity that JAVA 2D possess is i.e. It is completed by the Graphics2D classes, such is a subclass of Graphics classes.Its feature is the figure painted Shape is handled as an object, and object is first created before drawing.In addition, above-mentioned drafting information includes content information and corresponds to The location information of content information, content information include:Text message and symbolic information.
In the embodiment of the present invention, after by formula analysis typesetting, formula is really drawn, will call and above-mentioned pass to JAVA Corresponding each corresponding drawing image function, and be transmitted to drawing image function point, word, symbol etc. and draw information and correspond to Picture point, draw word, the draftings instruction such as Taoism draw magic figures or incantations number.Above-mentioned drawing image function does not have actually after receiving above-mentioned drafting instruction There is picture on the screen, also do not have to be drawn as bitmap as usually, but drafting instruction is converted into the identical PDF of display effect and is painted System instruction, is drawn on the PDF vectograms created based on JAVA object.
It is interior involved by formula in the embodiment of the present invention in order to further ensure display effect of the formula in pdf document Hold text message, font information and symbolic information that information includes and carries out corresponding processing.
For text message, referring to Fig. 3, the composition method of formula is logical in pdf document provided in an embodiment of the present invention It crosses following steps and realizes the conversion for drawing information to PDF drafting instructions:
S301, the font information that font information is converted into PDF format;
S302, the font information of text message and PDF format is converted into PDF drafting instructions.
Here, the PDF of the text message of PDF format conversion is drawn into instruction and is plotted in the PDF created based on JAVA object On vectogram, the display effect for the text message that formula includes is further ensured.
For symbolic information, in the embodiment of the present invention, it is made to remain unchanged afterwards before switching, to further ensure The display effect for the symbolic information that formula includes.
In addition, in the embodiment of the present invention, for the above-mentioned mathematical formulae for completing to draw in PDF vectograms, can also add Add formula label, and the PDF vectograms added with formula label are inserted into location information corresponding with Latex format formula Place.Wherein, above-mentioned formula label can be the number information of mathematical formulae in pdf document.
The composition method of formula in pdf document provided in an embodiment of the present invention, obtaining XML file first includes Latex format formula;Then it calls Jlatex function libraries to determine the size of Latex format formula, and creates public with Latex formats The identical PDF vectograms of size of formula;Furthermore call Jlatex function libraries that will be painted corresponding to the drafting information of Latex format formula System is on the PDF vectograms of establishment;It is finally based on location information of the Latex format formula in pdf document, by the PDF of drafting Vectogram is inserted at location information corresponding with Latex format formula, to obtain the pdf document after typesetting, that is, it passes through The calling of Jlatex function libraries realizes the direct establishment of PDF vectograms, easy to operate, further such that the typesetting effect of pdf document Rate is higher, and there is no the formula distortion phenomenon under amplifieroperation, and the using experience degree of user is preferable.
Based on same inventive concept, additionally provided in the embodiment of the present invention corresponding with the composition method of formula in pdf document Pdf document in formula composing device, the principle solved the problems, such as due to the device in the embodiment of the present invention implemented with the present invention The composition method of formula is similar in the above-mentioned pdf document of example, therefore the implementation of device may refer to the implementation of method, repeats place not It repeats again.As shown in figure 4, in the pdf document provided by the embodiment of the present invention the composing device of formula structural schematic diagram, should The composing device of formula includes in pdf document:
Formula acquisition module 11, the Latex format formula for including for obtaining XML file;
Size determining module 22 is specifically used for root for calling Jlatex function libraries to determine the size of Latex format formula The size of Latex format formula is determined according to the formula analysis function in Jlatex function libraries;
Vectogram creation module 33, for creating PDF vectograms identical with the size of Latex format formula;
Vectogram drafting module 44, for calling Jlatex function libraries will be corresponding to the drafting information of Latex format formula It is plotted on the PDF vectograms of establishment,
File type-setting module 55, for the location information based on Latex format formula in pdf document, by the PDF of drafting Vectogram is inserted at location information corresponding with Latex format formula, to obtain the pdf document after typesetting.
In specific implementation, above-mentioned size determining module 22 is specifically used for according to the formula analysis in Jlatex function libraries Function determines the size of Latex format formula.
In specific implementation, above-mentioned vectogram drafting module 44 is specifically used for generating include PDF vectograms JAVA a pairs As JAVA object is used to simulate the Graphics2D classes of JAVA;The drafting formula interface of JLatex function libraries is called, JAVA is transmitted Object;The drafting information of Latex format formula is received, the drawing image function in Graphics2D classes is called, information will be drawn It is converted to PDF and draws instruction, to be plotted on PDF vectograms.
Wherein, above-mentioned drafting information includes content information and the location information corresponding to content information, content information packet It includes:Text message and symbolic information.
In specific implementation, above-mentioned vectogram drafting module 44, PDF format is converted into also particularly useful for by text message Text message;The text message of PDF format is converted into PDF and draws instruction.
The composing device of formula further includes in above-mentioned pdf document:
Label drafting module 66, for drawing formula label in the PDF vectograms of drafting.
The composing device of formula in pdf document provided in an embodiment of the present invention, obtaining XML file first includes Latex format formula;Then it calls Jlatex function libraries to determine the size of Latex format formula, and creates public with Latex formats The identical PDF vectograms of size of formula;Furthermore call Jlatex function libraries that will be painted corresponding to the drafting information of Latex format formula System is on the PDF vectograms of establishment;It is finally based on location information of the Latex format formula in pdf document, by the PDF of drafting Vectogram is inserted at location information corresponding with Latex format formula, to obtain the pdf document after typesetting, that is, it passes through The calling of Jlatex function libraries realizes the direct establishment of PDF vectograms, easy to operate, further such that the typesetting effect of pdf document Rate is higher, and there is no the formula distortion phenomenon under amplifieroperation, and the using experience degree of user is preferable.
The computer program product of the method for the typesetting for the carry out pdf document that the embodiment of the present invention is provided, including storage The computer readable storage medium of program code, the instruction that said program code includes can be used for executing previous methods embodiments Described in method, specific implementation can be found in embodiment of the method, details are not described herein.
The device of the typesetting for the pdf document that the embodiment of the present invention is provided can be specific hardware or installation in equipment In software or firmware etc. in equipment.The technique effect of the device that the embodiment of the present invention is provided, realization principle and generation and Preceding method embodiment is identical, and to briefly describe, device embodiment part does not refer to place, can refer in preceding method embodiment Corresponding contents.It is apparent to those skilled in the art that for convenience and simplicity of description, foregoing description is The specific work process of system, device and unit can refer to the corresponding process in above method embodiment, no longer superfluous herein It states.
In embodiment provided by the present invention, it should be understood that disclosed device and method, it can be by others side Formula is realized.The apparatus embodiments described above are merely exemplary, for example, the division of the unit, only one kind are patrolled Volume function divides, formula that in actual implementation, there may be another division manner, in another example, multiple units or component can combine or can To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Coupling, direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some communication interfaces, device or unit It connects, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in embodiment provided by the invention can be integrated in a processing unit, also may be used It, can also be during two or more units be integrated in one unit to be that each unit physically exists alone.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be expressed in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic disc or CD.
It should be noted that:Similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined, then it further need not be defined and explained in subsequent attached drawing in a attached drawing, in addition, term " the One ", " second ", " third " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
Finally it should be noted that:Embodiment described above, only specific implementation mode 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, it will be understood by those of ordinary skill in the art that:Any one skilled in the art In the technical scope disclosed by the present invention, it can still modify to the technical solution recorded in 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.The protection in the present invention should all be covered Within the scope of.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. the composition method of formula in a kind of pdf document, which is characterized in that including:
Obtain the Latex format formula that XML file includes;
Jlatex function libraries are called to determine the size of the Latex formats formula;
Create PDF vectograms identical with the size of Latex formats formula;
Call the Jlatex function libraries that will be plotted in described in establishment corresponding to the drafting information of the Latex formats formula On PDF vectograms;
Location information based on the Latex formats formula in pdf document, by the PDF vectograms of drafting be inserted into At the corresponding location information of the Latex formats formula, to obtain the pdf document after typesetting.
2. according to the method described in claim 1, it is characterized in that, the calling Jlatex function libraries determine the Latex lattice The size of formula formula, including:
The size of the Latex formats formula is determined according to the formula analysis function in the Jlatex function libraries.
3. according to the method described in claim 1, it is characterized in that, described call the Jlatex function libraries will be corresponding to described The drafting information of Latex format formula is plotted on the PDF vectograms of establishment, including:
A JAVA object for including PDF vectograms is generated, the JAVA object is used to simulate the Graphics2D classes of JAVA;
The drafting formula interface for calling the JLatex function libraries, transmits the JAVA object;
The drafting information for receiving the Latex formats formula calls the drawing image function in the Graphics2D classes, by institute It states drafting information and is converted to PDF drafting instructions, to be plotted on the PDF vectograms.
4. according to the method described in claim 3, it is characterized in that, the drafting information includes content information and corresponds to interior Hold the location information of information, the content information includes:Text message, font information and symbolic information.
5. according to the method described in claim 4, it is characterized in that, it is described by the drafting information be converted to PDF draw instruction, Including:
The font information is converted into the font information of PDF format;
The font information of the text message and the PDF format is converted into PDF and draws instruction.
6. according to the method described in claim 1, it is characterized in that, it is described by the PDF vectograms of drafting be inserted into Before at the corresponding location information of the Latex formats formula, further include:
Formula label is drawn in the PDF vectograms of drafting.
7. the composing device of formula in a kind of pdf document, which is characterized in that including:
Formula acquisition module, the Latex format formula for including for obtaining XML file;
Size determining module, for calling Jlatex function libraries to determine the size of the Latex formats formula;
Vectogram creation module, for creating PDF vectograms identical with the size of Latex formats formula;
Vectogram drafting module, for calling the Jlatex function libraries that will believe corresponding to the drafting of the Latex formats formula Breath is plotted on the PDF vectograms of establishment;
File type-setting module, for the location information based on the Latex formats formula in pdf document, described in drafting PDF vectograms are inserted at location information corresponding with the Latex formats formula, to obtain the pdf document after typesetting.
8. device according to claim 7, which is characterized in that the size determining module is specifically used for according to Formula analysis function in Jlatex function libraries determines the size of the Latex formats formula.
9. device according to claim 7, which is characterized in that the vectogram drafting module is specifically used for, and generates a packet The JAVA object of the vectogram containing PDF, the JAVA object are used to simulate the Graphics2D classes of JAVA;Call the JLatex letters The drafting formula interface in number library, transmits the JAVA object;The drafting information of the Latex formats formula is received, described in calling The drafting information is converted to PDF and draws instruction, to be plotted in the PDF by the drawing image function in Graphics2D classes On vectogram.
10. device according to claim 9, which is characterized in that the drafting information includes content information and corresponds to The location information of content information, the content information include:Text message and symbolic information.
CN201810168769.2A 2018-02-28 2018-02-28 The composition method and device of formula in a kind of pdf document Active CN108399156B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810168769.2A CN108399156B (en) 2018-02-28 2018-02-28 The composition method and device of formula in a kind of pdf document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810168769.2A CN108399156B (en) 2018-02-28 2018-02-28 The composition method and device of formula in a kind of pdf document

Publications (2)

Publication Number Publication Date
CN108399156A true CN108399156A (en) 2018-08-14
CN108399156B CN108399156B (en) 2019-09-13

Family

ID=63096708

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810168769.2A Active CN108399156B (en) 2018-02-28 2018-02-28 The composition method and device of formula in a kind of pdf document

Country Status (1)

Country Link
CN (1) CN108399156B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110059628A (en) * 2019-04-18 2019-07-26 广东小天才科技有限公司 Image-recognizing method, device, equipment and storage medium
CN111507067A (en) * 2019-01-31 2020-08-07 北京易真学思教育科技有限公司 Acquisition method for displaying formula picture, and method and device for transferring formula picture
CN112836469A (en) * 2021-01-27 2021-05-25 北京百家科技集团有限公司 Information rendering method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040073708A1 (en) * 1999-12-08 2004-04-15 Warnock Kevin L. Internet document services
CN101046801A (en) * 2006-03-31 2007-10-03 梅国栋 Chinese periodical half-measure platen based on latex language
CN101329731A (en) * 2008-06-06 2008-12-24 南开大学 Automatic recognition method pf mathematical formula in image
CN101714133A (en) * 2009-11-18 2010-05-26 佛山市数苑科技信息有限公司 WEB-based mathematical formula editing system and method
CN105654534A (en) * 2015-12-29 2016-06-08 南京大学 Academic poster automatic composition generation method
CN105868177A (en) * 2016-03-24 2016-08-17 河北师范大学 Universal formula search method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040073708A1 (en) * 1999-12-08 2004-04-15 Warnock Kevin L. Internet document services
CN101046801A (en) * 2006-03-31 2007-10-03 梅国栋 Chinese periodical half-measure platen based on latex language
CN101329731A (en) * 2008-06-06 2008-12-24 南开大学 Automatic recognition method pf mathematical formula in image
CN101714133A (en) * 2009-11-18 2010-05-26 佛山市数苑科技信息有限公司 WEB-based mathematical formula editing system and method
CN105654534A (en) * 2015-12-29 2016-06-08 南京大学 Academic poster automatic composition generation method
CN105868177A (en) * 2016-03-24 2016-08-17 河北师范大学 Universal formula search method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111507067A (en) * 2019-01-31 2020-08-07 北京易真学思教育科技有限公司 Acquisition method for displaying formula picture, and method and device for transferring formula picture
CN110059628A (en) * 2019-04-18 2019-07-26 广东小天才科技有限公司 Image-recognizing method, device, equipment and storage medium
CN112836469A (en) * 2021-01-27 2021-05-25 北京百家科技集团有限公司 Information rendering method and device

Also Published As

Publication number Publication date
CN108399156B (en) 2019-09-13

Similar Documents

Publication Publication Date Title
CN110781423B (en) Webpage generation method and device and electronic equipment
CN109101300B (en) Page rendering method and device and terminal
CN107832108B (en) Rendering method and device of 3D canvas webpage elements and electronic equipment
CN106250104B (en) A kind of remote operating system for server, method and device
CN106095437B (en) The implementation method and device of the user interface layout type of RTL from right to left
CN105930312B (en) A kind of printing strip edit methods and device based on POS terminal
CN108399156B (en) The composition method and device of formula in a kind of pdf document
CN109918604A (en) Page drawing method, apparatus, equipment and storage medium
US10664980B2 (en) Vector graphics handling processes for user applications
CN107450897B (en) Cross-platform migration method and device for graphic engine
CN111209721A (en) Bitmap font realization method and device, electronic equipment and storage medium
CN102591961A (en) Method and system for making data charts
CN102122502A (en) Method and related device for displaying three-dimensional (3D) font
CN112363794A (en) Rendering method of front-end list type component and electronic equipment
CN105635464A (en) Message processing method and apparatus
CN108733441A (en) A kind of rendering method for visualizing and system suitable for large scale electric network symbolic device
CN104240273A (en) Raster image processing method and device
CN109815451A (en) A kind of PDF generation method, device and equipment
CN104793837A (en) Picture generation method and device
CN110211484A (en) A kind of electronics price tag display methods, system and server and storage medium
CN109543130A (en) The display methods and device of label under three-dimensional scenic
CN107730572A (en) A kind of chart rendering intent and device
CN106548501B (en) Image drawing method and device
CN114443022A (en) Method for generating page building block and electronic equipment
CN102681755A (en) Method, device and equipment for realizing display transformation of display object

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
GR01 Patent grant
GR01 Patent grant