Sign In  Sign Up Live-Chat

MacroPDF Error

Last post 05-29-2008, 6:41 AM by RubenL. 21 replies.
Page 1 of 2 (22 items)   1 2 Next >
Sort Posts: Previous Next
  •  04-18-2008, 3:51 AM 122939

    MacroPDF Error

    We are facing some problems when using MacroPDF. We have installed the last version of Barcode and properties like MacroPDF are not appearing. We understand that such properties are neccessary for a correct use.

     Can you send us a simple utilization example?

    Thanks.

     
  •  04-18-2008, 1:47 PM 123039 in reply to 122939

    Re: MacroPDF Error

    Hi,

    Please see the below example for generating the barcode of symbology MacroPDF.

    BarCodeBuilder barcode = new BarCodeBuilder();

    barcode.CodeText = "ABCD-1234";

    barcode.SymbologyType = Symbology.MacroPdf417;

    barcode.GenerateBarCodeImage();

    barcode.Save(@"c:\temp\a.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);

    Recognition example would be

    Aspose.BarCode.License license = new Aspose.BarCode.License();

    license.SetLicense(@"c:\aspose.total.lic");

    BarCodeReader br = new BarCodeReader(@"c:\temp\a.jpg");

    br.SymbologyType = Symbology.MacroPdf417;

    BarCodeInfo[] results;

    results = br.Read();

    // if recognised

    if (results.Length > 0)

    {

    Console.WriteLine("BarCode Found:" + results[0].CodeText);

    return results[0].CodeText;

    }

    return "no barcode found";


    Best Regards,

    Saqib Razzaq
    Support Developer
    Aspose Guangzhou Team

     
  •  04-21-2008, 8:11 AM 123272 in reply to 123039

    Re: MacroPDF Error

    Attachment: Present (inaccessible)
    Hi,

    Starting from the zip file we have managed to generate the different parts of the barcodes (00 to 16) with 400 characters in each part.

     In the last part (016) there's no codebar being drawn.

     Are we doing something wrong?

     ***************************

                Aspose.BarCode.License license = new Aspose.BarCode.License();

                license.SetLicense(@"C:\NET\Pruebas de Aspose\PruebaZIPSucesiones\PruebaSucesiones\Aspose.Total.lic");

                string[] trozos;
                Aspose.BarCode.BarCodeBuilder b;
                b = new Aspose.BarCode.BarCodeBuilder();
                b.SymbologyType = Symbology.MacroPdf417;
                b.Rows = 50;
                b.Columns = 14;
                b.Pdf417CompactionMode = Aspose.BarCode.Pdf417CompactionMode.Text;
                b.Pdf417ErrorLevel = Aspose.BarCode.Pdf417ErrorLevel.Level1;
                b.Pdf417Truncate = false;           
                byte[] textoBytes = File.ReadAllBytes("132829152008041702.ZIP");
                string textoBase64 = Convert.ToBase64String(textoBytes);
                int numTrozos = textoBase64.Length / 400;
                int numRestoCaracteres = textoBase64.Length % 400;

                int suma = 0; 
                if (numRestoCaracteres > 0)
                {               
                    trozos = new string[numTrozos+1];
                    for (int contador = 0; contador < numTrozos; contador++)
                    {
                        trozos[contador] = textoBase64.Substring(contador * 400, 400);
                    }

                     trozos[numTrozos] = textoBase64.Substring(textoBase64.Length - numRestoCaracteres, numRestoCaracteres);

                   numTrozos++;

                }
                else
                {
                    trozos = new string[numTrozos];

                    for (int contador = 0; contador < numTrozos; contador++)

                    {

                        trozos[contador] = textoBase64.Substring(contador * 400, 400);

                    }

                }

     

                //b.CodeLocation = Aspose.BarCode.CodeLocation.None;

               

                for (int contador = 0; contador < numTrozos; contador++)

                {

                    b.MacroPdf417SegmentID = contador;

                   

                    b.CodeText = trozos[contador];

                  

                    if (contador + 1 == numTrozos)

                    {

                        b.MacroPdf417LastSegment = true;

                        b.MacroPdf417SegmentID = -1;

                    }

                    else

                    b.MacroPdf417LastSegment = false;
                    b.MacroPdf417FileID = 0;
                    b.Save("manchas0" + contador + ".bmp");
                }


    ***************************


    How much is the max lenght for each part ?

    Thanks

     

    P.S. We attach a zip file with the mentioned elements.




     
  •  04-22-2008, 4:50 AM 123468 in reply to 123272

    Re: MacroPDF Error

    Hi,

    Thanks for the sample images. I will look into it and get back to you shortly.


    Best Regards,

    Saqib Razzaq
    Support Developer
    Aspose Guangzhou Team

     
  •  04-22-2008, 7:07 AM 123485 in reply to 123468

    Re: MacroPDF Error

    Hi,

    Could you please modify your code and test by doing the following changes in it.

    // set the pdf compact mode to binary instead of text

    b.Pdf417CompactionMode = Aspose.BarCode.Pdf417CompactionMode.Binary;

    // set the error level 2

    b.Pdf417ErrorLevel = Aspose.BarCode.Pdf417ErrorLevel.Level2;

    // disable the escape sequence characters e.g. \n \t etc

    b.EnableEscape = false;

    // convert the byte array into unicode string

    System.Text.UnicodeEncoding encoding = new UnicodeEncoding();

    string textoBase64 = encoding.GetString(textoBytes);

    I got 6 images by doing the above changes and applying it to the zip file you provided. All of them had barcodes. Please let me know if it works for you.

    I will check about the max length of Code Text with the development team and inform you soon about it.


    Best Regards,

    Saqib Razzaq
    Support Developer
    Aspose Guangzhou Team

     
  •  04-29-2008, 5:54 AM 124574 in reply to 123485

    Re: MacroPDF Error

    Hi,

    We've been testing your code and we have got 6 images.
    The next step is we've tried to unite the pieces and generate the file again. The file is created but It gives an error message "Bad format or damaged file".

    Please help !!


    The code is :

                // -------------------------
                // -------------------------
                //Comienza el reconocimiento de caracteres


                long tamanoArray=0;

                byte[] [] totalLeido = new byte[numTrozos] [];
                BarCodeInfo[] results;


                for (int contador = 0; contador < numTrozos; contador++)
                {
                    BarCodeReader br = new BarCodeReader(@"c:\manchas0" + contador + ".bmp");
                    br.SymbologyType = Symbology.MacroPdf417;
                    results = br.Read();


                    // if recognised
                    if (results.Length > 0)
                    {
                        tamanoArray = tamanoArray + results[0].CodeBytes.Length;
                        totalLeido[contador] = new byte[results[0].CodeBytes.Length];
                        Array.Copy(results[0].CodeBytes, totalLeido[contador], results[0].CodeBytes.Length);
                    }
                    else
                    { MessageBox.Show("Mancha no reconocida"); }
                }


                //Pasar todos los trozos a un array completo
                byte[] totalaEscribir = new byte[tamanoArray];
                long tamanoAcumulado = 0;

                for (int contador = 0; contador < numTrozos; contador++)
                {
                    Array.Copy(totalLeido[contador], 0, totalaEscribir, tamanoAcumulado, totalLeido[contador].Length);
                    tamanoAcumulado = tamanoAcumulado + totalLeido[contador].Length;
                }

                // Write to file
                File.WriteAllBytes(@"c:\generadoMacroPdf.zip", totalaEscribir);






     
  •  04-29-2008, 10:59 AM 124653 in reply to 124574

    Re: MacroPDF Error

    Attachment: Present (inaccessible)

    Hi,

    Please see the attached file. It solves the similar problem, but in this case, 1 encoded image is generated which have multiple barcodes in it. In your program, multiple images files were created.

    I have tested the attached file with your zip sample and found it working. It can encode and reconstruct the original zip (binary) file.

    Please let me know if this workaround sample works for you. Otherwise, if generating multiple image files is your project requirement, then I can debug and make it work for you.


    Best Regards,

    Saqib Razzaq
    Support Developer
    Aspose Guangzhou Team

     
  •  05-01-2008, 8:52 AM 124980 in reply to 124653

    Re: MacroPDF Error

    Hi,

    I am RubenL again. Ruglo is my home user.

    I have been watching your code. You use "b.SymbologyType = Symbology.Pdf417;" instead of "b.SymbologyType = Symbology.MacroPdf417;".
    Sorry, generating multiple image files and type MacroPdf417 are project requirement.

    Anyway I will do tests on your way to read and write the binary files.

    I'll be waiting for your answer.


    Thanks.



     
  •  05-02-2008, 5:56 AM 125115 in reply to 124980

    Re: MacroPDF Error

    Hi,

    Sorry, I just had a quick sample which solved a similar problem like yours and I overlooked Pdf417 and MacroPdf417.

    I am looking into the approach of generating separate image files with MacroPdf417 and get back to you soon.


    Best Regards,

    Saqib Razzaq
    Support Developer
    Aspose Guangzhou Team

     
  •  05-02-2008, 6:15 AM 125123 in reply to 125115

    Re: MacroPDF Error

    Attachment: Present (inaccessible)
    OK,
    I've been doing tests with your example and mine.
    I send you an example that works but I had to remove 6 characters to what he reads the statement "results = br.Read();".  Do you know why? Will always be 6 characters?

    Thanks, Saqid.
     
  •  05-03-2008, 9:33 AM 125258 in reply to 125123

    Re: MacroPDF Error

    Hello RubenL,

       Thank you for your post!

       In fact Aspose.BarCode is not able to support the recognition of MacroPDF fully now, though it supports generating MacroPDF barcodes. Our developers are still working at the recognition feature but I am not able to tell the timeline now. Sorry if any inconvenience and I will keep you update about the progress.Thanks again.

      

     


    Dean Deng
    Lead Developer
    Aspose Guangzhou Team
    About Us
    Contact Us
     
  •  05-04-2008, 4:02 AM 125279 in reply to 125258

    Re: MacroPDF Error

    Attachment: Present (inaccessible)

    Hello,

    We have made some fixes on the Aspose.Barcode to support the MacroPDF.

    Three new properties for MacorPDF are being added to BarCodeInfo class to indicate the recognition results:

       MacroPDFFileID, MacroPDFLastSegment,MacroPDFSegmentIndex

    Please try the attached beta dll for your testing. Feel free to let me know if you have any issues.


    Team Lead
    Aspose Guangzhou Team
    About Us

    Contact Us
     
  •  05-05-2008, 2:33 AM 125341 in reply to 125279

    Re: MacroPDF Error

    Hello,


    The properties "MacroPdf417LastSegment" and "MacroPdf417FileID" are already exist.

    Can you send me an example that use these new properties?

    I do not know how to use them.

    Thanks.


     
  •  05-05-2008, 8:00 AM 125397 in reply to 125341

    Re: MacroPDF Error

    Hi,

    We will post an example shortly.


    Best Regards,

    Saqib Razzaq
    Support Developer
    Aspose Guangzhou Team

     
  •  05-05-2008, 8:46 AM 125410 in reply to 125341

    Re: MacroPDF Error

    Hi RubenL,

       Just as a quick note:

       After you feed an image of MacroPdf barcode to BarCodeReader for recognition, you will get the results within the BarCodeInfo array. And the result BarCodeInfo will contains the SegmentID/FileID/LastSegment flag decode from the image beside the CodeText. If  the BarCodeReader failed to decode these information, the SegmentID and FieID will be -1.

       


    Dean Deng
    Lead Developer
    Aspose Guangzhou Team
    About Us
    Contact Us
     
Page 1 of 2 (22 items)   1 2 Next >
View as RSS news feed in XML