Hello, i have a problem with 3D-PDFs. From Solid Edge i save an assembly as 3D-PDF. now i want to add a image to the PDF. Here is my code in Visual Studio 2015 VB: Try
QP = CreateObject(ClassName)
Catch ex As Exception
Finally If QP.UnlockKey(LicenseKey) = 0 Then MsgBox("Debenu PDF Library - Invalid license key: Have you included your license key? -") QP = Nothing Else QP.LoadFromFile(strtempFilename, "") ' Prototyp einfügen Dim strPrototypDateiname = DrFritsch_Code1.Reg_lesen_PDF_Prototyp_Dateiname()
If strPrototypDateiname = "" Then MsgBox("Der Text für Prototyp konnte nicht gefunden werden!" & vbNewLine & vbNewLine & "Fehler: Dateiname nicht definiert", MsgBoxStyle.Information, "Automatische PDF Erstellung") ElseIf Not My.Computer.FileSystem.FileExists(strPrototypDateiname) Then MsgBox("Die Datei für die Kennzeichnung von Prototypen der PDFs konnte nicht gefunden werden!" & vbNewLine & vbNewLine & "Fehler: Dateiname nicht gefunden: " & strPrototypDateiname, MsgBoxStyle.Information, "Automatische PDF Erstellung") Else Dim dblPrototyp_Position_Links As Double = DrFritsch_Code1.Reg_lesen_PDF_Prototyp_Werte(1) Dim dblPrototyp_Position_Oben As Double = DrFritsch_Code1.Reg_lesen_PDF_Prototyp_Werte(2) Dim dblPrototyp_Position_Breit As Double = DrFritsch_Code1.Reg_lesen_PDF_Prototyp_Werte(3) Dim dblPrototyp_Position_Hoehe As Double = DrFritsch_Code1.Reg_lesen_PDF_Prototyp_Werte(4) Dim intPrototyp_Options As Integer = DrFritsch_Code1.Reg_lesen_PDF_Prototyp_Werte(5) 'If dblPrototyp_Position_Links = 0 Then dblPrototyp_Position_Links = 200 'If dblPrototyp_Position_Oben = 0 Then dblPrototyp_Position_Oben = 200 If dblPrototyp_Position_Breit = 0 Then dblPrototyp_Position_Breit = 500 If dblPrototyp_Position_Hoehe = 0 Then dblPrototyp_Position_Hoehe = 300 ' Call CompressImages prior to AddImageFromFile, ' if image data Is uncompressed it will be ' compressed using flate, if already compressed ' no change will occur rc = QP.CompressImages(1) Dim intPageCount = QP.PageCount rc = QP.AddImageFromFile(strPrototypDateiname, 0) ' Select the image rc = QP.SelectImage(rc) ' Get the horizontal And vertical resolution ' of the image if it exists Dim dpix = QP.ImageHorizontalResolution() Dim dpiy = QP.ImageVerticalResolution()
' If image does Not have a DPI use 72 as default If (dpix = 0) Then dpix = 72 If (dpiy = 0) Then dpiy = 72 ' Calculate image width in points ' taking into account the image size in ' pixels And the DPI value Dim ImageWidthInPoints As Double = QP.ImageWidth() / dpix * 72.0 ' assumming dpi units Dim ImageHeightInPoints As Double = QP.ImageHeight() / dpiy * 72.0 QP.SetOrigin(1) ' Top Left ' Start drawing the top left corner of the image rc = QP.DrawImage(dblPrototyp_Position_Links, dblPrototyp_Position_Oben, ImageWidthInPoints, ImageHeightInPoints)
End If End If
QP.SaveToFile(strtempFilename)
QP = Nothing End If End Try but in the 3D-PDF the image is not visible. Has anyone a solution Greatings from Fellbach Martin
|