Neue Testversion 21.40b6

Hier diskutieren die Betatester von PhotoLine untereinander und mit den Entwicklern
PhilM
Mitglied
Beiträge: 171
Registriert: Do 28 Mai 2015 18:00
Wohnort: Belgium

Re: Neue Testversion 21.40b6

Beitrag von PhilM »

Martin Huber hat geschrieben: Mo 17 Dez 2018 10:34
PhilM hat geschrieben: So 16 Dez 2018 10:58I am working on a multi-page document.

I can't find how to move from page to page : Next/Previous, First/Last or to move to a specific page number.
You can do

Code: Alles auswählen

For Each page In doc
    (...)
Next
Martin
Thanks

It works. Needs to activate the page : doc.ActivePage = page

Do you mean that there is no other way to navigate in the document's pages ?

Philippe
Martin Huber
Entwickler
Entwickler
Beiträge: 4176
Registriert: Di 19 Nov 2002 15:49

Re: Neue Testversion 21.40b6

Beitrag von Martin Huber »

russellcottrell hat geschrieben: So 16 Dez 2018 22:07 WScript.Shell is for javascript. In vbscript, just do

Code: Alles auswählen

for Each propertyName in doc
	MsgBox propertyName
This enumerates the pages of a document.

You can use Oleview.exe to inspect the available interfaces. AFAIK Oleview is only available as part of Visual Studio. There are other TLB viewers, too, but I don't have used any of them.

These viewers just list the classes and properties/methods in a quite cryptic way, basically they are just displaying the contents of a PhotoLine source code file (PhotoLine.idl). Another way is creating a C# or VB.net project in Visual Studio and adding a reference to PhotoLine. This way you can list the available interfaces, too.
But our documentation is more precise and easier to use.

Martin
PhilM
Mitglied
Beiträge: 171
Registriert: Do 28 Mai 2015 18:00
Wohnort: Belgium

Re: Neue Testversion 21.40b6

Beitrag von PhilM »

Ceating 8 labels on a page
The intent of the script is to create labels using a text file as source.

My script produces inconsistent results.

The first line of the label should be left aligned
The second line right aligned.

Here is a simplified script that should make 8 identical labels.
The result is that all labels are not identical.
The result is different at each script run.
Strange !
'Etiquettes
Dim pl, doc, pg, lyr
Dim ligne1, ligne2

Set pl = CreateObject("PhotoLine.Application")
pl.Visible = True
Set doc = pl.ActiveDocument
'Set pg = CreateObject("PhotoLine.Page")
Set pg = doc.ActivePage
Set lyr = doc.RootLayer.Last

ligne1 = "First line"
ligne2 = "Second LINE"

Dim range(1), range1(1), range2(1), fontDict, paragraphDict, textLayer, i, espace

'Formats du texte
Set fontDict = CreateObject("PhotoLine.Dictionary")
fontDict.Add "FamilyName", "Arial", "Size", 60
Set paragraphDict1 = CreateObject("PhotoLine.Dictionary")
paragraphDict1.Add "Alignment", 0, "After", 12
Set paragraphDict2 = CreateObject("PhotoLine.Dictionary")
paragraphDict2.Add "Alignment", 1, "After", 12

espace = 390 'Labels spacing

' Créer un groupe
Set grp = CreateObject("PhotoLine.Layer")
doc.RootLayer.Insert grp, -1
grp.Name = "Etiquettes"
Set lyr = doc.RootLayer.Last

For i = 1 to 8
' ligne1 = f.readline
' ligne2 = f.readline

range(0) = 0
range(1) = len(ligne1) + len(ligne2) + 2
range1(0) = 0
range1(1) = len(ligne1)
range2(0) = len(ligne1)
range2(1) = range(1)

Set textLayer = CreateObject("PhotoLine.Text")
textLayer.Origin = Array(120, i * espace)
textLayer.Size = Array(1300, 165)

textLayer.Text = ligne1 & VBCrLf & ligne2
textLayer.SetAttribute range, "Font", fontDict
textLayer.SetAttribute range1, "Paragraph", paragraphDict1 'Left align
textLayer.SetAttribute range2, "Paragraph", paragraphDict2 'Right align
textLayer.SetAttribute range, "Color", Array(0, 0, 0)

lyr.Insert textLayer, -1 'Insert text
Next
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
PhilM
Mitglied
Beiträge: 171
Registriert: Do 28 Mai 2015 18:00
Wohnort: Belgium

