English
Forum

RTF and Print out

 
- Page 1 -



Thomas
Freier
found I had of Andreas:
CompileMarkSeparation
 $I Profalt.inc
'################################
'Drucken mit dem Richedit-Control
'################################
DEF StartDoc(2)      ! "gdi32","StartDocA"
DEF StartPage(1)     ! "gdi32","StartPage"
DEF EndPage(1)       ! "gdi32","EndPage"
DEF EndDoc(1)        ! "gdi32","EndDoc"
DEF CreateDC(4)      ! "gdi32","CreateDCA"
DEF DeleteDC(1)      ! "gdi32","DeleteDC"
DEF GetDeviceCaps(2) ! "gdi32","GetDeviceCaps"
DEF PrintDlg(1)      ! "comdlg32","PrintDlgA"
Declare Richedit&,RichDLL&,Ende&,Print&,Exit&,FileName$,Driver$,Printer$
Declare Horzres&,Vertres&,PixelsX&,PixelsY&,iWidthTwips&,iHeightTwips&
Declare iTextOut&,iTextLength&,DocName$
Declare PrinterDC&
Declare FormatRange#,PrintDLG#,cRect#
Declare DocInfo#
Dim FormatRange#,48
Dim DocInfo#,12
Clear DocInfo#
Dim PrintDLG#,66
Clear PrintDLG#
Dim cRect#,16
SetTrueColor 1
Window 0,0-640,480
CLS RGB(196,196,196)
Print& = CreateButton(%hwnd,"Drucken",500,40,80,24)
Exit& = CreateButton(%hwnd,"Ende",500,70,80,24)
RichEdit& = Create("RichEdit",%hwnd,"",0,2,460,430)
FileName$ = LoadFile$("Als RTF öffnen","*.RTF")

If FileName$ <> ""

    RTF("LoadRTF",Richedit&,Filename$)

EndIf

DocName$ = "Profan-RTFPrinter"

