Print to Pdf printer and fonts
Moderators: SDS, support, admin
Print to Pdf printer and fonts
I can convert dwg into pdf file, but text are not selectable in pdf viewer. I think is a font issue, but how can i set the righe font ? Should i use SHX fonts ?
Code: Select all
_cadImage = CADImage.CreateImageByExtension(_nameFile)
_cadImage.UseDoubleBuffering = False
_cadImage.LoadFromFile(_nameFile)
_cadImage.UseSHXFonts = True
_cadImage.UseTTFFonts = Not _cadImage.UseSHXFonts
_cadImage.UseMultyTTFFonts = Not _cadImage.UseSHXFonts
Dim entMText As CADMText = New CADMText
entMText.Text = "{\fTimes New Roman|b0|i1;\H19;\l\C132;timers\P}"
entMText.Color = Color.Red
entMText.Point = New DPoint(100, 100, 0)
entMText.Height = 10
entMText.Loaded(_cadImage.Converter)
_cadImage.Converter.GetSection(FaceModule.ConvSection.Entities).AddEntity(entMText)
_cadImage.Converter.OnCreate(entMText)
_cadImage.Converter.Loads(entMText)
Dim entText As CADText = New CADText
entText.Color = Color.Green
entText.Point = New DPoint(-200, -200, 0)
entText.Height = 12
entText.FontName = "E:\Documents and Settings\mercanti\Desktop\cadimportnet_07\dwg\dwg\romans.shx"
entText.Text = entText.FontName
entText.Loaded(_cadImage.Converter)
_cadImage.Converter.GetSection(FaceModule.ConvSection.Entities).AddEntity(entText)
_cadImage.Converter.OnCreate(entText)
_cadImage.Converter.Loads(entText)
_cadImage.GetExtents()
Dim prtForm As CADImport.Printing.PrintingForm
prtForm = New CADImport.Printing.PrintingForm
prtForm.TypePage = CADImport.Printing.DrawingSize.Fit
prtForm.Image = _cadImage
prtForm.Print(True)
Re: Print to Pdf printer and fonts
Hello.
You create the Image object that contain Text and MText objects then print it using virtual printer that creates a PDF document, if I'm understood correctly? Possibly the PDF creator you use doesn't export text objects as texts in PDF.
Alexander.
You create the Image object that contain Text and MText objects then print it using virtual printer that creates a PDF document, if I'm understood correctly? Possibly the PDF creator you use doesn't export text objects as texts in PDF.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Print to Pdf printer and fonts
maybe. But why "Trial version" si converted to text ?
Re: Print to Pdf printer and fonts
Hello.
Please try create text object with the some specified style within your code. For example:Also which library version you use?
Alexander.
Please try create text object with the some specified style within your code. For example:
Code: Select all
...
CADText entText = new CADText();
CADStyle txtStyle = new CADStyle();
txtStyle.Name = "Gothice";
txtStyle.PrimaryFont = "Gothice";
this._cadImage.Converter.Styles.Insert(0, txtStyle);
entText.Style = (CADStyle)this._cadImage.Converter.Styles[0];
entText.Color = Color.Red;
entText.Point = new DPoint(0, 0, 0);
entText.Height = 20;
entText.Text = "Hello World!!!";
entText.LineWeight = 0.1;
entText.Loaded(this._cadImage.Converter);
this._cadImage.Converter.OnCreate(entText);
this._cadImage.CurrentLayout.AddEntity(entText);
this._cadImage.GetExtents();
...
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Print to Pdf printer and fonts
Trying with this code (not working) and version 7.2.2.19035
With BullZip printer i can't see any font information and the text isn't selectable.
The "Trial version" print PDF generated by demo application is replaced with a font called "TT9A0Ao00". So my question is: what is the name of the font used to write "Trial version" and why that message is selectable ?
Code: Select all
Dim entText As CADText = New CADText
Dim txtStyle As CADStyle = New CADStyle
txtStyle.Name = "Arial"
txtStyle.PrimaryFont = "e:\windows\fonts\Arial.ttf"
_cadImage.Converter.Styles.Insert(0, txtStyle)
entText.Style = _cadImage.Converter.Styles(0)
entText.Color = System.Drawing.Color.Black
entText.Point = New DPoint(_cadImage.Extents.left, _cadImage.Extents.bottom, 0)
entText.Height = 20
entText.Text = "Hello World!!!"
entText.LineWeight = 0.1
entText.Loaded(_cadImage.Converter)
_cadImage.Converter.GetSection(FaceModule.ConvSection.Entities).AddEntity(entText)
_cadImage.Converter.OnCreate(entText)
_cadImage.Converter.Loads(entText)
_cadImage.GetExtents()
The "Trial version" print PDF generated by demo application is replaced with a font called "TT9A0Ao00". So my question is: what is the name of the font used to write "Trial version" and why that message is selectable ?
Re: Print to Pdf printer and fonts
Another question:
When i define a style:
How should i set "PrimaryFont" property:
with name ?
With full path ?
With name.ext seen in %font% directory ?
When i define a style:
Code: Select all
txtStyle.PrimaryFont = "Cour.ttf"
with name ?
With full path ?
With name.ext seen in %font% directory ?
Re: Print to Pdf printer and fonts
please include the following code string:this property specifies drawing the texts using GDI+. I expect the text object will be selectable afterwards.
You can specify the PrimaryFont using name or paph or a file name.
Alexander.
Code: Select all
_cadImage.DrawTextMeansGDIPlusMethods = true;
Dim entText As CADText = New CADText
Dim txtStyle As CADStyle = New CADStyle
You can specify the PrimaryFont using name or paph or a file name.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Print to Pdf printer and fonts
Please note, the DrawTextMeansGDIPlusMethods method was removed from library in the version 7.2.5. GDI+ will be used for non-rotated texts automatically. However the rotated texts will be drawn using glyphs.
Alexander.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Print to Pdf printer and fonts
Ok, Thank you.
Now I have one more question to a text problem.
In the pdf the rotated text is not "in line" with the line as in the dwg.
How can i fix it ?
Now I have one more question to a text problem.
In the pdf the rotated text is not "in line" with the line as in the dwg.
How can i fix it ?
- Attachments
-
- e1926p.zip
- pdf and dwg
- (71.74 KiB) Downloaded 1439 times
Re: Print to Pdf printer and fonts
So with Version 7.2.5.24180 , how can i manage rotated text to leave it selectable ?
See always the same pdf attached in this thread.
See always the same pdf attached in this thread.
Re: Print to Pdf printer and fonts
The DrawTextMeansGDIPlusMethods was removed and rotated texts can't be visualized using GDI+. This mean rotated texts won't be selectable in PDF that is received via visualized image. However, our library doesn't oriented for using with PDF creators. The modification's purpose is more correct visualization of CAD files - AutoCAD draws texts in such manner. So I recommend using version 7.2.2 for your task. We will possibly implement some solution for such situation in the future versions.
Please specify what you meant by
Alexander.
Please specify what you meant by
Texts looks identically, except lines thickness. If thi is the problem then you need set SHX fonts using to correct it.not "in line" with the line as in the dwg
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Print to Pdf printer and fonts
For the "In line problem" see the image posted
- Attachments
-
- screen shot from Cad & pdf reader
- notlinLine.jpg (52.24 KiB) Viewed 65733 times
Re: Print to Pdf printer and fonts
Hello.
Alexander.
The situation from your picture was one of the reasons for such modification.The DrawTextMeansGDIPlusMethods was removed and rotated texts can't be visualized using GDI+ (7.2.5). The modification's purpose is more correct visualization of CAD files
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support