Re: Neue Testversion 21.40b6

Beitrag von PhilM »

Second run
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Martin Huber
Entwickler
Entwickler
Beiträge: 4176
Registriert: Di 19 Nov 2002 15:49

Re: Neue Testversion 21.40b6

Beitrag von Martin Huber »

PhilM hat geschrieben: Mo 17 Dez 2018 19:48

Code: Alles auswählen

(...)
Dim	range(1), range1(1), range2(1), (...)
Arrays returned from scripting should be declared as

Code: Alles auswählen

Dim	range, range1, range2
because they are COM arrays (SAFEARRAYs) and not VBScript arrays.
PhilM hat geschrieben: Mo 17 Dez 2018 19:48

Code: Alles auswählen

(...)
		range(0) = 0
		range(1) = len(ligne1) + len(ligne2) + 2
		range1(0) = 0
		range1(1) = len(ligne1)
		range2(0) = len(ligne1)
		range2(1) = range(1)
You shouldn't "guess" the ranges yourself. With Unicode character counts are not easy, especially if you are using non-ASCII characters. Instead, let PhotoLine calculate the ranges for you.
PhilM hat geschrieben: Mo 17 Dez 2018 19:48

Code: Alles auswählen

(...)		textLayer.Text = ligne1 & VBCrLf & ligne2
In PhotoLine a paragraph ends with VBLf.

So the code should look like this:

Code: Alles auswählen

'Etiquettes
Dim pl, doc, pg, lyr
Dim ligne1, ligne2

Set pl = CreateObject("PhotoLine.Application")
pl.Visible = True
Set doc = pl.ActiveDocument
'Set pg = CreateObject("PhotoLine.Page")
Set pg = doc.ActivePage
Set lyr = doc.RootLayer.Last

ligne1 = "First line"
ligne2 = "Second LINE"

Dim	range, range1, range2, fontDict, paragraphDict, textLayer, i, espace

'Formats du texte
Set fontDict = CreateObject("PhotoLine.Dictionary")
fontDict.Add "FamilyName", "Arial", "Size", 60
Set paragraphDict1 = CreateObject("PhotoLine.Dictionary")
paragraphDict1.Add "Alignment", 0, "After", 12
Set paragraphDict2 = CreateObject("PhotoLine.Dictionary")
paragraphDict2.Add "Alignment", 1, "After", 12

espace = 390	'Labels spacing

'	Créer un groupe
Set grp = CreateObject("PhotoLine.Layer")
doc.RootLayer.Insert grp, -1
grp.Name = "Etiquettes"
Set lyr = doc.RootLayer.Last

For i = 1 to 8
	'	ligne1 = f.readline
	'	ligne2 = f.readline

	Set textLayer = CreateObject("PhotoLine.Text")
	textLayer.Origin = Array(120, i * espace)
	textLayer.Size = Array(1300, 165)

	textLayer.Text = ligne1 & VBLf & ligne2
	range = textLayer.TextRange
	range1 = textLayer.ParagraphRange(0)
	range2 = textLayer.ParagraphRange(range1(0) + range1(1))
	textLayer.SetAttribute range1, "Paragraph", paragraphDict1	'Left align
	textLayer.SetAttribute range2, "Paragraph", paragraphDict2	'Right align
	textLayer.SetAttribute range, "Font", fontDict
	textLayer.SetAttribute range, "Color", Array(0, 0, 0)

	lyr.Insert textLayer, -1	'Insert text
Next
This works fine here.

Martin
PhilM
Mitglied
Beiträge: 171
Registriert: Do 28 Mai 2015 18:00
Wohnort: Belgium

Re: Neue Testversion 21.40b6

Beitrag von PhilM »

Martin Huber hat geschrieben: Mo 17 Dez 2018 22:29 ...
So the code should look like this:

Code: Alles auswählen

'Etiquettes
Dim pl, doc, pg, lyr
Dim ligne1, ligne2

Set pl = CreateObject("PhotoLine.Application")
pl.Visible = True
Set doc = pl.ActiveDocument
'Set pg = CreateObject("PhotoLine.Page")
Set pg = doc.ActivePage
Set lyr = doc.RootLayer.Last

ligne1 = "First line"
ligne2 = "Second LINE"

Dim	range, range1, range2, fontDict, paragraphDict, textLayer, i, espace

'Formats du texte
Set fontDict = CreateObject("PhotoLine.Dictionary")
fontDict.Add "FamilyName", "Arial", "Size", 60
Set paragraphDict1 = CreateObject("PhotoLine.Dictionary")
paragraphDict1.Add "Alignment", 0, "After", 12
Set paragraphDict2 = CreateObject("PhotoLine.Dictionary")
paragraphDict2.Add "Alignment", 1, "After", 12

espace = 390	'Labels spacing

'	Créer un groupe
Set grp = CreateObject("PhotoLine.Layer")
doc.RootLayer.Insert grp, -1
grp.Name = "Etiquettes"
Set lyr = doc.RootLayer.Last

For i = 1 to 8
	'	ligne1 = f.readline
	'	ligne2 = f.readline

	Set textLayer = CreateObject("PhotoLine.Text")
	textLayer.Origin = Array(120, i * espace)
	textLayer.Size = Array(1300, 165)

	textLayer.Text = ligne1 & VBLf & ligne2
	range = textLayer.TextRange
	range1 = textLayer.ParagraphRange(0)
	range2 = textLayer.ParagraphRange(range1(0) + range1(1))
	textLayer.SetAttribute range1, "Paragraph", paragraphDict1	'Left align
	textLayer.SetAttribute range2, "Paragraph", paragraphDict2	'Right align
	textLayer.SetAttribute range, "Font", fontDict
	textLayer.SetAttribute range, "Color", Array(0, 0, 0)

	lyr.Insert textLayer, -1	'Insert text
Next
This works fine here.

Martin
Thanks a lot.
It does work with me also.
Still puzzled why my "bad" code does not produce consistent bad results ...

Have a very nice year end !

Philippe
Benutzeravatar
russellcottrell
Mitglied
Beiträge: 251
Registriert: Sa 26 Jul 2014 10:13
Wohnort: California

Re: Neue Testversion 21.40b6

Beitrag von russellcottrell »

You could do away with dealing with the ranges if you create each line as a separate layer. It seems easier to me, but I don’t create complicated paragraphs. I also prefer to open a text file, read the whole thing, close it, then manipulate the text such as by splitting it into lines. Below I used the createTextLayer function from my script library; I am going to have to rewrite it so it just returns the layer, so the user can specify where to insert it.

Code: Alles auswählen

var pl = new ActiveXObject("PhotoLine.Application");
var doc = pl.ActiveDocument;
var grp = new ActiveXObject("PhotoLine.Layer");
doc.RootLayer.Insert(grp, -1);
grp.Name = "Etiquettes";
doc.ActiveLayer = grp;
var textLayer;

//var text = readTextFile("label.txt").replace(/\r?\n/g, "\n").split("\n");
//var ligne1 = text[0];
//var ligne2 = text[1];

var ligne1 = "First line";
var ligne2 = "Second LINE";

var labelWidth = 1300;
var labelHeight = 390;
var fontSize = 60;
var lineSpace = 12;
var left = 120;
var top;

for (var i=0; i<8; i++) {

  top = i*labelHeight;
  textLayer = createTextLayer(ligne1, "Arial", fontSize, [0,0,0], left, top, labelWidth, fontSize, 0);
  grp.Insert(textLayer, -1);

  top += fontSize + lineSpace;
  textLayer = createTextLayer(ligne2, "Arial", fontSize, [0,0,0], left, top, labelWidth, fontSize, 1);
  grp.Insert(textLayer, -1);

}




function createTextLayer(text, fontName, fontSize, fontColor, left, top, width, height, paragraphAlignment) {

for (var i=4; i<=7; i++)
  arguments[i] = Math.round(arguments[i]);

var doc, aLayer, fontDict, paragraphDict, textLayer, range;

doc = pl.ActiveDocument;
aLayer = doc.ActiveLayer || doc.RootLayer.Last;

fontDict = new ActiveXObject("PhotoLine.Dictionary");
fontDict.Add("FamilyName", fontName, "Size", fontSize);

paragraphDict = new ActiveXObject("PhotoLine.Dictionary");
paragraphDict.Add("Alignment", paragraphAlignment);

textLayer = new ActiveXObject("PhotoLine.Text");
textLayer.Text = text;
range = [0, textLayer.TextLength];
textLayer.Origin = [left, top];
textLayer.Size = [width, height];
textLayer.SetAttribute(range, "Color", fontColor);
textLayer.SetAttribute(range, "Font", fontDict);
textLayer.SetAttribute(range, "Paragraph", paragraphDict);

return textLayer;

}