Whilenot Ende&

    Waitinput

    If GetFocus(Exit&)

        Ende& = 1

    ElseIf GetFocus(Print&)

        Long PrintDLG#,0  = 66
        Long PrintDLG#,4  = %hwnd
        Long PrintDLG#,20 = $0140'PD_RETURNDC,PD_PRINTSETUP
        PrintDlg(PrintDLG#)
        PrinterDC& = Long(PrintDLG#,16)

        If PrinterDC&

            HorzRes& = GetDeviceCaps(PrinterDC&,8)
            VertRes& = GetDeviceCaps(PrinterDC&,10)
            PixelsX& = GetDeviceCaps(PrinterDC&,88)
            PixelsY& = GetDeviceCaps(PrinterDC&,90)
            iWidthTwips& = Int((HorzRes&/PixelsX&))*1440
            iHeightTwips& = Int((VertRes&/PixelsY&))*1440
            Long cRect#,0 = 0
            Long cRect#,4 = 0
            Long cRect#,8 = iWidthTwips&
            Long cRect#,12 = iHeightTwips&
            Long DocInfo#,0 = 12
            Long DocInfo#,4 = ADDR(Docname$)
            Long FormatRange#,0 = PrinterDC&'HDC
            Long FormatRange#,4 = PrinterDC&'TargetHDC
            Long FormatRange#,8 = 0'linker Rand in Twips
            Long FormatRange#,12 = 0'oberer Rand in Twips
            Long FormatRange#,16 = iWidthTwips&'rechter Rand in Twips
            Long FormatRange#,20 = iHeightTwips&'unterer Rand in Twips
            Long FormatRange#,24 = 0'linker Rand in Twips
            Long FormatRange#,28 = 0'oberer Rand in Twips
            Long FormatRange#,32 = iWidthTwips&'rechter Rand in Twips
            Long FormatRange#,36 = iHeightTwips&'unterer Rand in Twips
            Long FormatRange#,40 = 0'CharRange-MIN
            Long FormatRange#,44 = -1'CharRange MAX ( -1 = alles )
            iTextOut& = 0
            iTextLength& = SendMessage(RichEdit&, 14, 0, 0)- SendMessage(RichEdit&,186,0,0)
            StartDoc(PrinterDC&,DocInfo#)

            Whilenot OR(iTextOut& >= iTextLength&,itextOut& = -1)

                StartPage(PrinterDC&)
                Long FormatRange#,44 = -1
                iTextOut& = SendMessage(RichEdit&, 1081, 1, FormatRange#)
                Long FormatRange#,40 = iTextOut&
                SendMessage(RichEdit&,1075,0,cRect#)
                EndPage(PrinterDC&)

            Wend

            EndDoc(PrinterDC&)
            SendMessage(RichEdit&, 1081, 1, 0)

        Endif

    Endif

EndWhile

Dispose FormatRange#
Dispose DocInfo#
Dispose PrintDLG#
DeleteDCon>PrinterDC&)
End

unfortunately end the pressure to 3 pages. WordPad druckt everything. How geht's with XProfan?

2.867 kB
Hochgeladen:10/06/10
Downloadcounter89
Download
 
Gruß Thomas
Windows XP SP2, XProfan X2
10/06/10  
 



 
- Page 2 -


« this Posting watts as Solution marked. »

- Page 3 -



Uwe
''Pascal''
Niemeier
Hi Thomas!

apparently becomes from the FORMATRANGE-structure not only the To bedruckende area read, separate to the Print too the objectively genutzte area hinterlegt (or something like in the manner). therefore must the betroffene cut offed the structure each Schleifendurchlauf new equips go.

SeeYou
Pascal

6 kB
Version:2
Kurzbeschreibung: RTF print
Hochgeladen:10/26/10
Downloadcounter151
Download
 
10/26/10  
 




Thomas
Freier
lovely, now runs it too by me. only durchsteigen, Why the so is, can I not. too can I a attitude for oberen Randabstand not turn off or exists these Possibility not?
 
Gruß Thomas
Windows XP SP2, XProfan X2
10/08/10  
 



settle liesse itself the upper edge well...
CompileMarkSeparation
CompileMarkSeparationgives by me 0 from - vlt. by separate Topic clarify or. look time vlt. with Search to Borders/ z.B.  [...]  .
 
10/09/10  
 




Thomas
Freier
The Ansatz is already OK. thanks iF, goes so very well. I set whom Randabstand left and supra How follows:
CompileMarkSeparation
var RANDLI%=0'in Twips
var RANDOB%=500'in Twips
var CXPHYSOFFSET%=GETDEVICECAPS(HDCC&, 112)+RANDLI%
var CYPHYSOFFSET%=GETDEVICECAPS(HDCC&, 113)+RAND
pre>

whom bedruckbaren area To fetch rewards today hardly, since the most printer randlos print can. means I will only a oberen- and book-edge pretending, or. take on let.
 
Gruß Thomas
Windows XP SP2, XProfan X2
10/09/10  
 



Ah, ok & gladly happen. ^^
 
10/09/10  
 



simply only 1 RTF complete print out functions by me so now integrally super:

(Have dispose fr# in the function forget)

931 kB
Hochgeladen:10/13/10
Downloadcounter2
Download
 
10/13/10  
 




Thomas
Freier
by me "hängt" always a File. first supposition, since the File first before the pressure created becomes, that the printer already on The erzeugende File zugreift, before the Speichervorgang exits is, shining not To zutreffen.
might of/ one once on seinem system The enclosed File with the TEXT130.exe testing.
with another software is tappt im dunkeln free from problems to open and To print.

3.252 kB
Hochgeladen:10/14/10
Downloadcounter59
Download
 
Gruß Thomas
Windows XP SP2, XProfan X2
10/14/10  
 



is correct, "hängt" shows by me the it from the Loop not herauskommt and hundreds Pages in order gives. ^^

tommorrow time look what there "abgeht" or. Why the Break-argument apparently never zutrifft.
 
10/14/10  
 




Thomas
Freier
Yes, is insane, whom others RTFs with more or less Images get planmäßig printed. too this leaf becomes tidy printed, if to the last Image yet Text or a Leerzeile eingefügt becomes. it arise then a new Page. The problem is presumably: the latest, on this leaf possible Image (Objekt), resolve weder a Seitenwechsel yet Druckende from.
 
Gruß Thomas
Windows XP SP2, XProfan X2
10/14/10  
 



SendMessage em_formatRange gives The latest position back, this worth might z.B. of Page To Page not "gleich" his - vlt. fit something not The Page and so one since the position vlt. "manuell" go on ought to. I check in the example The position too differently as mere of msdn Translated damits with StartPrint/ nextPage works without StartDoc-Api - vlt. Have I here what overlooking.
 
10/15/10  
 




Thomas
Freier

.... vlt. Have I here what overlooking.


and something overlooking?
 
Gruß Thomas
Windows XP SP2, XProfan X2
10/20/10  
 



Ah, not at all geschaut - Uwe and Dieter are there explicit kompetentere contact persons and so I of ausging already helped is.
 
10/20/10  
 




Thomas
Freier
i'd it rather find, if your Scrips, The Yes very well are, too famous gewordene Error not any more hätten.
is still too possible, that Uwes example under designed Umständen in a Endlosschleife end. to safety has it now The max. To druckenden pages pretended. there's at employment naturally the trouble, that the Seitenanzahl the Dokumentes seldom detect can.
 
Gruß Thomas
Windows XP SP2, XProfan X2
10/21/10  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

17.159 Views

Untitledvor 0 min.
Uwe Lang02/18/24
H.Brill09/18/20
boh109/11/20
Alibre12/25/19
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie