You are viewing limited content. For full access, please sign in.

Question

Question

jpg to pdf or tiff

asked on May 6, 2017

estimados buenos dias

quisiera saber si alguno de ustedes a podido convertir jpg a tif o pdf 

les agradeceria el apoyo

Saludos

0 0

Answer

SELECTED ANSWER
replied on May 17, 2017

1 0

Replies

replied on May 17, 2017 Show version history

Hi Miguel, 

The solution will require the use of the Laserfiche API in a workflow.

This script, used in workflow, will convert a JPG or TIF to a PDF. Be sure to add a reference to Laserfiche.DocumentServices for it to work.

Hope it works for you. Could you let me know?

-Ben

        Protected Overrides Sub Execute()
            dim LFDoc as DocumentInfo=me.BoundEntryInfo
            dim LFExport as New Laserfiche.DocumentServices.DocumentExporter
            dim LFImport as New Laserfiche.DocumentServices.DocumentImporter
            dim IOMemStream as New System.IO.MemoryStream()
            LFDoc.Lock(Laserfiche.RepositoryAccess.LockType.Exclusive)
            LFExport.ExportPdf(LFDoc,LFDoc.AllPages,Laserfiche.DocumentServices.PdfExportOptions.None,IOMemStream)
            IOMemStream.Flush
            IOMemStream.Seek(0,0)
            LFImport.Document=LFDoc
            LFImport.ImportEdoc("application/pdf",IOMemStream)
            LFDoc.DeletePages(LFDoc.AllPages,PageDeletionOptions.ForcePurge)
            LFDoc.Extension="pdf"
            LFDoc.Save
            LFDoc.Unlock

            'Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
        End Sub

 

 

-Ben 

2 0
replied on May 6, 2017

Si tienes adobe acrobat pro (tal vez con la versión gratis también) puedes abrir un jpeg y exportarlo en pdf o tiff.

0 0
replied on May 8, 2017 Show version history

Hola,

You can also use Laserfiche.Imaging.LfiImageConverter (part of the Laserfiche SDK) to convert between JPG and TIF.

I have some software written to do this kind of conversion. It's also great for compressing TIFFs (by converting colour TIFF-LZW to colour TIFF-JPEG.

Feel free to email if you'd like to know more. ben.birns@ingencia.co.uk. If you need it, I can add PDF support, too.

-Ben

Capture.PNG
Capture.PNG (64.9 KB)
0 0
replied on May 17, 2017

Ben Birns 

 

Dear users could help me in this case a user wants to convert jpg images to pdf when activating a label.

I know that it is necessary to generate a workflow, someone has had the same problem r

0 0
replied on May 23, 2017

Ben Birnd 

 

I generate the following error could you help me?

 

 

0 0
replied on May 23, 2017

You are using RA9.2 and Ben's sample was for RA10.  Basically, in 9.2, the DeletePages only takes 1 variable for the page range or page set.  So remove the PageDeletionOptions and you will be good.

LFDoc.DeletePages(LFDoc.AllPages)

 

1 0
replied on May 23, 2017

Estimado Bert Warren

 

Podrias ayudarme con este error 

0 0
replied on May 23, 2017

Your error is that the Document object is not set to an instance of an object.  My guess is that you are trying to test your workflow and you are leaving the Starting Entry ID empty.  The Starting Entry ID needs to be set to a valid Document ID that it can run the workflow on.

 

1 0
replied on May 23, 2017

Here is how I would modify the code to make sure objects are being released properly.

1 0
replied on July 21, 2020

Hi Bert,

 

thanks for your corde. I tried your solution but my PDF is empty.

I means the JPG is converted to PDF and I have no error in my workflow but my PDF is blank.

Do you have any idea?

Thanks in advance.

Regards

0 0
replied on July 21, 2020

Is the document a Laserfiche Document or an electronic document?  The code is for converting LF Documents (TIFF) to PDF.

0 0
replied on July 21, 2020

An Electronic document (a JPG) but in the Repository

I dragged and dropped the file from my desktop to the Laserfiche Client.

0 0
replied on July 21, 2020

but does it open in the LF viewer or does it have a JPEG icon and open in an external viewer like paint?

0 0
replied on July 28, 2020

Hi Bert, sorry for the late.

 

The jpg have a JPEG icon and I open it in an external viewer, not with the LF viewer.

0 0
replied on July 28, 2020

Then you need to look at how they are getting brought into the repository and see if there is any way that they can be brought in as a LF document rather than electronic document.

Since these are in the repository as electronic documents, there is no direct method to export them to PDF.  Laserfiche has no convertion for electronic document to PDF.

1 0
replied on July 29, 2020

Ok thanks for the tip.
I'm going to cry now XD

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.