function readTextFile(filePath) {
var textFile, text;
text = "";
var fso = new ActiveXObject("Scripting.FileSystemObject");
if (fso.FileExists(filePath)) {
  textFile = fso.OpenTextFile(filePath, 1);
  if (!textFile.AtEndOfStream)
    text = textFile.ReadAll();
  textFile.Close();
}
return text;
}
PhilM
Mitglied
Beiträge: 171
Registriert: Do 28 Mai 2015 18:00
Wohnort: Belgium

Re: Neue Testversion 21.40b6

Beitrag von PhilM »

russellcottrell hat geschrieben: Mi 19 Dez 2018 09:11 You could do away with dealing with the ranges if you create each line as a separate layer. It seems easier to me, but I don’t create complicated paragraphs. I also prefer to open a text file, read the whole thing, close it, then manipulate the text such as by splitting it into lines. Below I used the createTextLayer function from my script library; I am going to have to rewrite it so it just returns the layer, so the user can specify where to insert it.
Thank you Russell for giving my script a bit more "style" and a better use of functions.

You certainly noticed that I am not a programmer ...

Your idea of splitting the label is fine as far as code is concerned.
The disadvantage is that the resulting pld file is less readable for an end user who would have to edit some of the labels.

Thanks again
I wish you a nice year end.

Philippe
Benutzeravatar
Herbert123
Mitglied
Beiträge: 2166
Registriert: Sa 12 Mai 2012 21:38

Re: Neue Testversion 21.40b6

Beitrag von Herbert123 »

Bug Curves transparancy/alpha in 16/32bpc mode

When I try to adjust the alpha channel of a 16/32bpc image with the curves in A/transparency channel, it results in crazy behaviour. Please refer to the screenshot. My intention was to tighten the alpha a bit. Works fine in 8bit, but not at higher bit depths.

Btw, when I tried to attach this image (which is only 60kb), the forum complains it is too big... Zipping the image works, though.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
Martin Huber
Entwickler
Entwickler
Beiträge: 4176
Registriert: Di 19 Nov 2002 15:49

Re: Neue Testversion 21.40b6

Beitrag von Martin Huber »

Herbert123 hat geschrieben: Do 20 Dez 2018 19:44When I try to adjust the alpha channel of a 16/32bpc image with the curves in A/transparency channel, it results in crazy behaviour. Please refer to the screenshot. My intention was to tighten the alpha a bit. Works fine in 8bit, but not at higher bit depths.

Btw, when I tried to attach this image (which is only 60kb), the forum complains it is too big...
I don't care about screenshots. They usually just show the error and don't replace a proper description. I can either reproduce the problem from the description, in which case I don't need a screenshot, or I can't, in which case it won't help me.

I can't remember a single case where I asked for a screenshot. I know that I asked for sample files at least several hundred times.
But if the description is sufficient (which it is in this case), I don't need a sample file either.

I will fix the problem.

Martin
Benutzeravatar
Herbert123
Mitglied
Beiträge: 2166
Registriert: Sa 12 Mai 2012 21:38

Re: Neue Testversion 21.40b6

Beitrag von Herbert123 »

I get consistent crashes when I use the Autotransparency tool. I attached a link to a PLD file. When I try to use the tool in the top left corner of the spider background, only a small rectangular section is removed. After that, the tool no longer seems to do anything, and stops functioning.

When I fix the scaling, and try the Autotransparency tool once again, PL crashes. It may not crash the first time, but consecutive quick attempts after another will crash PhotoLine.

http://www.upl.co/uploads/testtranspare ... 939567.zip
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
Martin Huber
Entwickler
Entwickler
Beiträge: 4176
Registriert: Di 19 Nov 2002 15:49

Re: Neue Testversion 21.40b6

Beitrag von Martin Huber »

Herbert123 hat geschrieben: Do 27 Dez 2018 21:40I get consistent crashes when I use the Autotransparency tool. I attached a link to a PLD file. When I try to use the tool in the top left corner of the spider background, only a small rectangular section is removed. After that, the tool no longer seems to do anything, and stops functioning.

