Hello,
I have a pdf file from a customer who does not display correctly in the Devexpress PDF viewer, half of the pdf is shown black (see attachment).
Can you please check the attached pdf to see why it is not displayed properly?
In the Windows default Edge app the pdf opens without problem.
Also the pdf is strictly confidential, it contains customer info, please keep this ticket private until the attached pdf and screenshot is removed, thanks.
Screenshot of the problem
Hello Glenn,
Thank you for the file. We will examine it and get back to you once we have any results or need additional information. Thank you for your patience.
Please try using the following test and keep us informed of your results:
dxPDFCore.pas function TdxPDFDocumentImage.ToRGB(const AData: TBytes; APixelFormat: TdxPDFPixelFormat; AWidth, AHeight: Integer): TBytes; var AZero, AOne, B, AMask, AComponent: Byte; ADataLength, Y, ASrc, ADest, X, ASize, I, AIndex: Integer; ARGBData: TBytes; begin AZero := 0; AOne := 255; case APixelFormat of pfGray1bit: begin ADataLength := Length(AData); SetLength(ARGBData, AWidth * AHeight * 3); ASrc := 0; ADest := 0; for Y := 0 to AHeight - 1 do begin B := AData[ASrc]; AMask := $80; for X := 0 to AWidth - 1 do begin AComponent := IfThen((B and AMask) = 0, AZero, AOne); ARGBData[ADest] := AComponent; ARGBData[ADest + 1] := AComponent; ARGBData[ADest + 2] := AComponent; Inc(ADest, 3); AMask := AMask shr 1; if AMask = 0 then begin AMask := $80; Inc(ASrc); if ASrc >= ADataLength then Break; B := AData[ASrc]; end; end; if AMask <> $80 then Inc(ASrc); end; Result := ARGBData; end; pfGray8bit: begin ASize := Length(AData); SetLength(ARGBData, ASize * 3); AIndex := 0; for I := 0 to ASize - 1 do begin B := AData[I]; ARGBData[AIndex] := B; ARGBData[AIndex + 1] := B; ARGBData[AIndex + 2] := B; Inc(AIndex, 3); end; Result := ARGBData; end; else Result := AData; end; end;
Hi Mikhail,
the solution above works.
Can you inform me when it will be added into the devexpress release (which version of VCL in other words)?
thanks, regards,
Glenn
It will be added to the next minor version of our controls.