When I fix the scaling, and try the Autotransparency tool once again, PL crashes. It may not crash the first time, but consecutive quick attempts after another will crash PhotoLine.
Is "Read Merged" activated in the Tool Settings? If so, deactivating it should fix the problem. I will check that.

Martin
Benutzeravatar
Herbert123
Mitglied
Beiträge: 2166
Registriert: Sa 12 Mai 2012 21:38

Re: Neue Testversion 21.40b6

Beitrag von Herbert123 »

Correct, that seems to be the culprit. I turned it off, and no more crashes.
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
Eurgail
Mitglied
Beiträge: 379
Registriert: So 06 Jul 2014 23:02

Re: Neue Testversion 21.40b6

Beitrag von Eurgail »

Guten Abend und gutes Neues noch!

1.)
In der aktuellen Version scheint PhotoLine Probleme mit der Ausgabe von umfliessendem Text mit im Hintergrund wirkenden Ebeneneffekten in komplexere Formate (getestet: PDF, SVG) zu haben.

Beispiel:
- Ein zu umfliessendes Objekt erstellen (irgendein Vektorobjekt zum Beispiel)
- Ein Textfeld erstellen
- Den Umfluss des Textfeldes dem Objekt zuweisen
- Der Textebene einen Ebeneneffekt, der im Hintergrund wirkt (zum Beispiel Schlagschatten), zuweisen
- Das Dokument nach PDF/SVG exportieren
Ergebnis: Der Schatten hat die richtige Position, der Text hat seinen Umfluss verloren.

Ein Vorschlag, der mir in dem Zusammenhang gekommen ist: Ich fände es intuitiver, wenn PhotoLine beim Export einzelner Ebenen einen Umfluss berücksichtigt; also wenn die Textebene einzeln exportiert wird, sie hinterher die passende Form hat ohne workaround über eine gemeinsame Gruppe oder so.

2.)
Wenn man auf eine Platzhalterebene, auf die gleichzeitig ein den Umriss ändernder Effekt/Filter angewendet wird (Verrechnungsmodus Ersetzen), einen im Hintergrund wirkenden Ebeneneffekt anwendet, wird bei der Ausgabe nach SVG/PDF (mit stufenloser Transparenz), die Originalebene mit ausgegeben.

3.)
In der aktuellen Beta geht die Grösseneinstellung der Schrift nicht mehr mit Strg + Maus.
Martin Huber
Entwickler
Entwickler
Beiträge: 4176
Registriert: Di 19 Nov 2002 15:49

Re: Neue Testversion 21.40b6

Beitrag von Martin Huber »

Eurgail hat geschrieben: Fr 04 Jan 2019 04:131.)
In der aktuellen Version scheint PhotoLine Probleme mit der Ausgabe von umfliessendem Text mit im Hintergrund wirkenden Ebeneneffekten in komplexere Formate (getestet: PDF, SVG) zu haben.
Ich denke, dieses Problem gibt es schon länger (seit Hintergrundebeneneffekte separat ausgegeben werden).
Es sollte in der nächsten Beta gehen.
Eurgail hat geschrieben: Fr 04 Jan 2019 04:13 Ein Vorschlag, der mir in dem Zusammenhang gekommen ist: Ich fände es intuitiver, wenn PhotoLine beim Export einzelner Ebenen
Du meinst "Ebene > Verwaltung > Ebene speichern..."?
Eurgail hat geschrieben: Fr 04 Jan 2019 04:13einen Umfluss berücksichtigt; also wenn die Textebene einzeln exportiert wird, sie hinterher die passende Form hat ohne workaround über eine gemeinsame Gruppe oder so.
Ich schau mir das an.
Eurgail hat geschrieben: Fr 04 Jan 2019 04:132.)
Wenn man auf eine Platzhalterebene, auf die gleichzeitig ein den Umriss ändernder Effekt/Filter angewendet wird (Verrechnungsmodus Ersetzen), einen im Hintergrund wirkenden Ebeneneffekt anwendet, wird bei der Ausgabe nach SVG/PDF (mit stufenloser Transparenz), die Originalebene mit ausgegeben.
Jetzt wird es kompliziert. Kannst du uns da eine kleines Beispieldokument schicken.
Eurgail hat geschrieben: Fr 04 Jan 2019 04:133.)
In der aktuellen Beta geht die Grösseneinstellung der Schrift nicht mehr mit Strg + Maus.
Unter macOS geht das. Ich schaue es mir noch unter Windows an.

Martin